summaryrefslogtreecommitdiffstats
path: root/src/Components
diff options
context:
space:
mode:
Diffstat (limited to 'src/Components')
-rw-r--r--src/Components/AlterOperation.php13
-rw-r--r--src/Components/PartitionDefinition.php2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/Components/AlterOperation.php b/src/Components/AlterOperation.php
index 10c27ea..3481e98 100644
--- a/src/Components/AlterOperation.php
+++ b/src/Components/AlterOperation.php
@@ -51,6 +51,7 @@ class AlterOperation extends Component
'AVG_ROW_LENGTH' => array(1, 'var'),
'MAX_ROWS' => array(1, 'var'),
'ROW_FORMAT' => array(1, 'var'),
+ 'COMMENT' => array(1, 'var'),
'ADD' => 1,
'ALTER' => 1,
'ANALYZE' => 1,
@@ -219,6 +220,17 @@ class AlterOperation extends Component
} elseif (($token->value === ',') && ($brackets === 0)) {
break;
}
+ } elseif (!empty(Parser::$STATEMENT_PARSERS[$token->value])) {
+ // We have reached the end of ALTER operation and suddenly found
+ // a start to new statement, but have not find a delimiter between them
+
+ if (! ($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) {
+ $parser->error(
+ __('A new statement was found, but no delimiter between it and the previous one.'),
+ $token
+ );
+ break;
+ }
}
$ret->unknown[] = $token;
}
@@ -232,6 +244,7 @@ class AlterOperation extends Component
}
--$list->idx;
+
return $ret;
}
diff --git a/src/Components/PartitionDefinition.php b/src/Components/PartitionDefinition.php
index 06dc5fc..85342d7 100644
--- a/src/Components/PartitionDefinition.php
+++ b/src/Components/PartitionDefinition.php
@@ -215,7 +215,7 @@ class PartitionDefinition extends Component
? '' : ' ' . PartitionDefinition::build($component->subpartitions);
return trim(
'PARTITION ' . $component->name
- . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr)
+ . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ')
. $component->options . $subpartitions
);
}