summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorgluh@eagle.(none) <>2007-12-13 14:52:49 +0400
committergluh@eagle.(none) <>2007-12-13 14:52:49 +0400
commite03959502978f9a7056b4adf6ba7c2a25f648b14 (patch)
treeb870e5e7b713672711344eb2e5b585f3e2c48375 /sql/item_func.cc
parent9217f011361bf7c09f05692c409f52d553ce9690 (diff)
parent9f4f6acc53d1f9472def4a6f3fa650f6e72b1d6a (diff)
downloadmariadb-git-e03959502978f9a7056b4adf6ba7c2a25f648b14.tar.gz
Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index fa7821b589c..3a743037267 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2968,6 +2968,12 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
func->max_length=min(initid.max_length,MAX_BLOB_WIDTH);
func->maybe_null=initid.maybe_null;
const_item_cache=initid.const_item;
+ /*
+ Keep used_tables_cache in sync with const_item_cache.
+ See the comment in Item_udf_func::update_used tables.
+ */
+ if (!const_item_cache && !used_tables_cache)
+ used_tables_cache= RAND_TABLE_BIT;
func->decimals=min(initid.decimals,NOT_FIXED_DEC);
}
initialized=1;
@@ -4596,6 +4602,8 @@ void Item_func_get_user_var::fix_length_and_dec()
if (var_entry)
{
+ unsigned_flag= var_entry->unsigned_flag;
+
collation.set(var_entry->collation);
switch (var_entry->type) {
case REAL_RESULT: