diff options
author | unknown <bar@mysql.com> | 2005-09-02 11:19:43 +0500 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-09-02 11:19:43 +0500 |
commit | 3b077226c9d2721725405410cd64868e76ba095b (patch) | |
tree | be799aa133533727c1a04f8e06f0d1efecfd4f91 /sql/set_var.cc | |
parent | b513103619bb4b7172708b364f71334570e428db (diff) | |
parent | bda02a17e79f3346ce2680ed04670e11f2bfcf63 (diff) | |
download | mariadb-git-3b077226c9d2721725405410cd64868e76ba095b.tar.gz |
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.b12363
mysql-test/t/variables.test:
Auto merged
sql/set_var.cc:
Auto merged
mysql-test/r/variables.result:
SCCS merged
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index c0186880a59..94968f664fd 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1602,11 +1602,17 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type, base),1); case SHOW_CHAR: { - Item_string *tmp; + Item *tmp; pthread_mutex_lock(&LOCK_global_system_variables); char *str= (char*) value_ptr(thd, var_type, base); - tmp= new Item_string(str, strlen(str), - system_charset_info, DERIVATION_SYSCONST); + if (str) + tmp= new Item_string(str, strlen(str), + system_charset_info, DERIVATION_SYSCONST); + else + { + tmp= new Item_null(); + tmp->collation.set(system_charset_info, DERIVATION_SYSCONST); + } pthread_mutex_unlock(&LOCK_global_system_variables); return tmp; } @@ -1896,7 +1902,7 @@ byte *sys_var_character_set::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { CHARSET_INFO *cs= ci_ptr(thd,type)[0]; - return cs ? (byte*) cs->csname : (byte*) "NULL"; + return cs ? (byte*) cs->csname : (byte*) NULL; } |