summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* fixes #267 - ALTER TABLE ... PRIMARY/UNIQUE KEY "Missing comma" errorMisterCoder2019-11-131-1/+6
|
* Fix php compatiblity (array syntax)William Desportes2019-11-011-1/+1
| | | | | Ref: fd4c4f34715070d7f7238ab3838935863a92f556 Signed-off-by: William Desportes <williamdes@wdes.fr>
* Add test case to check partition name starting by a numberHugues Peccatte2019-11-011-1/+1
| | | | Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
* Fix #13951 wrong parsing partitionsHugues Peccatte2019-11-011-4/+10
| | | | | | When partition names contain "_", the parser wasn't reading the full name, but stopped before the first "_". Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
* Fix #221 - parse truncate statementSinri Edogawa2019-10-282-5/+19
| | | | | | | | Fixes: #221 Pull-request: #222 Co-authored-by: Sinri Edogawa <e.joshua.s.e@gmail.com> Signed-off-by: William Desportes <williamdes@wdes.fr>
* Merge #264 - parse CHECK keyword on table definitionWilliam Desportes2019-10-281-1/+6
|\ | | | | | | | | | | | | Ref: #167 Pull-request: #264 Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Manage "CHECK" keywordHugues Peccatte2019-10-281-1/+6
| | | | | | | | | | | | | | Even if this keyword is ignored by MySQL, it should be parsed. Ref: #167 Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
* | fix implode arg. orderRemi Collet2019-10-282-2/+2
|/ | | | Ref: https://www.php.net/manual/en/function.implode.php
* revert usage of new array syntax []William Desportes2019-05-293-4/+4
| | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Related-to: 930a860bc7f0684c45babd012070f88a9505d427, 5d5089a259d0195c4a1e4aa3588c31c839954067 Signed-off-by: William Desportes <williamdes@wdes.fr>
* Revert "Enable strict mode on PHP files"William Desportes2019-05-2884-98/+98
| | | | | This reverts commit 17da8a34b81442524a8e01fead7b5968fa1cc39d. Signed-off-by: William Desportes <williamdes@wdes.fr>
* revert of new array syntaxWilliam Desportes2019-05-2859-784/+784
| | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
* Revert array syntaxWilliam Desportes2019-05-2844-137/+137
| | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
* Fix merge conflicts for pull request #242Isaac Bennetch2019-05-093-2/+9
|\ | | | | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
| * CS fixRadosław Kowalewski2019-04-191-1/+1
| |
| * Recognize question mark as parameter, add formatter for parametersRadosław Kowalewski2019-04-193-2/+9
| |
* | Merge pull request #245 from staabm/patch-1Isaac Bennetch2019-05-081-3/+5
|\ \ | | | | | | Added null check to fix tests from pull request #224.
| * | Added null checkMarkus Staab2019-05-071-3/+5
| | |
* | | Fix errors detected by PHPStan at level 0Maurício Meneghini Fauth2019-05-082-0/+3
|/ / | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Fix issue #223: can't parse multiple call statements (#224)Everstray Jun Sinri Edogawa2019-05-062-8/+26
| | | | | | | | | | Fix for errors when using multiple CALL statements and no arguments/parenthesis. Fixes: #223
* | Merge pull request #241 from LeSuisse/php-warning-incomplete-case-expressionIsaac Bennetch2019-05-051-3/+3
|\ \ | | | | | | Fix PHP warnings when building an incomplete CASE expression
| * | Fix PHP warnings when building an incomplete CASE expressionThomas Gerbet2019-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue can be reproduced with the following code snippet: ```php new \PhpMyAdmin\SqlParser\Parser('SELECT a CASE'); // PHP Warning: count(): Parameter must be an array or an object that implements Countable in src/Components/CaseExpression.php on line 296 // PHP Warning: count(): Parameter must be an array or an object that implements Countable in src/Components/CaseExpression.php on line 297 ```
* | | Add usage hints for command line stdinIsaac Bennetch2019-04-291-0/+3
|/ / | | | | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
* | Support reading from stdinMarkus Staab2019-04-051-0/+23
| |
* | fix: incorrect lastClauseIdx in Util::getQueryDeven Bansod2019-03-121-2/+2
| |
* | Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-03-071-4/+6
| |
* | Fixed statements INSERT and REPLACE + options.Przemek Szalko2019-02-152-3/+4
| |
* | Changed implementation of build() methods to generate more consistent SQL.Przemek Szalko2019-02-153-4/+4
| | | | | | | | This commit fixes implementation of `build()` methods to produce more consistent SQL code without redundant spaces.
* | Enable strict mode on PHP filesMaurício Meneghini Fauth2019-01-1684-98/+98
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* | Apply phpmyadmin/coding-standardMaurício Meneghini Fauth2019-01-1678-890/+1500
|/ | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-01-031-1/+1
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #203 from mostertb/case-aliasIsaac Bennetch2018-12-241-2/+72
|\ | | | | Add support for Aliases on CASE expressions
| * Apply php-cs-fixer formatting changesBrad Mostert2018-10-131-12/+9
| |
| * Handle end of statement while parsing CASE aliasBrad Mostert2018-10-131-0/+4
| |
| * Explicitly handle case where keyword encountered before alias value foundBrad Mostert2018-10-131-8/+10
| |
| * Handle CASE alias without ASBrad Mostert2018-10-131-16/+14
| |
| * Add Support for CASE ... END AS aliasBrad Mostert2018-10-131-0/+69
| |
* | Merge pull request #216 from devenbansod/fix/199Deven Bansod2018-12-234-0/+226
|\ \ | | | | | | Add support for INDEX hints in SELECT statement
| * | Add support for INDEX hints in SELECT statementDeven Bansod2018-12-234-0/+226
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #215 from devenbansod/fix/180Deven Bansod2018-12-223-0/+336
|\ \ \ | |/ / | | | Add support for LOCK and UNLOCK Statements
| * | Add support for LOCK and UNLOCK StatementsDeven Bansod2018-12-223-0/+336
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #214 from devenbansod/fix/160Deven Bansod2018-12-221-4/+18
|\ \ \ | |/ / |/| | Throw a parser error on extraneous comma in UPDATE statement
| * | Throw a parser error on extraneous comma in UPDATE statementDeven Bansod2018-12-221-4/+18
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #212 from devenbansod/fix/189Deven Bansod2018-12-211-0/+23
|\ \ \ | |/ / |/| | Throw a parse error if a comma missing between two alter operations
| * | Throw a parse error if a comma missing between two alter operationsDeven Bansod2018-12-211-0/+23
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Fix: Add missing support for STRAIGHT_JOINDeven Bansod2018-12-211-0/+4
|/ / | | | | | | | | | | | | | | * This was originally added in v3.0.8 but was erroneously removed in https://github.com/phpmyadmin/sql-parser/commit/848610a2004e37ec374c2c7a688c8c9131cd5687#diff-1041b02aae148a89853dc0d2710afc9c * Added a test case for this so that we don't remove it in future releases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #211 from devenbansod/fix/190Deven Bansod2018-12-212-4/+33
|\ \ | | | | | | Add support for end options in SET statement
| * | Add support for end options in SET statementDeven Bansod2018-12-212-4/+33
| | | | | | | | | | | | | | | | | | * Support `[{ COLLATE expr | DEFAULT }] in `SET NAMES` statement Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #210 from devenbansod/fix/204Deven Bansod2018-12-213-2/+10
|\ \ \ | | | | | | | | Fix building of RenameStatement
| * | | Fix building of RenameStatementDeven Bansod2018-12-203-2/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | * The nuance here is that we don't treat `RENAME TABLE` as the keyword of the clause, only `RENAME` is considered. * That's why we can't use `Statement::$CLAUSES` directly here (even with value of `3` (see `Statement::$CLAUSES`)) * Providing an overriden definition of `build()` in RenameStatement Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Add support for PURGE statementsDeven Bansod2018-12-202-0/+145
|/ / | | | | | | | | | | Fix #207 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix unused variableBruno Perel2018-12-091-3/+3
| |
* | Fix testsBruno Perel2018-11-273-21/+24
| |
* | Use triple (in)equalities when type compatibility is ensuredBruno Perel2018-11-2617-53/+51
| |
* | Cleanup and improve readability:Bruno Perel2018-11-2625-469/+454
|/ | | | | Avoid duplicate if conditions Use switch/case instead of ifs when possible
* Create or replace view query not working issue solvedAswani Prakash2018-07-031-1/+1
| | | | Signed-off-by: Aswani Prakash <aswani15prakash@gmail.com>
* PHPDOC fixWilliam Desportes2018-06-061-0/+1
| | | | | | - Added phpdoc for $options as requested by Sami Signed-off-by: William Desportes <williamdes@wdes.fr>
* Fixes from PHPStan level 2Gabriel Caruso2018-01-141-3/+1
|
* Fixes from PHPStan level 0Gabriel Caruso2018-01-145-3/+5
|
* Improve SQL context loadingMichal Čihař2017-12-061-27/+21
| | | | | | | | | | - add fallback in case there is no version match - do not zero one by one, byt by two to match version parts - better handle corner cases Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13728 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix parsing of CREATE TABLE with per field COLLATEMichal Čihař2017-11-081-0/+4
| | | | | | Fixes #182 Signed-off-by: Michal Čihař <michal@cihar.com>
* Document that position is counted in chars not bytesMichal Čihař2017-10-161-0/+3
| | | | | | Issue #177 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixed build CREATE TABLE query with PARTITIONS having ENGINE but not VALUES.Michal Čihař2017-10-101-1/+1
| | | | | | Fixes #174 Signed-off-by: Michal Čihař <michal@cihar.com>
* Apply php-cs-fixerMichal Čihař2017-10-1011-23/+25
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Make crossreferences workMichal Čihař2017-10-0211-11/+44
| | | | | | Wildcards really can not work here, list the constants. Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix #172 Support parameter bindingMadhura Jayaratne2017-09-234-0/+12
| | | | Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
* Always initialize querytype flagMichal Čihař2017-09-041-1/+1
| | | | | | | | This avoids problems later when using it to detect handling of query. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13640 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add support for MariaDB 10.3 INTERSECT and EXCEPT.Michal Čihař2017-08-303-2/+22
| | | | | | Fixes #166 Signed-off-by: Michal Čihař <michal@cihar.com>
* Allow to specify context on lint-queryMichal Čihař2017-08-301-2/+6
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add MariaDB 10.3 contextMichal Čihař2017-08-301-0/+362
| | | | | | | | This also includes INTERSECT and EXPECT reserved words. Issue #166 Signed-off-by: Michal Čihař <michal@cihar.com>
* Update list of MariaDB reserved wordsMichal Čihař2017-08-302-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Improve formatting of context name for major releasesMichal Čihař2017-08-305-10/+10
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* 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>