Skip to content

Commit cee3e67

Browse files
committed
Merge branch '5.8.x'
Ref: phpmyadmin/phpmyadmin#18035
2 parents 5483827 + 9adabf4 commit cee3e67

File tree

7 files changed

+5642
-0
lines changed

7 files changed

+5642
-0
lines changed

tests/Builder/CreateStatementTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,20 @@ public function testBuilderPartitionsEngine(string $query): void
301301

302302
public function testBuilderView(): void
303303
{
304+
$parser = new Parser(
305+
'CREATE OR REPLACE VIEW xviewmytable AS SELECT mytable.id '
306+
. 'AS id, mytable.personid AS personid FROM mytable '
307+
. 'WHERE (mytable.birth > \'1990-01-19\') GROUP BY mytable.personid ;'
308+
);
309+
$stmt = $parser->statements[0];
310+
311+
$this->assertEquals(
312+
'CREATE OR REPLACE VIEW xviewmytable AS SELECT mytable.id '
313+
. 'AS `id`, mytable.personid AS `personid` FROM mytable '
314+
. 'WHERE (mytable.birth > \'1990-01-19\') GROUP BY mytable.personid ',
315+
$stmt->build()
316+
);
317+
304318
$parser = new Parser(
305319
'CREATE VIEW myView (vid, vfirstname) AS ' .
306320
'SELECT id, first_name FROM employee WHERE id = 1'

tests/Parser/CreateStatementTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public static function createProvider(): array
6767
['parser/parseCreateViewWithWrongSyntax'],
6868
['parser/parseCreateViewWithUnion'],
6969
['parser/parseCreateViewAsWithAs'],
70+
['parser/parseCreateOrReplaceView1'],
7071
];
7172
}
7273
}

tests/Parser/SelectStatementTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static function selectProvider(): array
4545
['parser/parseSelect13'],
4646
['parser/parseSelect14'],
4747
['parser/parseSelect15'],
48+
['parser/parseSelect16'],
4849
['parser/parseSelectErr1'],
4950
['parser/parseSelectErr2'],
5051
['parser/parseSelectNested'],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE OR REPLACE VIEW xviewmytable AS SELECT mytable.id AS id, mytable.personid AS personid FROM mytable WHERE (mytable.birth > '1990-01-19') GROUP BY mytable.personid ;

0 commit comments

Comments
 (0)