Skip to content

Commit

Permalink
Misc: Add test cases for fixed bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ungureanu committed Feb 10, 2016
1 parent 5b6e9bd commit 38b10f5
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Misc/BugsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public function testBugProvider()
array('bugs/gh9'),
array('bugs/gh14'),
array('bugs/gh16'),
array('bugs/pma11800'),
array('bugs/pma11836'),
array('bugs/pma11843'),
array('bugs/pma11867'),
array('bugs/pma11879'),
);
}
}
1 change: 1 addition & 0 deletions tests/data/bugs/pma11800.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT 'a' REGEXP '^[a-d]';
1 change: 1 addition & 0 deletions tests/data/bugs/pma11800.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:4:{s:5:"query";s:27:"SELECT 'a' REGEXP '^[a-d]';";s:5:"lexer";O:15:"SqlParser\Lexer":8:{s:6:"strict";b:0;s:3:"str";s:27:"SELECT 'a' REGEXP '^[a-d]';";s:3:"len";i:27;s:4:"last";i:27;s:4:"list";O:20:"SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:15:"SqlParser\Token":5:{s:5:"token";s:3:"'a'";s:5:"value";s:1:"a";s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"REGEXP";s:5:"value";s:6:"REGEXP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:11;}i:5;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:15:"SqlParser\Token":5:{s:5:"token";s:8:"'^[a-d]'";s:5:"value";s:6:"^[a-d]";s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:18;}i:7;O:15:"SqlParser\Token":5:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:26;}i:8;O:15:"SqlParser\Token":5:{s:5:"token";N;s:5:"value";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"errors";a:0:{}}s:6:"parser";O:16:"SqlParser\Parser":5:{s:4:"list";r:8;s:6:"strict";b:0;s:6:"errors";a:0:{}s:10:"statements";a:1:{i:0;O:36:"SqlParser\Statements\SelectStatement":15:{s:4:"expr";a:1:{i:0;O:31:"SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:18:"'a'REGEXP '^[a-d]'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}}
1 change: 1 addition & 0 deletions tests/data/bugs/pma11836.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)
1 change: 1 addition & 0 deletions tests/data/bugs/pma11836.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:4:{s:5:"query";s:94:"SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)";s:5:"lexer";O:15:"SqlParser\Lexer":8:{s:6:"strict";b:0;s:3:"str";s:94:"SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)";s:3:"len";i:94;s:4:"last";i:94;s:4:"list";O:20:"SqlParser\TokensList":3:{s:6:"tokens";a:45:{i:0;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:15:"SqlParser\Token":5:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:15:"SqlParser\Token":5:{s:5:"token";s:7:"alumnos";s:5:"value";s:7:"alumnos";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:15:"SqlParser\Token":5:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:31;}i:13;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:14;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:33;}i:15;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:16;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:17;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:18;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:39;}i:19;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:20;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"1";s:5:"value";i:1;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:21;O:15:"SqlParser\Token":5:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:22;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:23;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:24;O:15:"SqlParser\Token":5:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:25;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:26;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"nombre";s:5:"value";s:6:"nombre";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:27;O:15:"SqlParser\Token":5:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:28;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:29;O:15:"SqlParser\Token":5:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:30;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:31;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:60;}i:32;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:33;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"not in";s:5:"value";s:6:"NOT IN";s:4:"type";i:1;s:5:"flags";i:39;s:8:"position";i:63;}i:34;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:35;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:36;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:37;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:38;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:39;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:40;O:15:"SqlParser\Token":5:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:41;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:42;O:15:"SqlParser\Token":5:{s:5:"token";s:7:"alumnos";s:5:"value";s:7:"alumnos";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:43;O:15:"SqlParser\Token":5:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:93;}i:44;O:15:"SqlParser\Token":5:{s:5:"token";N;s:5:"value";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:45;s:3:"idx";i:45;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"errors";a:0:{}}s:6:"parser";O:16:"SqlParser\Parser":5:{s:4:"list";r:8;s:6:"strict";b:0;s:6:"errors";a:0:{}s:10:"statements";a:1:{i:0;O:36:"SqlParser\Statements\SelectStatement":15:{s:4:"expr";a:1:{i:0;O:31:"SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:31:"SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"alumnos";s:6:"column";N;s:4:"expr";s:7:"alumnos";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";a:3:{i:0;O:30:"SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:2:"id";i:1;s:6:"nombre";}s:10:"isOperator";b:0;s:4:"expr";s:27:"id = IF(id = 1, id, nombre)";}i:1;O:30:"SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:30:"SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:2:"id";i:1;s:7:"alumnos";}s:10:"isOperator";b:0;s:4:"expr";s:34:"id not in (SELECT id FROM alumnos)";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:43;}}s:8:"brackets";i:0;}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}}
4 changes: 4 additions & 0 deletions tests/data/bugs/pma11843.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
10 changes: 10 additions & 0 deletions tests/data/bugs/pma11843.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
a:4:{s:5:"query";s:119:"CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
);";s:5:"lexer";O:15:"SqlParser\Lexer":8:{s:6:"strict";b:0;s:3:"str";s:119:"CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
);";s:3:"len";i:119;s:4:"last";i:119;s:4:"list";O:20:"SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:15:"SqlParser\Token":5:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:15:"SqlParser\Token":5:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:15:"SqlParser\Token":5:{s:5:"token";s:9:"`mytable`";s:5:"value";s:7:"mytable";s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:15:"SqlParser\Token":5:{s:5:"token";s:5:"
";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:15:"SqlParser\Token":5:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:29;}i:9;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:10;O:15:"SqlParser\Token":5:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:34;}i:11;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:37;}i:12;O:15:"SqlParser\Token":5:{s:5:"token";s:2:"11";s:5:"value";i:11;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:15:"SqlParser\Token":5:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:14;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:15:"SqlParser\Token":5:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:42;}i:16;O:15:"SqlParser\Token":5:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:17;O:15:"SqlParser\Token":5:{s:5:"token";s:5:"
";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:18;O:15:"SqlParser\Token":5:{s:5:"token";s:12:"`created_at`";s:5:"value";s:10:"created_at";s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:56;}i:19;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:20;O:15:"SqlParser\Token":5:{s:5:"token";s:9:"timestamp";s:5:"value";s:9:"timestamp";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:69;}i:21;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:22;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"6";s:5:"value";i:6;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:79;}i:23;O:15:"SqlParser\Token":5:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:24;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:25;O:15:"SqlParser\Token":5:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:82;}i:26;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:27;O:15:"SqlParser\Token":5:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:91;}i:28;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:29;O:15:"SqlParser\Token":5:{s:5:"token";s:17:"CURRENT_TIMESTAMP";s:5:"value";s:17:"CURRENT_TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:99;}i:30;O:15:"SqlParser\Token":5:{s:5:"token";s:1:"
";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:116;}i:31;O:15:"SqlParser\Token":5:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:117;}i:32;O:15:"SqlParser\Token":5:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:118;}i:33;O:15:"SqlParser\Token":5:{s:5:"token";N;s:5:"value";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"errors";a:0:{}}s:6:"parser";O:16:"SqlParser\Parser":5:{s:4:"list";r:8;s:6:"strict";b:0;s:6:"errors";a:0:{}s:10:"statements";a:1:{i:0;O:36:"SqlParser\Statements\CreateStatement":15:{s:4:"name";O:31:"SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"mytable";s:6:"column";N;s:4:"expr";s:9:"`mytable`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:2:{i:0;O:37:"SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:29:"SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:1;O:37:"SqlParser\Components\CreateDefinition":6:{s:4:"name";s:10:"created_at";s:12:"isConstraint";N;s:4:"type";O:29:"SqlParser\Components\DataType":3:{s:4:"name";s:9:"TIMESTAMP";s:10:"parameters";a:1:{i:0;s:1:"6";}s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:3:{s:4:"name";s:7:"DEFAULT";s:4:"expr";O:31:"SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:17:"CURRENT_TIMESTAMP";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:17:"CURRENT_TIMESTAMP";}}}}}s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:33:"SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}}
1 change: 1 addition & 0 deletions tests/data/bugs/pma11867.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DESC tablename;
1 change: 1 addition & 0 deletions tests/data/bugs/pma11867.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:4:{s:5:"query";s:15:"DESC tablename;";s:5:"lexer";O:15:"SqlParser\Lexer":8:{s:6:"strict";b:0;s:3:"str";s:15:"DESC tablename;";s:3:"len";i:15;s:4:"last";i:15;s:4:"list";O:20:"SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:15:"SqlParser\Token":5:{s:5:"token";s:4:"DESC";s:5:"value";s:4:"DESC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:15:"SqlParser\Token":5:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:15:"SqlParser\Token":5:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:5;}i:3;O:15:"SqlParser\Token":5:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:15:"SqlParser\Token":5:{s:5:"token";N;s:5:"value";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"errors";a:0:{}}s:6:"parser";O:16:"SqlParser\Parser":5:{s:4:"list";r:8;s:6:"strict";b:0;s:6:"errors";a:0:{}s:10:"statements";a:1:{i:0;O:37:"SqlParser\Statements\ExplainStatement":4:{s:7:"unknown";a:3:{i:0;r:10;i:1;r:16;i:2;r:22;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}}
4 changes: 4 additions & 0 deletions tests/data/bugs/pma11879.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO
tbproject(`id`, `name`, `description`, `create_dt`, `dbtype`, `useclause`, `sync_comments`)
VALUES
(NULL, 'testdb', 'Descrizione test', NOW(), 'mySQL', '', 1);
Loading

0 comments on commit 38b10f5

Please sign in to comment.