summaryrefslogtreecommitdiffstats
path: root/src/Utils/Query.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove left overs of old array syntaxWilliam 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>
| * Fix #249 - Notice - Undefined index: ORDER BYWilliam Desportes2019-12-311-1/+1
| | | | | | | | Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Revert "Enable strict mode on PHP files"William Desportes2019-05-281-1/+1
| | | | | | | | | | This reverts commit 17da8a34b81442524a8e01fead7b5968fa1cc39d. Signed-off-by: William Desportes <williamdes@wdes.fr>
| * revert of new array syntaxWilliam Desportes2019-05-281-24/+24
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
| * Revert array syntaxWilliam Desportes2019-05-281-6/+6
| | | | | | | | | | See: 86c5baebda24c1721fb6881df8671a3c7df60e8b Signed-off-by: William Desportes <williamdes@wdes.fr>
* | Remove useless comments and annotationsMaurício Meneghini Fauth2019-12-141-4/+0
| | | | | | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* | Remove useless parenthesesMaurício Meneghini Fauth2019-12-141-2/+2
|/ | | | Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* fix: incorrect lastClauseIdx in Util::getQueryDeven Bansod2019-03-121-2/+2
|
* Enable strict mode on PHP filesMaurício Meneghini Fauth2019-01-161-1/+1
| | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* Apply phpmyadmin/coding-standardMaurício Meneghini Fauth2019-01-161-44/+59
| | | | Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
* Fix unused variableBruno Perel2018-12-091-3/+3
|
* Use triple (in)equalities when type compatibility is ensuredBruno Perel2018-11-261-2/+2
|
* Cleanup and improve readability:Bruno Perel2018-11-261-17/+16
| | | | | Avoid duplicate if conditions Use switch/case instead of ifs when possible
* 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>
* Provide $expr consistently for CaseExpression as with ExpressionMichal Čihař2017-07-121-3/+0
| | | | | | | 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>
* 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>
* This is already doneMichal Čihař2017-02-201-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Parse LOAD statement properlyDeven Bansod2017-02-181-0/+5
| | | | | | | | Fix #131 Might help to fix phpmyadmin/phpmyadmin#12345 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Order importsDamian Dlugosz2017-02-121-3/+3
|
* Apply cs fixesDamian Dlugosz2017-02-121-0/+1
|
* Fix parameters documentationMichal Čihař2017-02-071-2/+2
| | | | | | This function will only get SelectStatement, so be clear on that. Signed-off-by: Michal Čihař <michal@cihar.com>
* Split select flags calculation to separate methodMichal Čihař2017-02-071-62/+76
| | | | | | It's the most complex case right now, so let's separate it. Signed-off-by: Michal Čihař <michal@cihar.com>
* Move all flags definition outside of methodMichal Čihař2017-02-071-155/+157
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Various coding style fixesMichal Čihař2017-02-071-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix comment typeMichal Čihař2017-02-061-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Use keyword attribute for comparing keyword nameMichal Čihař2017-02-061-7/+7
| | | | | | | 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>
* Added PhpMyAdmin namespace prefix to follow PSR-4.Michal Čihař2017-01-231-26/+26
| | | | | | Fixes #126 Signed-off-by: Michal Čihař <michal@cihar.com>
* Apply php-cs-fixerDamian Dlugosz2017-01-061-110/+104
|
* Prevent incorrect error messages in UNION queriesDeven Bansod2016-11-201-0/+2
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Remove unused variable (#96)Michal Čihař2016-11-081-8/+0
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Validate order of clauses in the parsing of statementsDeven Bansod2016-11-031-0/+62
| | | | | | Fix #22 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Clarify licenseMichal Čihař2016-09-261-1/+1
| | | | | | | | | - Add link to official license text - Use SPDX identifier for license - Clarify that the code is GPL or later - See issue #89 Signed-off-by: Michal Čihař <michal@cihar.com>
* Remove @author from comment metadataMichal Čihař2016-09-261-1/+0
| | | | | | | | - We're doing this for ages in phpmyadmin repo - The comments get outdated over time - See issue #89 Signed-off-by: Michal Čihař <michal@cihar.com>
* Misc: Fixed some issues reported by Scrutinizer.Dan Ungureanu2016-02-211-2/+2
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Change return value from getAll in case of not parsed queryMichal Čihař2016-02-171-1/+1
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/11609 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix the order of clauses in SELECT statements involing UNIONs.Dan Ungureanu2015-11-021-9/+1
|
* Use JOIN expressions for flag detection.Dan Ungureanu2015-11-021-1/+8
|
* Replaced explicit calls to Component::build() with implicit calls to ↵Dan Ungureanu2015-08-181-11/+15
| | | | | | | Component::__toString(). Fixed bugs that caused field names like '0', '0.0', etc. to be considered invalid. Refactoring.
* Consistent PHPDoc style.Dan Ungureanu2015-08-151-2/+12
|
* Coding style fixes.Dan Ungureanu2015-08-111-3/+3
|
* Introduced the buffered query parser. This is used to extract statements from aDan Ungureanu2015-08-091-1/+1
| | | | | | buffered string that may be parsed using the parser. DELIMITER is no longer reported as unexpected beginning of statement. Fixed typos.
* Add support for MySQL commands inside comments.Dan Ungureanu2015-08-081-3/+1
|
* Refactored field to something more appropriate depending on the context in ↵Dan Ungureanu2015-08-081-12/+12
| | | | which it is used.
* Fixed a bug that didn't parse comments properly.Dan Ungureanu2015-08-051-4/+6
| | | | | | getFirstStatement util doesn't ignore MySQL specific query anymore (between comments). Misc coding style fixes. Fixed tests.
* Added utility to get first full statement from a buffer.Dan Ungureanu2015-08-021-0/+63
| | | | Misc coding style fixes.
* Fixed some Scrutinizer issues.Dan Ungureanu2015-07-251-1/+1
|
* Improved support for UNION.Dan Ungureanu2015-07-251-2/+9
|
* Mass renaming. Using 'component' instead of 'fragment'.Dan Ungureanu2015-07-101-2/+2
|
* Improved documentation.Dan Ungureanu2015-07-081-8/+8
|
* More coding style fixes. And typos. Lots of them.Dan Ungureanu2015-07-081-1/+1
|
* Coding style fixes.Dan Ungureanu2015-07-081-7/+2
|
* Improved fragments. New builders available. Refactored some fields.Dan Ungureanu2015-07-071-0/+51
| | | | | | | | New query utility to extract the name of the tables used in a statement. TRUNCATE is being parsed now. CREATE parsing and building has been improved. Improved the definition of UPDATE and DELETE statements. Fixed coding style. Improved documentation and tests.
* Improved condition parsing and query utilities.Dan Ungureanu2015-07-051-16/+133
|
* The context depends on the SQL mode.Dan Ungureanu2015-07-041-1/+1
| | | | | | | | | Implemented a few more builders. Improved some fragments and statement types. Fixed the noAlias option in FieldFragment. Reordered CREATE statements's options. Updated contexts definitions. Fixed typos. Improved tests.
* Improved WHERE keyword parser and query's utilities.Dan Ungureanu2015-07-021-46/+37
|
* Added statement builder (converts statement trees into executable query ↵Dan Ungureanu2015-06-301-29/+29
| | | | | | | | | | | strings). Implemented support for UNIONs in parser. Code coverage is now over 99%. Fixed CHECKSUM statement (typos). Refactored code. Removed pieces of duplicated code. Improved documentation and fixed coding style. Improved PHPUnit's configuration (more test suites for fine-grained testing).
* Improved parsing system.Dan Ungureanu2015-06-281-21/+78
| | | | | | | Better support for current statements. Improved query utilities. Fixed a bug in LIMIT's parser. Fixed a documentation issue.
* New query utilities.Dan Ungureanu2015-06-281-17/+303
| | | | Refactoring and improved documentation.
* Improved documentation.Dan Ungureanu2015-06-261-3/+9
|
* Improved query's utilities.Dan Ungureanu2015-06-261-9/+79
| | | | | Fixed an issue in contexts. Updated tests.
* Added query utilities.Dan Ungureanu2015-06-251-0/+131
Included basic support for ANALYZE, BACKUP, CHECK, CHECKSUM, OPTIMIZE, REPAIR and RESTORE statements. Better parsing for fields, SELECT statement, INTO keyword. Improved contexts (included functions). Improved documentation. Refactoring and coding style fixes.