diff options
author | unknown <bar@mysql.com> | 2005-02-22 15:55:40 +0400 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-02-22 15:55:40 +0400 |
commit | 2fb807d1d0a817c177e02cee7b508b6122ce832e (patch) | |
tree | 600e9219d970f980b5696e6e457a26e43f7b55b0 /sql/item_func.cc | |
parent | 14707d71c388375817b4ffb74df189bbe14a709d (diff) | |
download | mariadb-git-2fb807d1d0a817c177e02cee7b508b6122ce832e.tar.gz |
A user variable are now always have IMPLICIT coercibility,
independently from the expression it is initialized from.
In other words, this change treats a user variable like
a table with one column and one record. Discussed with
PeterG, Serg and Lars. This change also simplifies replication
allowing not to replicate variables' coercibility.
mysql-test/r/user_var.result:
Test changes accordintly
mysql-test/t/user_var.test:
Test changes accordintly
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 34c8732a9f2..895740d2e5e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2361,7 +2361,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, entry->value=0; entry->length=0; entry->update_query_id=0; - entry->collation.set(NULL, DERIVATION_NONE); + entry->collation.set(NULL, DERIVATION_IMPLICIT); /* If we are here, we were called from a SET or a query which sets a variable. Imagine it is this: @@ -2419,8 +2419,8 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables, and the variable has previously been initialized. */ if (!entry->collation.collation || !args[0]->null_value) - entry->collation.set(args[0]->collation); - collation.set(entry->collation); + entry->collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); + collation.set(entry->collation.collation, DERIVATION_IMPLICIT); cached_result_type= args[0]->result_type(); return 0; } @@ -2432,7 +2432,7 @@ Item_func_set_user_var::fix_length_and_dec() maybe_null=args[0]->maybe_null; max_length=args[0]->max_length; decimals=args[0]->decimals; - collation.set(args[0]->collation); + collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); } @@ -2659,7 +2659,7 @@ Item_func_set_user_var::update() res= update_hash((void*) save_result.vstr->ptr(), save_result.vstr->length(), STRING_RESULT, save_result.vstr->charset(), - args[0]->collation.derivation); + DERIVATION_IMPLICIT); break; } case ROW_RESULT: |