diff options
author | Ignacio Galarza <iggy@mysql.com> | 2009-03-17 16:29:24 -0400 |
---|---|---|
committer | Ignacio Galarza <iggy@mysql.com> | 2009-03-17 16:29:24 -0400 |
commit | 428e28e00c679ca6f3a997e0303604d881e361c3 (patch) | |
tree | 3c313f70fd16653491985d8e8108fb5b99f0d5d0 /sql/item_func.cc | |
parent | 2d9421c3bb7376bcfa5484d94b45df65d67e4468 (diff) | |
parent | ec39e58d13f95e455a6553bca3e618e7065707d0 (diff) | |
download | mariadb-git-428e28e00c679ca6f3a997e0303604d881e361c3.tar.gz |
auto-merge
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index ac96d4f6b24..8fc9fadb6bd 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4837,7 +4837,9 @@ bool Item_func_get_system_var::is_written_to_binlog() void Item_func_get_system_var::fix_length_and_dec() { + char *cptr; maybe_null=0; + max_length= 0; if (var->check_type(var_type)) { @@ -4867,8 +4869,14 @@ void Item_func_get_system_var::fix_length_and_dec() break; case SHOW_CHAR: case SHOW_CHAR_PTR: + pthread_mutex_lock(&LOCK_global_system_variables); + cptr= var->show_type() == SHOW_CHAR_PTR ? + *(char**) var->value_ptr(current_thd, var_type, &component) : + (char*) var->value_ptr(current_thd, var_type, &component); + if (cptr) + max_length= strlen(cptr) * system_charset_info->mbmaxlen; + pthread_mutex_unlock(&LOCK_global_system_variables); collation.set(system_charset_info, DERIVATION_SYSCONST); - max_length= MAX_BLOB_WIDTH; decimals=NOT_FIXED_DEC; break; case SHOW_BOOL: @@ -5371,7 +5379,10 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref) if (item->type() == Item::REF_ITEM) args[i]= item= *((Item_ref *)item)->ref; if (item->type() != Item::FIELD_ITEM) - key=NO_SUCH_KEY; + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "AGAINST"); + return TRUE; + } } /* Check that all columns come from the same table. |