summaryrefslogtreecommitdiffstats
path: root/src/Components
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'QA'William Desportes2019-12-314-5/+5
|\ | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Fix phpdoc using phpstan level 3William Desportes2019-12-314-5/+5
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Remove left overs of old array syntaxWilliam Desportes2019-12-312-6/+6
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Merge branch 'QA'William Desportes2019-12-311-0/+5
|\ \ | |/ | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * 275: Prevent overwrite of offset in Limit clause by parenthesisDeven Bansod2019-12-301-0/+5
| |
* | Add PHPStan at level 2Maurício Meneghini Fauth2019-12-163-4/+6
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove useless comments and annotationsMaurício Meneghini Fauth2019-12-1425-147/+7
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Replace is_null($var) with $var === nullMaurício Meneghini Fauth2019-12-142-2/+2
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove useless parenthesesMaurício Meneghini Fauth2019-12-146-6/+6
| | | | | | | | 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>
* | 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>
| * 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-294-3/+8
|\ \ | |/ | | | | | | | | This merge includes phpcs fixes 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 "Enable strict mode on PHP files"William Desportes2019-05-2825-30/+30
| | | | | | | | | | This reverts commit 17da8a34b81442524a8e01fead7b5968fa1cc39d. Signed-off-by: William Desportes <williamdes@wdes.fr>
| * revert of new array syntaxWilliam Desportes2019-05-2816-180/+180
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Revert array syntaxWilliam Desportes2019-05-2825-86/+86
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Replaced new self with new staticMartkCz2019-05-1722-35/+35
|/
* 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 ```
* Fix incorrect error on DEFAULT keyword in ALTER operationDeven Bansod2019-03-071-4/+6
|
* Enable strict mode on PHP filesMaurício Meneghini Fauth2019-01-1625-30/+30
| | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* Apply phpmyadmin/coding-standardMaurício Meneghini Fauth2019-01-1625-265/+423
| | | | 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-231-0/+193
|\ \ | | | | | | Add support for INDEX hints in SELECT statement
| * | Add support for INDEX hints in SELECT statementDeven Bansod2018-12-231-0/+193
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #215 from devenbansod/fix/180Deven Bansod2018-12-221-0/+203
|\ \ \ | |/ / | | | Add support for LOCK and UNLOCK Statements
| * | Add support for LOCK and UNLOCK StatementsDeven Bansod2018-12-221-0/+203
| | | | | | | | | | | | 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>
* | | 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 building of RenameStatementDeven Bansod2018-12-201-1/+1
| | | | | | | | | | | | | | | | * 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>
* | Fix testsBruno Perel2018-11-272-20/+23
| |
* | Use triple (in)equalities when type compatibility is ensuredBruno Perel2018-11-267-12/+12
| |
* | Cleanup and improve readability:Bruno Perel2018-11-269-115/+111
|/ | | | | Avoid duplicate if conditions Use switch/case instead of ifs when possible
* PHPDOC fixWilliam Desportes2018-06-061-0/+1
| | | | | | - Added phpdoc for $options as requested by Sami Signed-off-by: William Desportes <williamdes@wdes.fr>
* 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>
* 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-106-17/+16
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix #172 Support parameter bindingMadhura Jayaratne2017-09-231-0/+2
| | | | Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
* Provide $expr consistently for CaseExpression as with ExpressionMichal Čihař2017-07-121-0/+9
| | | | | | | This is probably better approach to address https://github.com/phpmyadmin/phpmyadmin/issues/13487 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-311-0/+141
|
* 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>
* Fix type documentationMichal Čihař2017-02-201-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge remote-tracking branch 'origin/pull/138'Michal Čihař2017-02-1410-90/+89
|\
| * No useless elseDamian Dlugosz2017-02-1210-90/+92
| |
* | Order importsDamian Dlugosz2017-02-125-5/+5
|/
* Apply cs fixesDamian Dlugosz2017-02-121-1/+0
|
* 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>
* 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-061-1/+1
| | | | This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
* Use keyword attribute for comparing keyword nameMichal Čihař2017-02-069-30/+28
| | | | | | | 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>
* Merge branch 'master' into motranslatorMichal Čihař2017-01-2322-116/+116
|\
| * Added PhpMyAdmin namespace prefix to follow PSR-4.Michal Čihař2017-01-2322-114/+114
| | | | | | | | | | | | Fixes #126 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-201-0/+1
|\ \ | |/
| * 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-061-1/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-0622-531/+463
|\ \ | |/
| * Apply php-cs-fixerDamian Dlugosz2017-01-0622-531/+463
| |
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-031-0/+1
|\ \ | |/
| * Properly report missing expression errorMichal Čihař2017-01-031-0/+1
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Merge branch 'master' into motranslatorMichal Čihař2017-01-021-1/+0
|\ \ | |/
| * Remove duplicate array item in JOINsDeven Bansod2016-12-261-1/+0
| | | | | | | | | | | | Fix #108 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge branch 'master' into motranslatorMichal Čihař2016-12-221-5/+103
|\ \ | |/
| * Merge pull request #107 from devenbansod/fix_105Michal Čihař2016-12-221-5/+103
| |\ | | | | | | Fix #105: Fix parsing of FIELDS and LINES options in Select..Into
| | * Make the method access public since called from objectDeven Bansod2016-12-221-3/+3
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| | * Add more tests, fix unneeded errorDeven Bansod2016-12-211-4/+0
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| | * Fix parsing of FIELDS and LINES options in SELECT..INTODeven Bansod2016-12-211-5/+107
| | | | | | | | | | | | | | | | | | Fix #105 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Consistently end message with .Michal Čihař2016-12-211-1/+1
| |/ | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Migrate new code to use Translator classMichal Čihař2016-12-214-12/+11
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Use static method for translatingMichal Čihař2016-12-212-2/+2
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Replace __( usage by Translator classMichal Čihař2016-12-2110-23/+25
|/ | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Use strlen on strings instead of countMichal Čihař2016-11-301-1/+1
| | | | | | This fails in PHP 7.2 Signed-off-by: Michal Čihař <michal@cihar.com>
* In SQL we should use 'column' and not 'field'Marc Delisle2016-11-081-1/+1
|
* Add parsing of multiple JOINS in single queryDeven Bansod2016-10-241-2/+11
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of NATURAL JOIN, CROSS JOIN and related joinsDeven Bansod2016-10-241-0/+7
| | | | | | | | Fix #93 Add tests to cover parsing of these joins Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of variables being assigned value of CASE expr within SELECT ↵Deven Bansod2016-10-141-1/+8
| | | | | | | | | | 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-101-1/+1
| | | | | | Fix #92 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Remove unused useMichal Čihař2016-10-031-1/+0
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #90 from devenbansod/subquery_in_fromMichal Čihař2016-10-032-11/+32
|\ | | | | Fix parsing of subquery in FROM clause
| * Fix parsing and building of SELECT ... INTO @var1 [,@var2...]Deven Bansod2016-09-281-8/+25
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix some errors with INTO keyword more to followDeven Bansod2016-09-281-1/+1
| | | | | | | | | | | | Add more test cases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>