summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add MariaDB contexts based on the corresponding MySQL versionsMichal Čihař2017-08-303-0/+1037
| | | | | | Fixes #4 Signed-off-by: Michal Čihař <michal@cihar.com>
* Update generated contextsMichal Čihař2017-08-302-36/+406
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Silent warnings from creating exceptionMichal Čihař2017-08-211-1/+1
| | | | | | | | | | Apparently this can lead to strange errors on some setups: Accessing static property Exception::$trace as non static Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12791 Signed-off-by: Michal Čihař <michal@cihar.com>
* Use LoaderException instead of generic Exception for loader errorsMichal Čihař2017-08-212-4/+45
| | | | | | | This make it easier to handle the errors and could help with https://github.com/phpmyadmin/phpmyadmin/issues/12791 Signed-off-by: Michal Čihař <michal@cihar.com>
* Provide $expr consistently for CaseExpression as with ExpressionMichal Čihař2017-07-122-3/+9
| | | | | | | This is probably better approach to address https://github.com/phpmyadmin/phpmyadmin/issues/13487 Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly handle CASE expression in SELECT statementMichal Čihař2017-07-121-0/+3
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13487 Signed-off-by: Michal Čihař <michal@cihar.com>
* Improved parsing of incomplete CREATE FUNCTION statementsMichal Čihař2017-07-121-2/+3
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13486 Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly handle incomplete statementsMichal Čihař2017-07-121-1/+6
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13485 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add sanity check when detecting token typeMichal Čihař2017-07-121-0/+9
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13483 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add recognizer for SET StatementsDeven Bansod2017-07-071-0/+3
| | | | | | | | Fix #157 Add Tests for SET statement flag Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Improve UtfString handling of invalid stringsMichal Čihař2017-06-151-1/+5
| | | | | | | | | First check whether string is actually utf-8 before trying to process it as it. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13385 Signed-off-by: Michal Čihař <michal@cihar.com>
* Honor newlines before comments in formatterMichal Čihař2017-06-081-2/+11
| | | | | | Issue #156 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixed parsing SQL comment at the end of query.Michal Čihař2017-06-082-16/+22
| | | | | | Fixes #156 Signed-off-by: Michal Čihař <michal@cihar.com>
* Prefix all SQL mode constants with SQL_MODE_v4.1.7Michal Čihař2017-06-061-26/+26
| | | | | | | | | Previously the simple ones were not prefixed while the combination ones were, what make it impossible to set the combination ones. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13358 Signed-off-by: Michal Čihař <michal@cihar.com>
* Remove not used type arg from GROUP BYMichal Čihař2017-06-011-12/+3
| | | | | | | | It should not be there since beginning. Issue #154 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add GroupKeyword class to fix postgres GROUP BYJosé Tobias de Freitas Neto2017-05-312-1/+142
|
* Merge commit 'bb384a13abf5b8e96c2b50fef29e6be3b5ba9d04'Michal Čihař2017-05-171-2/+13
|\
| * Don't print duplicated cli formatting charactersDamian Dlugosz2017-05-171-2/+13
| |
* | Inline CREATE PROCEDUREDamian Dlugosz2017-05-161-0/+1
|/
* Improved format of INSERT queries.Dan Ungureanu2017-05-161-1/+24
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Fixed minor documentation error.Dan Ungureanu2017-05-161-1/+1
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for SetOperation.Dan Ungureanu2017-05-161-0/+12
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for RenameOperation.Dan Ungureanu2017-05-161-0/+12
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for ParameterDefinition.Dan Ungureanu2017-05-161-0/+14
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for JoinKeyword.Dan Ungureanu2017-05-161-0/+18
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for IntoKeyword.Dan Ungureanu2017-05-161-0/+26
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Added constructor for AlterOperation.Dan Ungureanu2017-05-161-0/+17
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Fixed invalid lexing of queries with : in strings.Michal Čihař2017-05-151-19/+9
| | | | | | | | We really can't use anyting as label, it has way stricter syntax. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13272 Signed-off-by: Michal Čihař <michal@cihar.com>
* Maximum length of a delimiter is 15 characters.Dan Ungureanu2017-05-081-1/+3
| | | | | | Fixes #12. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Apply php-cs-fixerMichal Čihař2017-05-052-2/+3
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Remove debug error messagesMichal Čihař2017-05-051-3/+3
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly handle lowercase begin statementMichal Čihař2017-05-051-1/+1
| | | | | | | | Actually all statements where main token is used as an option. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13240 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixes wrong extract of string tokens with escaped characters.Dan Ungureanu2017-04-111-3/+18
| | | | | | Fixes #40. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Merge pull request #148 from nijel/inline-comment-newlineMichal Čihař2017-04-062-0/+12
|\ | | | | Fixed inline comments parsing
| * Keep linebreaks after commentsMichal Čihař2017-04-041-0/+4
| | | | | | | | | | | | Concatenating line terminated comments will change the query. Signed-off-by: Michal Čihař <michal@cihar.com>
| * Fixed handling newlines in inline comentsMichal Čihař2017-04-041-0/+8
| | | | | | | | | | | | | | | | | | The newline is now included as separate token, previously it was silently discarded, so it was not present in output. See https://github.com/phpmyadmin/phpmyadmin/issues/13139 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge pull request #146 from Achilles-96/Issue-11717Michal Čihař2017-04-061-3/+5
|\ \ | |/ |/| Fixes striping of inline comments #11717
| * Fixes striping of inline comments #11717Raghuram2017-04-051-3/+5
| | | | | | | | Signed-off-by: Raghuram Vadapalli <raghuram.vadapalli@research.iiit.ac.in>
* | Add utility to tokenize queryMichal Čihař2017-04-031-0/+50
| | | | | | | | | | | | | | | | It's mostly useful for debugging changes in parser. See #147. Signed-off-by: Michal Čihař <michal@cihar.com>
* | Coding style fixMichal Čihař2017-04-031-1/+0
|/ | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #145 from devenbansod/fix_144Michal Čihař2017-03-301-0/+21
|\ | | | | Fix parsing of DELETE clauses with JOINs
| * Fix parsing of DELETE clauses with JOINsDeven Bansod2017-03-301-0/+21
| | | | | | | | | | | | | | | | | | Ref: https://dev.mysql.com/doc/refman/5.7/en/delete.html Fix #144 Fix phpmyadmin/phpmyadmin#13129 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix type documentationMichal Čihař2017-02-201-1/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | This is already doneMichal Čihař2017-02-201-1/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Fix BEGIN/END indentationMichal Čihař2017-02-201-6/+1
| | | | | | | | | | | | Ensure we never have negative indentation Signed-off-by: Michal Čihař <michal@cihar.com>
* | Document that lack of break is intentionalMichal Čihař2017-02-201-0/+5
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Correctly document typesMichal Čihař2017-02-201-2/+2
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Aplly coding style fixesMichal Čihař2017-02-202-25/+24
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Use strlen() on string like objects instead of count()Michal Čihař2017-02-201-2/+2
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Revert "Remove invalid condition"Michal Čihař2017-02-201-1/+1
| | | | | | | | This reverts commit fe4f5f7a5cb965ec5746c260c063f15e08500fd7.
* | Remove invalid conditionMichal Čihař2017-02-201-1/+1
| | | | | | | | | | | | The OptionsArray does not support count(). Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge pull request #143 from devenbansod/fix_131Michal Čihař2017-02-208-11/+420
|\ \ | | | | | | Parse LOAD statement properly
| * | Parse LOAD statement properlyDeven Bansod2017-02-188-11/+420
| |/ | | | | | | | | | | | | | | Fix #131 Might help to fix phpmyadmin/phpmyadmin#12345 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #141 from bigfoot90/inline-joinsMichal Čihař2017-02-201-0/+10
|\ \ | | | | | | Inline JOINs
| * | Inline JOINsDamian Dlugosz2017-02-161-0/+10
| |/
* | Fix broken clause order validationDeven Bansod2017-02-171-11/+25
|/ | | | | | Fix #113 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Use instanceof instead of getclassMichal Čihař2017-02-141-2/+2
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly document null return valuesMichal Čihař2017-02-141-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge remote-tracking branch 'origin/pull/138'Michal Čihař2017-02-1414-112/+107
|\
| * No useless elseDamian Dlugosz2017-02-1214-112/+110
| |
* | Order importsDamian Dlugosz2017-02-1224-51/+51
|/
* Apply cs fixesDamian Dlugosz2017-02-122-1/+1
|
* Fix parameters documentationMichal Čihař2017-02-071-2/+2
| | | | | | This function will only get SelectStatement, so be clear on that. Signed-off-by: Michal Čihař <michal@cihar.com>
* Split select flags calculation to separate methodMichal Čihař2017-02-071-62/+76
| | | | | | It's the most complex case right now, so let's separate it. Signed-off-by: Michal Čihař <michal@cihar.com>
* Move all flags definition outside of methodMichal Čihař2017-02-071-155/+157
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix parameter typeMichal Čihař2017-02-071-2/+2
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly document parameter typeMichal Čihař2017-02-073-6/+6
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Various coding style fixesMichal Čihař2017-02-071-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Move count() outside of the loopMichal Čihař2017-02-071-10/+6
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Scrutinizer Auto-FixesScrutinizer Auto-Fixer2017-02-062-2/+2
| | | | This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
* Remove double spacingMichal Čihař2017-02-067-52/+52
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix comment typeMichal Čihař2017-02-062-12/+12
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix class nameMichal Čihař2017-02-061-2/+2
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge remote-tracking branch 'origin/pull/120' into tmpMichal Čihař2017-02-061-4/+1
|\
| * Remove @varDamian Dlugosz2017-02-031-2/+0
| |
| * And now?Damian Dlugosz2017-02-011-6/+3
| |
| * Testing create tableDamian Dlugosz2017-02-011-1/+3
| |
* | Use keyword attribute for comparing keyword nameMichal Čihař2017-02-0617-82/+80
| | | | | | | | | | | | | | We do not uppercase non reserved keywords, so this way we make the comparison properly handle that. Signed-off-by: Michal Čihař <michal@cihar.com>
* | Store uppercase keyword value for later processingMichal Čihař2017-02-061-1/+10
| | | | | | | | | | | | This makes easier to compare it later. Signed-off-by: Michal Čihař <michal@cihar.com>
* | Made motranslator vendor optionalDamian Dlugosz2017-02-021-0/+4
|/
* Fix MoTranslator integration with current versionsorigin/motranslatorMichal Čihař2017-01-232-7/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge branch 'master' into motranslatorMichal Čihař2017-01-2370-398/+396
|\
| * Coding style fixesMichal Čihař2017-01-231-3/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
| * Added PhpMyAdmin namespace prefix to follow PSR-4.Michal Čihař2017-01-2370-393/+393
| | | | | | | | | | | | Fixes #126 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Update to use motranslator 3.0Michal Čihař2017-01-231-1/+1
| | | | | | | | | | | | | | | | It uses PSR-4 prefix for PhpMyAdmin namespace. See https://github.com/phpmyadmin/sql-parser/issues/126 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-233-54/+21
|\ \ | |/
| * Remove unused codeMichal Čihař2017-01-201-2/+0
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
| * Run php-cs-fixerMichal Čihař2017-01-202-2/+3
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
| * Merge pull request #123 from bigfoot90/fix-comment-parsingMichal Čihař2017-01-202-53/+21
| |\ | | | | | | Fix comment parsing
| | * Fix comment parsingDamian Dlugosz2017-01-101-51/+21
| | |
| | * Fix comment parsingDamian Dlugosz2017-01-081-2/+0
| | |
* | | Merge branch 'master' into motranslatorMichal Čihař2017-01-203-92/+129
|\ \ \ | |/ /
| * | Fixed parsing of unterminated variables.Michal Čihař2017-01-201-1/+1
| | | | | | | | | | | | | | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12894 Signed-off-by: Michal Čihař <michal@cihar.com>
| * | Remove unuseful bracketsDamian Dlugosz2017-01-082-71/+97
| |/
| * Merge pull request #117 from bigfoot90/small-fixMichal Čihař2017-01-071-22/+28
| |\ | | | | | | Some clean, remove useless brackets
| | * Remove useless bracketsDamian Dlugosz2017-01-061-22/+28
| | |
| * | Fix indentation on html formatDamian Dlugosz2017-01-061-1/+5
| |/
| * Properly handle operators AND, NOT, OR, XOR, DIV, MODMichal Čihař2017-01-061-0/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Apply php-cs-fixerMichal Čihař2017-01-063-14/+8
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-0670-1875/+1592
|\ \ | |/