summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'QA'William Desportes2019-12-318-17/+17
|\ | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Fix phpdoc using phpstan level 3William Desportes2019-12-318-17/+17
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Remove left overs of old array syntaxWilliam Desportes2019-12-316-11/+11
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Merge branch 'QA'William Desportes2019-12-312-1/+2
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Merge #280 - Add support for DROP USER statementWilliam Desportes2019-12-311-0/+1
| |\ | | | | | | | | | | | | | | | | | | Pull-request: #280 Fixes: #259 Signed-off-by: William Desportes <williamdes@wdes.fr>
| | * fix #259: Add support for DROP USER statementDeven Bansod2019-12-311-0/+1
| | |
| * | Fix #249 - Notice - Undefined index: ORDER BYWilliam Desportes2019-12-311-1/+1
| |/ | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Merge branch 'QA'William Desportes2019-12-311-1/+1
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Add more tests for CLI stdinWilliam Desportes2019-12-311-1/+1
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Merge branch 'QA'William Desportes2019-12-313-3/+20
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Merge #276 - add missing options in SET statementWilliam Desportes2019-12-311-1/+9
| |\ | | | | | | | | | | | | | | | | | | Pull-request: #276 Fixes: #255 Signed-off-by: William Desportes <williamdes@wdes.fr>
| | * fix #255: add missing options in SET statementDeven Bansod2019-12-291-1/+9
| | |
| * | Merge #277 - allow SCHEMA to be used in CREATE Database statementWilliam Desportes2019-12-311-3/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Pull-request: #277 Fixes: #231 Signed-off-by: William Desportes <williamdes@wdes.fr>
| | * | fix #231: allow SCHEMA to be used in CREATE Database statementDeven Bansod2019-12-291-3/+7
| | |/
| * | 275: Prevent overwrite of offset in Limit clause by parenthesisDeven Bansod2019-12-301-0/+5
| |/
* | Add PHPStan at level 2Maurício Meneghini Fauth2019-12-164-4/+10
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Fix uncaught TypeError with CASE StatementMaurício Meneghini Fauth2019-12-141-1/+1
| | | | | | | | | | | | Related to #272 Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove useless comments and annotationsMaurício Meneghini Fauth2019-12-1483-427/+35
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove unnecessary string concatenationMaurício Meneghini Fauth2019-12-141-1/+1
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Replace is_null($var) with $var === nullMaurício Meneghini Fauth2019-12-148-25/+25
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove useless parenthesesMaurício Meneghini Fauth2019-12-1412-16/+16
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Reference classes via a use statementMaurício Meneghini Fauth2019-12-1410-20/+35
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove trailing whitespaceMaurício Meneghini Fauth2019-12-142-2/+2
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Replace double quotes string with single quotesMaurício Meneghini Fauth2019-12-141-1/+1
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Fix a few PHPStan level 1 errorsMaurício Meneghini Fauth2019-12-061-0/+1
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Merge branch 'QA'William Desportes2019-11-131-0/+5
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * fixes #267 - ALTER TABLE ... PRIMARY/UNIQUE KEY "Missing comma" errorMisterCoder2019-11-131-1/+6
| |
* | Merge branch 'QA'William Desportes2019-11-011-4/+10
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * 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>
* | Merge branch 'QA'William Desportes2019-10-297-12/+32
|\ \ | |/ | | | | | | | | This merge includes phpcs fixes Signed-off-by: William Desportes <williamdes@wdes.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>
* | Replaced new self with new staticMartkCz2019-05-1722-35/+35
|/
* 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>