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 — Fix #13951 wrong parsing partitions · phpmyadmin/sql-parser@fe98a34

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/Components
    • PartitionDefinition.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
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,16 @@ public static function parse(Parser $parser, TokensList $list, array $options =
170170
$ret->name = $token->value;
171171

172172
// Looking ahead for a 'VALUES' keyword.
173-
$idx = $list->idx;
174-
$list->getNext();
175-
$nextToken = $list->getNext();
176-
$list->idx = $idx;
173+
// Loop until the end of the partition name (delimited by a whitespace)
174+
while ($nextToken = $list->tokens[++$list->idx]) {
175+
if ($nextToken->type === Token::TYPE_WHITESPACE) {
176+
break;
177+
}
178+
$ret->name .= $nextToken->value;
179+
}
180+
$idx = $list->idx--;
181+
// Get the first token after the white space.
182+
$nextToken = $list->tokens[++$idx];
177183

178184
$state = ($nextToken->type === Token::TYPE_KEYWORD)
179185
&& ($nextToken->value === 'VALUES')

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.