summaryrefslogtreecommitdiffstats
path: root/tests/Components/CreateDefinitionTest.php
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2016-03-19 18:19:09 +0100
committerMichal Čihař <michal@cihar.com>2016-03-19 18:19:09 +0100
commit9d8ae92a7c9e489eac4c7e4fb67b90c4f7a145b2 (patch)
treef89e1e2a3dc087b494420425ecc4152325764970 /tests/Components/CreateDefinitionTest.php
parent09acfe4d548c6209478cc6e7bbf4c3e28c08a1fe (diff)
downloadsql-parser-9d8ae92a7c9e489eac4c7e4fb67b90c4f7a145b2.zip
sql-parser-9d8ae92a7c9e489eac4c7e4fb67b90c4f7a145b2.tar.gz
sql-parser-9d8ae92a7c9e489eac4c7e4fb67b90c4f7a145b2.tar.bz2
Properly parse CREATE TABLE [AS] SELECT
Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12109 Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'tests/Components/CreateDefinitionTest.php')
-rw-r--r--tests/Components/CreateDefinitionTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/Components/CreateDefinitionTest.php b/tests/Components/CreateDefinitionTest.php
index a7b7f86..4d0094d 100644
--- a/tests/Components/CreateDefinitionTest.php
+++ b/tests/Components/CreateDefinitionTest.php
@@ -64,4 +64,15 @@ class CreateDefinitionTest extends TestCase
CreateDefinition::build($parser->statements[0]->fields[1])
);
}
+
+ public function testBuildSelect()
+ {
+ $parser = new Parser(
+ 'CREATE TABLE new_tbl SELECT * FROM orig_tbl'
+ );
+ $this->assertEquals(
+ 'CREATE TABLE new_tbl SELECT * FROM orig_tbl ',
+ $parser->statements[0]->build()
+ );
+ }
}