diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-06-03 14:59:17 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-06-03 14:59:17 +0500 |
commit | 7e05bc77a2df5d212dc3e431966927c93d5c76d1 (patch) | |
tree | f7bb603f0c1323874da13a5e0f5bc44f6781cada /sql | |
parent | 1aa1d970d4d805a8029a7f197a59163145c7dc60 (diff) | |
download | mariadb-git-7e05bc77a2df5d212dc3e431966927c93d5c76d1.tar.gz |
MY_CS_NONTEXT flag for sprintf() incompatible charsets (ucs2 if the only one now)
Some default_charset_info were removed
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 20 | ||||
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/item_create.cc | 2 | ||||
-rw-r--r-- | sql/item_geofunc.cc | 2 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 4 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | sql/sql_string.cc | 4 | ||||
-rw-r--r-- | sql/sql_string.h | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 10 |
9 files changed, 24 insertions, 24 deletions
diff --git a/sql/field.cc b/sql/field.cc index a61654ed8f4..044684b2675 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -335,7 +335,7 @@ bool Field::optimize_range(uint idx) void Field_null::sql_type(String &res) const { - res.set_latin1("null", 4); + res.set_ascii("null", 4); } @@ -856,7 +856,7 @@ String *Field_decimal::val_str(String *val_buffer __attribute__((unused)), if (field_length < tmp_length) // Error in data val_ptr->length(0); else - val_ptr->set_latin1((const char*) str, field_length-tmp_length); + val_ptr->set_ascii((const char*) str, field_length-tmp_length); return val_ptr; } @@ -2389,7 +2389,7 @@ void Field_float::sql_type(String &res) const { if (dec == NOT_FIXED_DEC) { - res.set_latin1("float", 5); + res.set_ascii("float", 5); } else { @@ -2647,7 +2647,7 @@ void Field_double::sql_type(String &res) const CHARSET_INFO *cs=res.charset(); if (dec == NOT_FIXED_DEC) { - res.set_latin1("double",6); + res.set_ascii("double",6); } else { @@ -2987,7 +2987,7 @@ void Field_timestamp::sort_string(char *to,uint length __attribute__((unused))) void Field_timestamp::sql_type(String &res) const { - res.set_latin1("timestamp", 9); + res.set_ascii("timestamp", 9); } @@ -3186,7 +3186,7 @@ void Field_time::sort_string(char *to,uint length __attribute__((unused))) void Field_time::sql_type(String &res) const { - res.set_latin1("time", 4); + res.set_ascii("time", 4); } /**************************************************************************** @@ -3467,7 +3467,7 @@ void Field_date::sort_string(char *to,uint length __attribute__((unused))) void Field_date::sql_type(String &res) const { - res.set_latin1("date", 4); + res.set_ascii("date", 4); } /**************************************************************************** @@ -3637,7 +3637,7 @@ void Field_newdate::sort_string(char *to,uint length __attribute__((unused))) void Field_newdate::sql_type(String &res) const { - res.set_latin1("date", 4); + res.set_ascii("date", 4); } @@ -3870,7 +3870,7 @@ void Field_datetime::sort_string(char *to,uint length __attribute__((unused))) void Field_datetime::sql_type(String &res) const { - res.set_latin1("datetime", 8); + res.set_ascii("datetime", 8); } /**************************************************************************** @@ -4615,7 +4615,7 @@ void Field_blob::sql_type(String &res) const case 3: str="medium"; length= 6; break; case 4: str="long"; length=4; break; } - res.set_latin1(str,length); + res.set_ascii(str,length); if (charset() == &my_charset_bin) res.append("blob"); else diff --git a/sql/item.cc b/sql/item.cc index 636cefb511b..42a949287e5 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1452,7 +1452,7 @@ bool Item_insert_value::fix_fields(THD *thd, struct st_table_list *table_list, I Field *field=field_arg->field; /* charset doesn't matter here, it's to avoid sigsegv only */ set_field(new Field_null(0,0,Field::NONE,field->field_name,field->table, - default_charset_info)); + &my_charset_bin)); } return 0; } diff --git a/sql/item_create.cc b/sql/item_create.cc index 3edec7fdab0..00c98937659 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -324,7 +324,7 @@ Item *create_func_current_user() length= (uint) (strxmov(buff, thd->priv_user, "@", thd->priv_host, NullS) - buff); return new Item_string(NullS, thd->memdup(buff, length), length, - default_charset_info); + system_charset_info); } Item *create_func_quarter(Item* a) diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 06ba67cbc73..fa858922c1b 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -141,7 +141,7 @@ String *Item_func_geometry_type::val_str(String *str) return 0; str->copy(geom.get_class_info()->m_name, strlen(geom.get_class_info()->m_name), - default_charset_info); + default_charset()); return str; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 06569095018..3c4b5070850 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2257,7 +2257,7 @@ String *Item_func_hex::val_str(String *str) if ((null_value= args[0]->null_value)) return 0; ptr= longlong2str(dec,ans,16); - if (str->copy(ans,(uint32) (ptr-ans),default_charset_info)) + if (str->copy(ans,(uint32) (ptr-ans),default_charset())) return &empty_string; // End of memory return str; } @@ -2366,7 +2366,7 @@ String* Item_func_export_set::val_str(String* str) } break; case 3: - sep_buf.set(",", 1, default_charset_info); + sep_buf.set(",", 1, default_charset()); sep = &sep_buf; } null_value=0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9ebb6305f70..f098ce0d0b6 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -623,7 +623,7 @@ check_connections(THD *thd) memcpy(end,thd->scramble,SCRAMBLE_LENGTH+1); end+=SCRAMBLE_LENGTH +1; int2store(end,client_flags); - end[2]=(char) MY_CHARSET_CURRENT; + end[2]=(char) default_charset_info->number; int2store(end+3,thd->server_status); bzero(end+5,13); end+=18; diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 6077c42bd1d..cf6645fa23e 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -265,9 +265,9 @@ bool String::copy(const char *str, uint32 arg_length, */ -bool String::set_latin1(const char *str, uint32 arg_length) +bool String::set_ascii(const char *str, uint32 arg_length) { - if (str_charset->mbmaxlen == 1) + if (!(str_charset->state & MY_CS_NONTEXT)) { set(str, arg_length, str_charset); return 0; diff --git a/sql/sql_string.h b/sql/sql_string.h index 8212bd0a2bd..ee38853a2d3 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -117,7 +117,7 @@ public: Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; str_charset=cs; } - bool set_latin1(const char *str, uint32 arg_length); + bool set_ascii(const char *str, uint32 arg_length); inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs) { if (!alloced) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1002d06be88..66a29a8cbd5 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2863,15 +2863,15 @@ key_usage_list2: key_usage_list2 ',' ident { Select->select_lex()-> interval_list.push_back(new String((const char*) $3.str, $3.length, - default_charset_info)); } + system_charset_info)); } | ident { Select->select_lex()-> interval_list.push_back(new String((const char*) $1.str, $1.length, - default_charset_info)); } + system_charset_info)); } | PRIMARY_SYM { Select->select_lex()-> interval_list.push_back(new String("PRIMARY", 7, - default_charset_info)); }; + system_charset_info)); }; using_list: ident @@ -3756,7 +3756,7 @@ opt_describe_column: /* empty */ {} | text_string { Lex->wild= $1; } | ident - { Lex->wild= new String((const char*) $1.str,$1.length,default_charset_info); }; + { Lex->wild= new String((const char*) $1.str,$1.length,system_charset_info); }; /* flush things */ @@ -4829,7 +4829,7 @@ column_list: column_list_id: ident { - String *new_str = new String((const char*) $1.str,$1.length,default_charset_info); + String *new_str = new String((const char*) $1.str,$1.length,system_charset_info); List_iterator <LEX_COLUMN> iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; |