diff options
author | Michael Widenius <monty@mysql.com> | 2009-04-25 12:04:38 +0300 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2009-04-25 12:04:38 +0300 |
commit | 210a412522b10115d34b431c66acf403faab7bfe (patch) | |
tree | 56c09cfd1053265897d114e4acb52d395185f27e /sql/item_func.cc | |
parent | 059b9356a19118a48fbad31be81c4859e15d3bc8 (diff) | |
parent | 4aeeb1d157a67c5359475d8941267641fb894b22 (diff) | |
download | mariadb-git-210a412522b10115d34b431c66acf403faab7bfe.tar.gz |
bzr merge from guilhem's maria tree to our local 5.1
configure.in:
Manually merged
mysql-test/lib/My/ConfigFactory.pm:
Manually merged
mysql-test/mysql-test-run.pl:
Manually merged
mysql-test/t/information_schema.test:
Manually merged
sql/handler.cc:
Manually merged
support-files/mysql.spec.sh:
Manually merged
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 eb7062aa8bc..fb4594e0e63 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4840,7 +4840,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)) { @@ -4870,8 +4872,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: @@ -5374,7 +5382,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. |