GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add test case to check partition name starting by a number · phpmyadmin/sql-parser@ccb20a1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/Components
    • PartitionDefinition.php
  • tests/Components
    • PartitionDefinitionTest.php
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Components/PartitionDefinition.php‎

Copy file name to clipboardExpand all lines: src/Components/PartitionDefinition.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
172172
// Looking ahead for a 'VALUES' keyword.
173173
// Loop until the end of the partition name (delimited by a whitespace)
174174
while ($nextToken = $list->tokens[++$list->idx]) {
175-
if ($nextToken->type === Token::TYPE_WHITESPACE) {
175+
if ($nextToken->type !== Token::TYPE_NONE) {
176176
break;
177177
}
178178
$ret->name .= $nextToken->value;
Collapse file

‎tests/Components/PartitionDefinitionTest.php‎

Copy file name to clipboardExpand all lines: tests/Components/PartitionDefinitionTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ public function testParse()
1919
$this->assertEquals('LESS THAN', $component->type);
2020
$this->assertEquals('(1990)', $component->expr->expr);
2121
}
22+
23+
public function testParseNameWithUnderscore()
24+
{
25+
$component = PartitionDefinition::parse(
26+
new Parser(),
27+
$this->getTokensList('PARTITION 2017_12 VALUES LESS THAN (\'2018-01-01 00:00:00\') ENGINE = MyISAM')
28+
);
29+
$this->assertFalse($component->isSubpartition);
30+
$this->assertEquals('2017_12', $component->name);
31+
$this->assertEquals('LESS THAN', $component->type);
32+
$this->assertEquals('(\'2018-01-01 00:00:00\')', $component->expr->expr);
33+
}
2234
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.