diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-09-16 12:14:40 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-09-16 12:14:40 +0500 |
commit | 0ebd55fc24ad76c800814f1124dfba900060ad97 (patch) | |
tree | eb606d6db5828543eecbbe0bdc87e2c362973649 /sql | |
parent | 81466771e4f1f90f479dd3bcffdf44e7800d983d (diff) | |
download | mariadb-git-0ebd55fc24ad76c800814f1124dfba900060ad97.tar.gz |
Bug fix:
http://bugs.mysql.com/bug.php?id=1129
From: Georg Richter
Description: there is a problem with special chars like umlauts in comments
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysql_priv.h | 3 | ||||
-rw-r--r-- | sql/sql_lex.h | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 8 |
4 files changed, 12 insertions, 8 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e546243dec9..d4bacb57a38 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -598,7 +598,8 @@ void set_item_name(Item *item,char *pos,uint length); bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type, char *length, char *decimal, uint type_modifier, - Item *default_value, Item *comment, + Item *default_value, + LEX_STRING *comment, char *change, TYPELIB *interval,CHARSET_INFO *cs, uint uint_geom_type); void store_position_for_column(const char *name); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index d4148ad3414..8ce028020c2 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -489,7 +489,8 @@ typedef struct st_lex String *wild; sql_exchange *exchange; select_result *result; - Item *default_value, *comment; + Item *default_value; + LEX_STRING *comment; LEX_USER *grant_user; gptr yacc_yyss,yacc_yyvs; THD *thd; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1514f3b860f..370ccd3c38b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3709,7 +3709,7 @@ mysql_parse(THD *thd, char *inBuf, uint length) bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, char *length, char *decimals, uint type_modifier, - Item *default_value, Item *comment, + Item *default_value, LEX_STRING *comment, char *change, TYPELIB *interval, CHARSET_INFO *cs, uint uint_geom_type) { @@ -3783,8 +3783,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, else { /* In this case comment is always of type Item_string */ - new_field->comment.str= (char*) comment->str_value.ptr(); - new_field->comment.length=comment->str_value.length(); + new_field->comment.str= (char*) comment->str; + new_field->comment.length=comment->length; } if (length && !(new_field->length= (uint) atoi(length))) length=0; /* purecov: inspected */ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 35d589156c8..6491dd6cad1 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1199,7 +1199,8 @@ field_spec: { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; lex->interval=0; - lex->default_value=lex->comment=0; + lex->default_value=0; + lex->comment=0; lex->charset=NULL; } type opt_attribute @@ -1411,7 +1412,7 @@ attribute: | opt_primary KEY_SYM { Lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG; } | UNIQUE_SYM { Lex->type|= UNIQUE_FLAG; } | UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; } - | COMMENT_SYM text_literal { Lex->comment= $2; } + | COMMENT_SYM TEXT_STRING_sys { Lex->comment= &$2; } | COLLATE_SYM collation_name { if (Lex->charset && !my_charset_same(Lex->charset,$2)) @@ -1668,7 +1669,8 @@ alter_list_item: { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; lex->interval=0; - lex->default_value=lex->comment=0; + lex->default_value=0; + lex->comment=0; lex->charset= NULL; lex->simple_alter=0; } |