summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'QA'William Desportes2019-11-011-0/+12
|\ | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Add test case to check partition name starting by a numberHugues Peccatte2019-11-011-0/+12
| | | | | | | | Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
* | Merge branch 'QA'William Desportes2019-10-292-8/+42
|\ \ | |/ | | | | | | | | This merge includes phpcs fixes Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Manage "CHECK" keywordHugues Peccatte2019-10-281-0/+16
| | | | | | | | | | | | | | Even if this keyword is ignored by MySQL, it should be parsed. Ref: #167 Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
| * Fix CLITestWilliam Desportes2019-05-291-1/+1
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * revert usage of new array syntax []William Desportes2019-05-298-25/+29
| | | | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Related-to: 930a860bc7f0684c45babd012070f88a9505d427, 5d5089a259d0195c4a1e4aa3588c31c839954067 Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Revert "Enable strict mode on PHP files"William Desportes2019-05-2870-70/+1
| | | | | | | | | | This reverts commit 17da8a34b81442524a8e01fead7b5968fa1cc39d. Signed-off-by: William Desportes <williamdes@wdes.fr>
| * revert of new array syntaxWilliam Desportes2019-05-2847-1192/+1190
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Revert array syntaxWilliam Desportes2019-05-283-6/+6
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Fix deprecated annotations William Desportes2019-09-255-28/+16
| | | | | | | | | | | | Ref: #261 Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Set return type to void on setUp for phpunitWilliam Desportes2019-09-251-1/+1
|/ | | | | | Closes: #261 Signed-off-by: William Desportes <williamdes@wdes.fr>
* Fix merge conflicts for pull request #242Isaac Bennetch2019-05-092-0/+48
|\ | | | | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
| * Recognize question mark as parameter, add formatter for parametersRadosław Kowalewski2019-04-192-0/+48
| |
* | Fix errors detected by PHPStan at level 0Maurício Meneghini Fauth2019-05-085-3/+3
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Fix failing test from pull request #224Isaac Bennetch2019-05-061-1/+1
| | | | | | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
* | Merge pull request #241 from LeSuisse/php-warning-incomplete-case-expressionIsaac Bennetch2019-05-0518-17/+23
|\ \ | | | | | | Fix PHP warnings when building an incomplete CASE expression
| * | Fix PHP warnings when building an incomplete CASE expressionThomas Gerbet2019-04-1018-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+12
|/ / | | | | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
* | added stdin testcoverageMarkus Staab2019-04-051-0/+26
| |
* | fix: incorrect lastClauseIdx in Util::getQueryDeven Bansod2019-03-121-1/+86
| |
* | Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-03-074-5/+10
| |
* | Fixed statements INSERT and REPLACE + options.Przemek Szalko2019-02-152-0/+23
| |
* | Changed implementation of build() methods to generate more consistent SQL.Przemek Szalko2019-02-156-23/+23
| | | | | | | | This commit fixes implementation of `build()` methods to produce more consistent SQL code without redundant spaces.
* | Fix risky testsMaurício Meneghini Fauth2019-01-1627-55/+62
| | | | | | | | | | | | | | - Rename test providers - Mark tests as incomplete Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* | Enable strict mode on PHP filesMaurício Meneghini Fauth2019-01-1670-1/+70
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* | Apply phpmyadmin/coding-standardMaurício Meneghini Fauth2019-01-1648-1135/+1368
|/ | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-01-033-0/+3
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #203 from mostertb/case-aliasIsaac Bennetch2018-12-2422-0/+94
|\ | | | | Add support for Aliases on CASE expressions
| * Add component build tests from CASE expressions with aliasesBrad Mostert2018-10-131-0/+28
| |
| * Add tests for parsing of CASE expressions with aliasesBrad Mostert2018-10-1321-0/+66
| |
* | Merge pull request #216 from devenbansod/fix/199Deven Bansod2018-12-2314-0/+30
|\ \ | | | | | | Add support for INDEX hints in SELECT statement
| * | Add support for INDEX hints in SELECT statementDeven Bansod2018-12-2314-0/+30
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #215 from devenbansod/fix/180Deven Bansod2018-12-2239-0/+232
|\ \ \ | |/ / | | | Add support for LOCK and UNLOCK Statements
| * | Add support for LOCK and UNLOCK StatementsDeven Bansod2018-12-2239-0/+232
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #214 from devenbansod/fix/160Deven Bansod2018-12-223-0/+27
|\ \ \ | |/ / |/| | Throw a parser error on extraneous comma in UPDATE statement
| * | Throw a parser error on extraneous comma in UPDATE statementDeven Bansod2018-12-223-0/+27
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #212 from devenbansod/fix/189Deven Bansod2018-12-217-0/+17
|\ \ \ | |/ / |/| | 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-217-0/+17
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Fix: Add missing support for STRAIGHT_JOINDeven Bansod2018-12-212-0/+10
|/ / | | | | | | | | | | | | | | * 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-219-6/+36
|\ \ | | | | | | Add support for end options in SET statement
| * | Add support for end options in SET statementDeven Bansod2018-12-219-6/+36
| | | | | | | | | | | | | | | | | | * 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-211-0/+42
|\ \ \ | | | | | | | | Fix building of RenameStatement
| * | | Fix building of RenameStatementDeven Bansod2018-12-201-0/+42
| |/ / | | | | | | | | | | | | | | | | | | | | | * 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>
* | | Merge pull request #209 from devenbansod/test/create-replace-viewWilliam Desportes2018-12-201-0/+12
|\ \ \ | | | | | | | | | | | | | | | | Add tests for builder of CREATE or REPLACE VIEW statement Signed-off-by: William Desportes <williamdes@wdes.fr>
| * | | Add tests for builder of CREATE or REPLACE VIEWDeven Bansod2018-12-201-0/+12
| |/ / | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Add support for PURGE statementsDeven Bansod2018-12-2016-0/+67
|/ / | | | | | | | | | | Fix #207 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Cleanup and improve readability:Bruno Perel2018-11-263-4/+3
|/ | | | | Avoid duplicate if conditions Use switch/case instead of ifs when possible
* Refactoring testsGabriel Caruso2017-12-1410-36/+36
|
* Use setUp instead of constructor for generating listMichal Čihař2017-12-141-2/+2
| | | | | | Newer phpunit versions pass parameters to __construct Signed-off-by: Michal Čihař <michal@cihar.com>
* Avoid using PHP 5.4+ syntax for arraysv4.2.4Michal Čihař2017-12-061-9/+9
| | | | | | We still support 5.3 here. Signed-off-by: Michal Čihař <michal@cihar.com>
* Improve SQL context loadingMichal Čihař2017-12-061-10/+30
| | | | | | | | | | - 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/+17
| | | | | | Fixes #182 Signed-off-by: Michal Čihař <michal@cihar.com>
* Use PSR-1 for PHPUnit TestCaseGabriel Caruso2017-11-061-1/+2
|
* Fixed build CREATE TABLE query with PARTITIONS having ENGINE but not VALUES.Michal Čihař2017-10-101-3/+31
| | | | | | Fixes #174 Signed-off-by: Michal Čihař <michal@cihar.com>
* Apply php-cs-fixerMichal Čihař2017-10-103-6/+12
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add tests for partition definitions with engineMichal Čihař2017-10-104-0/+112
| | | | | | | | This seems to work just fine. Issue #174 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix #172 Support parameter bindingMadhura Jayaratne2017-09-233-0/+27
| | | | Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
* Add MariaDB 10.3 contextMichal Čihař2017-08-301-0/+1
| | | | | | | | This also includes INTERSECT and EXPECT reserved words. Issue #166 Signed-off-by: Michal Čihař <michal@cihar.com>
* Test loading all contextsMichal Čihař2017-08-301-0/+27
| | | | | | Issue #2 Signed-off-by: Michal Čihař <michal@cihar.com>
* Provide $expr consistently for CaseExpression as with ExpressionMichal Čihař2017-07-129-9/+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/+17
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13487 Signed-off-by: Michal Čihař <michal@cihar.com>
* Actually run new testMichal Čihař2017-07-121-0/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Improved parsing of incomplete CREATE FUNCTION statementsMichal Čihař2017-07-122-0/+13
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13486 Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly handle incomplete statementsMichal Čihař2017-07-123-0/+6
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13485 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add tests for (partially) parsed queriesMichal Čihař2017-07-122-0/+2
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add recognizer for SET StatementsDeven Bansod2017-07-071-0/+6
| | | | | | | | 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-0/+31
| | | | | | | | | 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>
* Fixed parsing SQL comment at the end of query.Michal Čihař2017-06-083-0/+11
| | | | | | 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-1/+6
| | | | | | | | | 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-012-4/+4
| | | | | | | | It should not be there since beginning. Issue #154 Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge commit '48d61a0c05316a25d9462379e79ff56d5e22a29c'Michal Čihař2017-06-011-0/+24
|\
| * Add GroupKeyword class to fix postgres GROUP BYJosé Tobias de Freitas Neto2017-05-311-0/+24
| |
* | Add (failing) test for building GROUP BY clauseMichal Čihař2017-06-011-0/+12
|/ | | | | | Issue #154 Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge commit 'bb384a13abf5b8e96c2b50fef29e6be3b5ba9d04'Michal Čihař2017-05-171-16/+16
|\
| * Don't print duplicated cli formatting charactersDamian Dlugosz2017-05-171-16/+16
| |
* | Inline CREATE PROCEDUREDamian Dlugosz2017-05-161-6/+3
|/
* Improved format of INSERT queries.Dan Ungureanu2017-05-161-9/+3
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Fixed invalid lexing of queries with : in strings.Michal Čihař2017-05-153-0/+6
| | | | | | | | 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-083-0/+10
| | | | | | Fixes #12. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Remove debug error messagesMichal Čihař2017-05-053-3/+3
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly handle lowercase begin statementMichal Čihař2017-05-053-0/+14
| | | | | | | | 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-117-18/+28
| | | | | | Fixes #40. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Merge pull request #148 from nijel/inline-comment-newlineMichal Čihař2017-04-062-4/+7
|\ | | | | Fixed inline comments parsing
| * Fixed handling newlines in inline comentsMichal Čihař2017-04-042-4/+7
| | | | | | | | | | | | | | | | | | 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-1/+25
|\ \ | |/ |/| Fixes striping of inline comments #11717
| * Fixes striping of inline comments #11717Raghuram2017-04-051-1/+25
| | | | | | | | Signed-off-by: Raghuram Vadapalli <raghuram.vadapalli@research.iiit.ac.in>
* | Add utility to tokenize queryMichal Čihař2017-04-031-0/+53
|/ | | | | | | | It's mostly useful for debugging changes in parser. See #147. Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #145 from devenbansod/fix_144Michal Čihař2017-03-304-0/+12
|\ | | | | Fix parsing of DELETE clauses with JOINs
| * Fix parsing of DELETE clauses with JOINsDeven Bansod2017-03-304-0/+12
| | | | | | | | | | | | | | | | | | 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 BEGIN/END indentationMichal Čihař2017-02-201-12/+12
| | | | | | | | | | | | Ensure we never have negative indentation Signed-off-by: Michal Čihař <michal@cihar.com>
* | Aplly coding style fixesMichal Čihař2017-02-202-6/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Fix class prefix in test dataMichal Čihař2017-02-201-1/+1
| | | | | | | | | | | | The test was wrongly using old class names without PhpMyAdmin prefix. Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge pull request #143 from devenbansod/fix_131Michal Čihař2017-02-2027-0/+280
|\ \ | | | | | | Parse LOAD statement properly
| * | Parse LOAD statement properlyDeven Bansod2017-02-1827-0/+280
| |/ | | | | | | | | | | | | | | 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/+7
|\ \ | | | | | | Inline JOINs
| * | Inline JOINsDamian Dlugosz2017-02-161-0/+7
| |/
* | Fix broken clause order validationDeven Bansod2017-02-173-0/+3
|/ | | | | | Fix #113 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge remote-tracking branch 'origin/pull/137'Michal Čihař2017-02-1427-0/+87
|\
| * Apply cs fixesDamian Dlugosz2017-02-1227-0/+53
| |
* | Order importsDamian Dlugosz2017-02-1233-35/+35
|/