From e43d9be05b51e39a198d573cf422891845f3f40b Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 12 Feb 2020 09:14:07 +0000 Subject: [PATCH] MCOL-3721 Fix quoting issues for COLLATE --- dbcon/ddlpackage/ddl.y | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dbcon/ddlpackage/ddl.y b/dbcon/ddlpackage/ddl.y index d0f408e86..f95f3e3fb 100644 --- a/dbcon/ddlpackage/ddl.y +++ b/dbcon/ddlpackage/ddl.y @@ -199,7 +199,7 @@ BOOL BOOLEAN MEDIUMINT TIMESTAMP %type trunc_table_statement %type rename_table_statement %type ident - +%type opt_quoted_literal %% stmtblock: stmtmulti { x->fParseTree = $1; } ; @@ -490,9 +490,9 @@ table_option: | DEFAULT IDB_CHAR SET opt_equal ident {$$ = new pair("default charset", $5);} | - DEFAULT COLLATE opt_equal ident {$$ = new pair("default collate", $4);} + DEFAULT COLLATE opt_equal opt_quoted_literal {$$ = new pair("default collate", $4);} | - COLLATE opt_equal ident {$$ = new pair("default collate", $3);} + COLLATE opt_equal opt_quoted_literal {$$ = new pair("default collate", $3);} ; alter_table_statement: @@ -735,13 +735,13 @@ optional_braces: opt_column_charset: /* empty */ {} | - IDB_CHAR SET ident {} + IDB_CHAR SET opt_quoted_literal {} ; opt_column_collate: /* empty */ {} | - COLLATE ident {} + COLLATE opt_quoted_literal {} ; data_type: @@ -864,6 +864,12 @@ string_literal: '\'' SCONST '\'' {$$ = $2;} ; +opt_quoted_literal: + string_literal + | + ident + ; + character_string_type: CHARACTER {