summaryrefslogtreecommitdiffstats
path: root/tests/Components/PartitionDefinitionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/PartitionDefinitionTest.php')
-rw-r--r--tests/Components/PartitionDefinitionTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Components/PartitionDefinitionTest.php b/tests/Components/PartitionDefinitionTest.php
index 7edc21e..3c9a847 100644
--- a/tests/Components/PartitionDefinitionTest.php
+++ b/tests/Components/PartitionDefinitionTest.php
@@ -19,4 +19,16 @@ class PartitionDefinitionTest extends TestCase
$this->assertEquals('LESS THAN', $component->type);
$this->assertEquals('(1990)', $component->expr->expr);
}
+
+ public function testParseNameWithUnderscore()
+ {
+ $component = PartitionDefinition::parse(
+ new Parser(),
+ $this->getTokensList('PARTITION 2017_12 VALUES LESS THAN (\'2018-01-01 00:00:00\') ENGINE = MyISAM')
+ );
+ $this->assertFalse($component->isSubpartition);
+ $this->assertEquals('2017_12', $component->name);
+ $this->assertEquals('LESS THAN', $component->type);
+ $this->assertEquals('(\'2018-01-01 00:00:00\')', $component->expr->expr);
+ }
}