Skip to content

Commit 98746e3

Browse files
committed
ColumnDefinitionProcessor: fixed year datatype length
1 parent c2c1a7b commit 98746e3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/PHPSQLParser/processors/ColumnDefinitionProcessor.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,16 @@ public function process($tokens) {
196196
$prevCategory = $upper;
197197
continue 2;
198198

199+
case 'YEAR':
200+
$expr[] = array('expr_type' => ExpressionType::DATA_TYPE, 'base_expr' => $trim, 'length' => false);
201+
$currCategory = 'SINGLE_PARAM_PARENTHESIS';
202+
$prevCategory = $upper;
203+
continue 2;
204+
199205
case 'DATE':
200206
case 'TIME':
201207
case 'TIMESTAMP':
202208
case 'DATETIME':
203-
case 'YEAR':
204209
case 'TINYBLOB':
205210
case 'BLOB':
206211
case 'MEDIUMBLOB':

0 commit comments

Comments
 (0)