diff options
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index ef845bb8266..6952effb48f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2724,7 +2724,19 @@ void Item_func_get_user_var::fix_length_and_dec() error= get_var_with_binlog(thd, name, &var_entry); if (var_entry) + { collation.set(var_entry->collation); + switch (var_entry->type) { + case REAL_RESULT: + max_length= DBL_DIG + 8; + case INT_RESULT: + max_length= MAX_BIGINT_WIDTH; + break; + case STRING_RESULT: + max_length= MAX_BLOB_WIDTH; + break; + } + } else null_value= 1; |