summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-08-15 15:24:07 +0500
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-08-15 15:24:07 +0500
commitfe3dee0621a23136c33c6b7085a6846353b1f797 (patch)
tree9289acda2813d8ab3ca166135876433070eb4b32 /sql/sql_lex.cc
parentef6019010da0a55f018e7f37a8d191236d9202ca (diff)
downloadmariadb-git-fe3dee0621a23136c33c6b7085a6846353b1f797.tar.gz
Fix for bug #20695: Charset introducer overrides charset definition for column.
- if there are two character set definitions in the column declaration, we replace the first one with the second one as we store both in the LEX->charset slot. Add a separate slot to the LEX structure to store underscore charset. - convert default values to the column charset of STRING, VARSTRING fields if necessary as well. mysql-test/r/ctype_recoding.result: Fix for bug #20695: Charset introducer overrides charset definition for column. - test result. mysql-test/t/ctype_recoding.test: Fix for bug #20695: Charset introducer overrides charset definition for column. - test case. sql/sql_lex.cc: Fix for bug #20695: Charset introducer overrides charset definition for column. - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET sql/sql_lex.h: Fix for bug #20695: Charset introducer overrides charset definition for column. - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET sql/sql_table.cc: Fix for bug #20695: Charset introducer overrides charset definition for column. - convert default values to the column charset of VARSTRING, STRING, ENUM, SET fields if necessary. sql/sql_yacc.yy: Fix for bug #20695: Charset introducer overrides charset definition for column. - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index fb9a765f12c..dfe406c351e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -643,8 +643,9 @@ int yylex(void *arg, void *yythd)
*/
if ((yylval->lex_str.str[0]=='_') &&
- (lex->charset=get_charset_by_csname(yylval->lex_str.str+1,
- MY_CS_PRIMARY,MYF(0))))
+ (lex->underscore_charset=
+ get_charset_by_csname(yylval->lex_str.str + 1,
+ MY_CS_PRIMARY,MYF(0))))
return(UNDERSCORE_CHARSET);
return(result_state); // IDENT or IDENT_QUOTED