diff options
author | ingo@mysql.com <> | 2004-09-10 18:56:47 +0200 |
---|---|---|
committer | ingo@mysql.com <> | 2004-09-10 18:56:47 +0200 |
commit | 6c47f075c767f2b83677eb16fc316178524f6913 (patch) | |
tree | a909c5ccb0ef4d5a098f4bc2bde5325839c3482c /sql/item_func.cc | |
parent | 69695656a165a197ef1a48e615d430afda95451d (diff) | |
download | mariadb-git-6c47f075c767f2b83677eb16fc316178524f6913.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.
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; |