summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Components/PartitionDefinition.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Components/PartitionDefinition.php b/src/Components/PartitionDefinition.php
index 71f73b8..53da148 100644
--- a/src/Components/PartitionDefinition.php
+++ b/src/Components/PartitionDefinition.php
@@ -170,10 +170,16 @@ class PartitionDefinition extends Component
$ret->name = $token->value;
// Looking ahead for a 'VALUES' keyword.
- $idx = $list->idx;
- $list->getNext();
- $nextToken = $list->getNext();
- $list->idx = $idx;
+ // Loop until the end of the partition name (delimited by a whitespace)
+ while ($nextToken = $list->tokens[++$list->idx]) {
+ if ($nextToken->type !== Token::TYPE_NONE) {
+ break;
+ }
+ $ret->name .= $nextToken->value;
+ }
+ $idx = $list->idx--;
+ // Get the first token after the white space.
+ $nextToken = $list->tokens[++$idx];
$state = ($nextToken->type === Token::TYPE_KEYWORD)
&& ($nextToken->value === 'VALUES')