summaryrefslogtreecommitdiffstats
path: root/tests/data/parser
Commit message (Collapse)AuthorAgeFilesLines
* fix #259: Add support for DROP USER statementDeven Bansod2019-12-314-0/+4
|
* Merge #276 - add missing options in SET statementWilliam Desportes2019-12-311-1/+1
|\ | | | | | | | | | | | | 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/+1
| |
* | Merge #277 - allow SCHEMA to be used in CREATE Database statementWilliam Desportes2019-12-318-0/+8
|\ \ | | | | | | | | | | | | | | | | | | 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-298-0/+8
| |/
* | 275: Prevent overwrite of offset in Limit clause by parenthesisDeven Bansod2019-12-302-0/+2
|/
* fixes #267 - ALTER TABLE ... PRIMARY/UNIQUE KEY "Missing comma" errorMisterCoder2019-11-134-0/+11
|
* Fix failing test from pull request #224Isaac Bennetch2019-05-061-1/+1
| | | | Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
* Fix PHP warnings when building an incomplete CASE expressionThomas Gerbet2019-04-1017-17/+17
| | | | | | | | | 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 ```
* Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-03-074-5/+10
|
* Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-01-032-0/+2
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #203 from mostertb/case-aliasIsaac Bennetch2018-12-2420-0/+56
|\ | | | | Add support for Aliases on CASE expressions
| * Add tests for parsing of CASE expressions with aliasesBrad Mostert2018-10-1320-0/+56
| |
* | Merge pull request #216 from devenbansod/fix/199Deven Bansod2018-12-2312-0/+12
|\ \ | | | | | | Add support for INDEX hints in SELECT statement
| * | Add support for INDEX hints in SELECT statementDeven Bansod2018-12-2312-0/+12
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #215 from devenbansod/fix/180Deven Bansod2018-12-2236-0/+52
|\ \ \ | |/ / | | | Add support for LOCK and UNLOCK Statements
| * | Add support for LOCK and UNLOCK StatementsDeven Bansod2018-12-2236-0/+52
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #214 from devenbansod/fix/160Deven Bansod2018-12-222-0/+26
|\ \ \ | |/ / |/| | Throw a parser error on extraneous comma in UPDATE statement
| * | Throw a parser error on extraneous comma in UPDATE statementDeven Bansod2018-12-222-0/+26
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #212 from devenbansod/fix/189Deven Bansod2018-12-216-0/+14
|\ \ \ | |/ / |/| | 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-216-0/+14
| | | | | | | | | | | | 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-218-0/+8
|\ \ | | | | | | Add support for end options in SET statement
| * | Add support for end options in SET statementDeven Bansod2018-12-218-0/+8
| |/ | | | | | | | | | | * Support `[{ COLLATE expr | DEFAULT }] in `SET NAMES` statement Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add support for PURGE statementsDeven Bansod2018-12-2014-0/+14
|/ | | | | | Fix #207 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add tests for partition definitions with engineMichal Čihař2017-10-102-0/+81
| | | | | | | | This seems to work just fine. Issue #174 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>
* 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-122-0/+5
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/13485 Signed-off-by: Michal Čihař <michal@cihar.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-052-0/+13
| | | | | | | | 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-113-8/+12
| | | | | | Fixes #40. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Merge pull request #145 from devenbansod/fix_144Michal Čihař2017-03-302-0/+2
|\ | | | | Fix parsing of DELETE clauses with JOINs
| * Fix parsing of DELETE clauses with JOINsDeven Bansod2017-03-302-0/+2
| | | | | | | | | | | | | | | | | | 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 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-2024-0/+116
|\ \ | | | | | | Parse LOAD statement properly
| * | Parse LOAD statement properlyDeven Bansod2017-02-1824-0/+116
| |/ | | | | | | | | | | | | | | Fix #131 Might help to fix phpmyadmin/phpmyadmin#12345 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix broken clause order validationDeven Bansod2017-02-172-0/+2
|/ | | | | | Fix #113 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Store uppercase keyword value for later processingMichal Čihař2017-02-06148-431/+431
| | | | | | This makes easier to compare it later. Signed-off-by: Michal Čihař <michal@cihar.com>
* Added PhpMyAdmin namespace prefix to follow PSR-4.Michal Čihař2017-01-23148-431/+431
| | | | | | Fixes #126 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixed parsing of unterminated variables.Michal Čihař2017-01-202-0/+5
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12894 Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly handle operators AND, NOT, OR, XOR, DIV, MODMichal Čihař2017-01-062-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly report missing expression errorMichal Čihař2017-01-032-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test error on double ASMichal Čihař2017-01-032-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add missing test for error conditionMichal Čihař2017-01-032-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #107 from devenbansod/fix_105Michal Čihař2016-12-226-0/+38
|\ | | | | Fix #105: Fix parsing of FIELDS and LINES options in Select..Into
| * Add more tests, fix unneeded errorDeven Bansod2016-12-212-0/+10
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Add more testsDeven Bansod2016-12-212-0/+14
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Add tests for parsing of FIELDS and LINES options in SELECT..INTODeven Bansod2016-12-212-0/+14
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Consistently end message with .Michal Čihař2016-12-213-3/+3
|/ | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Recognize BINARY as functionMichal Čihař2016-11-302-0/+5
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12762 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add tests for prevention of incorrect errors in UNION queriesDeven Bansod2016-11-202-0/+2
| | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com> Conflicts: tests/Parser/SelectStatementTest.php
* Add tests for prevention of wrong order in JOINsDeven Bansod2016-11-152-0/+10
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add parser tests for end options in SELECTDeven Bansod2016-11-126-0/+18
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add forgotten testcaseMichal Čihař2016-11-091-0/+10
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix test for pr #97 and #98Michal Čihař2016-11-091-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix test for terminology changeMarc Delisle2016-11-091-1/+1
|
* Add tests for #22Deven Bansod2016-11-032-0/+2
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #95 from devenbansod/fix_93Michal Čihař2016-10-2515-2/+51
|\ | | | | Fix #93 : Fix parsing of NATURAL JOIN, CROSS JOIN and related joins
| * Add parsing of multiple JOINS in single queryDeven Bansod2016-10-242-0/+6
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Add tests for various NATURAL JOINS, fix testDeven Bansod2016-10-249-2/+21
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of NATURAL JOIN, CROSS JOIN and related joinsDeven Bansod2016-10-244-0/+24
| | | | | | | | | | | | | | | | Fix #93 Add tests to cover parsing of these joins Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add tests for ALTER DATABASE and ALTER VIEWDeven Bansod2016-10-254-0/+4
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of variables being assigned value of CASE expr within SELECT ↵Deven Bansod2016-10-142-0/+6
| | | | | | | | | | statements For example, $query = "SELECT 1+ 2 AS `c2`, sum(c2), sum(c3) AS `sum_c3`, 'Status'= CASE WHEN quantity > 0 THEN 'in stock' ELSE 'out of stock' END FROM test_table" Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of ON UPDATE option in TIMESTAMP field with precisionDeven Bansod2016-10-102-0/+18
| | | | | | Fix #92 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #90 from devenbansod/subquery_in_fromMichal Čihař2016-10-039-0/+38
|\ | | | | Fix parsing of subquery in FROM clause
| * Fix some errors with INTO keyword more to followDeven Bansod2016-09-281-0/+4
| | | | | | | | | | | | Add more test cases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of subquery in FROM clauseDeven Bansod2016-09-278-0/+34
| | | | | | | | | | | | Fix #52 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #87 from devenbansod/delete_statementMichal Čihař2016-10-0346-10/+62
|\ \ | | | | | | Implement parsing and building for Delete Statement
| * | Fixed some errors and add new testsDeven Bansod2016-09-2728-10/+44
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Added test cases for parsing DELETE statementsDeven Bansod2016-09-2418-0/+18
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #88 from devenbansod/fix_pma_12100Michal Čihař2016-10-0318-0/+50
|\ \ \ | |_|/ |/| | Add parsing of CASE Expressions
| * | Add more testsDeven Bansod2016-09-2610-9/+27
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix some issue with error reports and added testcasesDeven Bansod2016-09-2612-0/+32
| |/ | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix parsing of user@host without backquotesDeven Bansod2016-09-2010-6/+34
|/ | | | | | | | | | Introduce an option to parse 'expr=' (like var, var=, expr) Fix tests Fix phpmyadmin/phpmyadmin#12298 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Test error handling in INSERT and REPLACE statementsMichal Čihař2016-09-1312-0/+46
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #77 from devenbansod/fix_48Michal Čihař2016-09-138-0/+16
|\ | | | | Fix parsing of REPLACE INTO ... Statements
| * Add tests for build and errorDeven Bansod2016-09-132-0/+10
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of REPLACE INTO ... StatementsDeven Bansod2016-09-136-0/+6
| | | | | | | | | | | | | | | | Now supports all three variations with REPLACE INTO .. VALUES, REPLACE INTO .. SET, REPLACE INTO .. SELECT. Fix #48 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Stop SelectStatement parsing and revert back in case of ON DUPLICATE KEYDeven Bansod2016-09-132-0/+2
|/ | | | | | | | Fix parsing of INSERT INTO ... SELECT .... ON DUPLICATE KEY Fix #78 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add test for non-reserved keyword as column nameMichal Čihař2016-09-132-0/+5
| | | | | | Issue #59 Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge remote-tracking branch 'origin/pull/70'Michal Čihař2016-09-134-0/+4
|\
| * Fix #59: Non-reserved keywords should be allowed as a field nameDeven Bansod2016-09-074-0/+4
| | | | | | | | | | | | | | | | | | While trying to parse a fieldname, disallow only if it is a reserved keywords. Reserved keywords are still allowed if backquotes are used. Added testcases to cover both with and w/o backquotes scenarios. Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #76 from devenbansod/fix_50Michal Čihař2016-09-1310-0/+18
|\ \ | | | | | | Fix parsing of INSERT...SELECT and INSERT...SET syntax
| * | Fix parsing of INSERT...SELECT and INSERT...SET syntaxDeven Bansod2016-09-1210-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement separate parse function for InsertStatement Fix #50 Fix #73 Fix phpmyadmin/phpmyadmin#11628 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #75 from devenbansod/fix_51_74Michal Čihař2016-09-1314-0/+14
|\ \ \ | | | | | | | | Add correct parsing of SET CHARACTER SET, CHARSET , NAMES statements
| * | | Add testcases for SET CHARACTER SET, CHARSET, NAMES and errorsDeven Bansod2016-09-1014-0/+14
| |/ / | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Fix #55 : Add support for spatial datatypesDeven Bansod2016-09-082-0/+2
|/ / | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix unnecesary and incorrect assigning of table nameDeven Bansod2016-09-071-1/+1
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #68 from devenbansod/fix_49Michal Čihař2016-09-074-0/+4
|\ | | | | Fix #49: Add Support for 'CREATE TABLE `table_copy` LIKE `table`;'
| * Added test case for missing LIKE expr and building of queryDeven Bansod2016-09-072-0/+2
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Added a testcase for CREATE TABLE .. LIKE 'old_table'Deven Bansod2016-09-072-0/+2
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge remote-tracking branch 'origin/pull/67'Michal Čihař2016-09-072-0/+2
|\ \
| * | Added a test for 'ALTER TABLE .. COMMENT abc'Deven Bansod2016-09-072-0/+2
| |/ | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add a new test case for statements with missing delimiterDeven Bansod2016-09-073-1/+11
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix test failureDeven Bansod2016-09-071-1/+1
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Properly parse CREATE TABLE [AS] SELECTMichal Čihař2016-03-194-0/+10
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12109 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for union with bracketsMichal Čihař2016-03-182-0/+5
| | | | | | See https://github.com/phpmyadmin/phpmyadmin/issues/12026 Signed-off-by: Michal Čihař <michal@cihar.com>
* Misc: Fix failing tests.Dan Ungureanu2016-02-212-2/+2
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Do not fail on function which is reserved in a WHERE conditionMichal Čihař2016-02-172-0/+13
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/11975 Signed-off-by: Michal Čihař <michal@cihar.com>