summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Use strlen on strings instead of countMichal Čihař2016-11-304-4/+4
| | | | | | This fails in PHP 7.2 Signed-off-by: Michal Čihař <michal@cihar.com>
* Recognize BINARY as functionMichal Čihař2016-11-305-5/+10
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12762 Signed-off-by: Michal Čihař <michal@cihar.com>
* Use https url for ietf.orgMichal Čihař2016-11-301-1/+1
| | | | | | Fixes #102 Signed-off-by: Michal Čihař <michal@cihar.com>
* Prevent incorrect error messages in UNION queriesDeven Bansod2016-11-201-0/+2
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add tests for prevention of wrong order in JOINsDeven Bansod2016-11-151-1/+1
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add check for prevention of wrong order errors in using Multiple JOINsDeven Bansod2016-11-151-6/+34
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add parsing of end options in Select statementsDeven Bansod2016-11-128-19/+53
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* In SQL we should use 'column' and not 'field'Marc Delisle2016-11-081-1/+1
|
* 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-033-0/+114
| | | | | | Fix #22 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #94 from devenbansod/fix_57Michal Čihař2016-10-253-1/+78
|\ | | | | Enable Lexing of begin_label in the in-procedure statements
| * Enable Lexing of begin_label in the in-procedure statementsDeven Bansod2016-10-213-1/+78
| | | | | | | | | | | | | | | | | | | | Ex. BEGIN.. END, LOOP, REPEAT, WHILE statements Fix #57 Fix phpmyadmin/phpmyadmin#12344 Fix phpmyadmin/phpmyadmin#12228 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add parsing of multiple JOINS in single queryDeven Bansod2016-10-241-2/+11
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add appropriate clauses to SelectStatementDeven Bansod2016-10-241-22/+27
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix parsing of NATURAL JOIN, CROSS JOIN and related joinsDeven Bansod2016-10-247-36/+68
|/ | | | | | | | 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>
* Keep the clauses defined for DeleteStatementDeven Bansod2016-10-031-0/+19
| | | | | | | | These may be required for use in various Utils like Utils/Query.php's replaceClause(). Fix phpmyadmin/phpmyadmin#12612 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-036-15/+44
|\ | | | | Fix parsing of subquery in FROM clause
| * Fix parsing and building of SELECT ... INTO @var1 [,@var2...]Deven Bansod2016-09-283-10/+35
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix some errors with INTO keyword more to followDeven Bansod2016-09-282-2/+2
| | | | | | | | | | | | Add more test cases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of subquery in FROM clauseDeven Bansod2016-09-272-3/+7
| | | | | | | | | | | | Fix #52 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #87 from devenbansod/delete_statementMichal Čihař2016-10-032-20/+248
|\ \ | | | | | | Implement parsing and building for Delete Statement
| * | Fixed some errors and add new testsDeven Bansod2016-09-272-35/+21
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Implement parsing for Delete StatementDeven Bansod2016-09-242-16/+258
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Adjust license URL to be consistent with others (#88)Michal Čihař2016-10-031-1/+1
| | | | | | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | | Merge pull request #88 from devenbansod/fix_pma_12100Michal Čihař2016-10-032-3/+261
|\ \ \ | |_|/ |/| | Add parsing of CASE Expressions
| * | Add more testsDeven Bansod2016-09-261-16/+2
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Remove author tag as per masterDeven Bansod2016-09-261-1/+0
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix declaration to be same as parentClassDeven Bansod2016-09-261-1/+1
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix some issue with error reports and added testcasesDeven Bansod2016-09-261-27/+8
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Add parsing of CASE ExpressionsDeven Bansod2016-09-252-3/+295
| |/ | | | | | | | | | | Fix phpmyadmin/phpmyadmin#12100 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Clarify licenseMichal Čihař2016-09-2669-69/+69
| | | | | | | | | | | | | | | | | | - 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-2669-69/+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>
* | Fixed escaping of control chars in CLI formatterMichal Čihař2016-09-201-2/+23
| | | | | | | | | | | | Fixes #84 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Fixed escaping HTML entities in HTML formatterMichal Čihař2016-09-201-2/+3
| | | | | | | | | | | | Fixes #83 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Fix parsing of user@host without backquotesDeven Bansod2016-09-202-6/+10
|/ | | | | | | | | | 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>
* Remove unused codeMichal Čihař2016-09-131-2/+0
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Remove unused useMichal Čihař2016-09-131-1/+0
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* fix default options in Formater constructorRemi Collet2016-09-131-1/+5
|
* Correctly handle getopt failuresMichal Čihař2016-09-131-0/+3
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add tests for CLI interfaceMichal Čihař2016-09-131-2/+7
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Do not use \e as it's not supported on PHP 5.3Michal Čihař2016-09-131-9/+9
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #77 from devenbansod/fix_48Michal Čihař2016-09-131-18/+142
|\ | | | | Fix parsing of REPLACE INTO ... Statements
| * Fix parsing of REPLACE INTO ... StatementsDeven Bansod2016-09-131-18/+142
| | | | | | | | | | | | | | | | 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>
* | Check for if the tokens we looked for are not nullDeven Bansod2016-09-131-1/+2
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Stop SelectStatement parsing and revert back in case of ON DUPLICATE KEYDeven Bansod2016-09-131-0/+25
|/ | | | | | | | Fix parsing of INSERT INTO ... SELECT .... ON DUPLICATE KEY Fix #78 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge remote-tracking branch 'origin/pull/70'Michal Čihař2016-09-132-1/+18
|\
| * Add backquotes for field names by defaultDeven Bansod2016-09-101-1/+1
| | | | | | | | | | | | Fix #72 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix #59: Non-reserved keywords should be allowed as a field nameDeven Bansod2016-09-071-0/+17
| | | | | | | | | | | | | | | | | | 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-131-5/+183
|\ \ | | | | | | Fix parsing of INSERT...SELECT and INSERT...SET syntax
| * | Fix dataType of Values clause of InsertStatementDeven Bansod2016-09-121-3/+2
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix parsing of INSERT...SELECT and INSERT...SET syntaxDeven Bansod2016-09-121-3/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-132-0/+48
|\ \ \ | | | | | | | | Add correct parsing of SET CHARACTER SET, CHARSET , NAMES statements
| * | | Add special cases for SET CHARACTER SET, CHARSET, NAMESDeven Bansod2016-09-102-0/+48
| |/ / | | | | | | | | | | | | | | | | | | Fix #51 Fix #74 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Fix #55 : Add support for spatial datatypesDeven Bansod2016-09-085-107/+135
|/ / | | | | | | 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-071-6/+45
|\ | | | | Fix #49: Add Support for 'CREATE TABLE `table_copy` LIKE `table`;'
| * Add error-checking for table_name missing after 'LIKE' KeywordDeven Bansod2016-09-051-0/+7
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix #49: Add Support for 'CREATE TABLE `table_copy` LIKE `table`;'Deven Bansod2016-09-051-6/+38
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge remote-tracking branch 'origin/pull/67'Michal Čihař2016-09-071-0/+1
|\ \
| * | Fix #53: Allow parsing of COMMENT operation in ALTER statementDeven Bansod2016-09-031-0/+1
| |/ | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #69 from devenbansod/fix_pma_12545Michal Čihař2016-09-071-1/+1
|\ \ | | | | | | Fix spaces after expression in PartitionDefinition's build
| * | Fix spaces after expression in PartitionDefinition's buildDeven Bansod2016-09-071-1/+1
| |/ | | | | | | | | | | Fixes phpmyadmin/phpmyadmin#12545 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add a new test case for statements with missing delimiterDeven Bansod2016-09-071-1/+1
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix test failureDeven Bansod2016-09-071-5/+8
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix #10: Add a check if we find a new start to new statement before delimiterDeven Bansod2016-09-031-0/+9
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Allow to use function name in ASv3.4.4Michal Čihař2016-04-261-2/+3
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12144 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add support for FULL OUTER JOINMichal Čihař2016-04-267-10/+15
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12205 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix parsing of query with \v3.4.3Michal Čihař2016-04-191-3/+3
| | | | | | | | The previous fix was wrong, it didn't properly handle double escaping. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12197 Signed-off-by: Michal Čihař <michal@cihar.com>
* Improve formatting of non indented groupsv3.4.2Michal Čihař2016-04-071-0/+11
| | | | | | | | We don't want to insert newlines insite non indented groups. Fixes #20 Signed-off-by: Michal Čihař <michal@cihar.com>
* Recognize UNION DISTINCTMichal Čihař2016-04-077-7/+11
| | | | | | Fixes #41 Signed-off-by: Michal Čihař <michal@cihar.com>
* Recognize REGEXP and RLIKEMichal Čihař2016-04-071-0/+2
| | | | | | Issue #41 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add FULLTEXT and SPATIAL keywordsv3.4.1Michal Čihař2016-04-065-24/+30
| | | | | | Fixes #45 Signed-off-by: Michal Čihař <michal@cihar.com>
* Better recognize missing symbol in create definitionMichal Čihař2016-04-061-1/+7
| | | | | | Fixes #47 Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly compare for empty stringMichal Čihař2016-04-061-2/+2
| | | | | | | | | The empty('0') returns true, so we need to be careful when handling expressions in strings. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12165 Signed-off-by: Michal Čihař <michal@cihar.com>
* Do not consume closing bracket if we didn't consume opening oneMichal Čihař2016-04-061-0/+3
| | | | | | See also https://github.com/phpmyadmin/phpmyadmin/issues/12165 Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly parse CREATE TABLE [AS] SELECTMichal Čihař2016-03-191-0/+37
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12109 Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly handle brackets in expressionMichal Čihař2016-03-181-0/+3
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12026 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add command line query linterMichal Čihař2016-03-181-7/+52
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Prepare for multiple CLI utilsMichal Čihař2016-03-181-7/+12
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add error messageMichal Čihař2016-03-181-0/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add command line script for highlighting SQL queryMichal Čihař2016-03-181-0/+69
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Reset console formatting at the end of queryMichal Čihař2016-03-181-0/+4
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixed parsing of table with DEFAULT and COMMENT.Michal Čihař2016-03-021-0/+3
| | | | | | Fixes #39 Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #37 from 007durgesh219/Issue#36Michal Čihař2016-03-021-0/+1
|\ | | | | Fix DROP VIEW statement is not constructed properly by the parser, Issue #36
| * Fix DROP VIEW statement is not constructed properly by the parser, Issue #36Durgesh2016-02-261-0/+1
| | | | | | | | Signed-off-by: Durgesh <007durgesh219@gmail.com>
* | Merge pull request #38 from ujjwalwahi/masterMichal Čihař2016-03-021-0/+1
|\ \ | | | | | | Recognize ALL when used with WHERE clause
| * | Recognize ALL when used with WHERE clauseUjjwal Wahi2016-02-261-0/+1
| |/ | | | | | | | | | | Fixes phpmyadmin/phpmyadmin#12028 Signed-off-by: Ujjwal Wahi <w.ujjwal@gmail.com>
* | Fix splitting query when escaped quotes are involvedMichal Čihař2016-03-021-2/+2
|/ | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12054 Signed-off-by: Michal Čihař <michal@cihar.com>
* Escape query when displayingMichal Čihař2016-02-251-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* CreateDefinition: Properly parse DEFAULT value.v3.4.0Dan Ungureanu2016-02-231-1/+1
| | | | | | Fixes phpmyadmin/phpmyadmin#12012. Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Misc: Fixed coding style issues.Dan Ungureanu2016-02-211-1/+1
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* AlterOperation: Parse ALTER VIEW correctly.Dan Ungureanu2016-02-211-0/+11
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Expression: Improved error messages related to aliases.Dan Ungureanu2016-02-211-2/+2
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* OptionsArray: Fixed case-sensitivity issues.Dan Ungureanu2016-02-211-6/+11
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Misc: Fixed some more issues reported by Scrutinizer.Dan Ungureanu2016-02-218-21/+30
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Misc: Fixed some issues reported by Scrutinizer.Dan Ungureanu2016-02-215-13/+11
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Merge pull request #34 from 007durgesh219/Issue#33Dan Ungureanu2016-02-212-17/+50
|\ | | | | AlterStatement: Properly implement parsing. Fixes #33.