summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2004-09-10 18:56:47 +0200
committerunknown <ingo@mysql.com>2004-09-10 18:56:47 +0200
commit7c80446c4e0bd6d4572bdbc3a5498c379c49d0a5 (patch)
treea909c5ccb0ef4d5a098f4bc2bde5325839c3482c /sql/item_func.cc
parente2252a49f7393076107ee5e228be79660e7faecb (diff)
downloadmariadb-git-7c80446c4e0bd6d4572bdbc3a5498c379c49d0a5.tar.gz
BUG#4788 - show create table provides incorrect statement.
Added code to adjust the field_length of user variables in dependence on the field type. Aded new constants for numeric field widths. include/mysql_com.h: BUG#4788 - show create table provides incorrect statement. Introduced definitions for default field width of numeric types. So common values can be used at different places in the code. mysql-test/r/variables.result: BUG#4788 - show create table provides incorrect statement. New test results. mysql-test/t/variables.test: BUG#4788 - show create table provides incorrect statement. Added a test for the bug. sql/item_func.cc: BUG#4788 - show create table provides incorrect statement. Added code to adjust the field_length of user variables in dependence on the field type. sql/sql_parse.cc: BUG#4788 - show create table provides incorrect statement. Changed numeric literals to the new constants.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc12
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;