diff options
author | Leonard Zhou <zhou.li@sun.com> | 2009-03-26 15:38:17 +0800 |
---|---|---|
committer | Leonard Zhou <zhou.li@sun.com> | 2009-03-26 15:38:17 +0800 |
commit | 944915cabe8712780e558bc9c41bdb12e5f1a5a7 (patch) | |
tree | f93bb45712374aa2388c259a0dc079dff4e5cb8f /sql | |
parent | 55c779cdbf0e402338bb32253a2fc1db7fa02129 (diff) | |
download | mariadb-git-944915cabe8712780e558bc9c41bdb12e5f1a5a7.tar.gz |
BUG#35515 Aliases of variables in binary log are ignored with NAME_CONST.
When add an aliase name after NAME_CONST, the aliase name will be overwrite.
NAME_CONST will re-set the field's name only if there isn't an aliase in the
function fix-fields().
If there is an aliase, NAME_CONST doesn't re-set the field's name and keeps the old
name.
mysql-test/r/func_misc.result:
Test result.
mysql-test/r/rpl_name_const.result:
Test case.
mysql-test/t/func_misc.test:
Add NAME_CONST test.
mysql-test/t/rpl_name_const.test:
Test result.
sql/item.cc:
Re-set field's name if the name is autogenerated, that mean without aliase.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index f32828629cf..aa2138a0345 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1282,7 +1282,10 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref) my_error(ER_RESERVED_SYNTAX, MYF(0), "NAME_CONST"); return TRUE; } - set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info); + if (is_autogenerated_name) + { + set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info); + } collation.set(value_item->collation.collation, DERIVATION_IMPLICIT); max_length= value_item->max_length; decimals= value_item->decimals; |