mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-amf
This commit is contained in:
commit
210829a183
1 changed files with 11 additions and 4 deletions
|
@ -213,14 +213,21 @@ void Item_bool_func2::fix_length_and_dec()
|
|||
{
|
||||
THD *thd= current_thd;
|
||||
/*
|
||||
In case we're in statement prepare, create conversion item
|
||||
in its memory: it will be reused on each execute.
|
||||
In case we're in prepared statement, create conversion
|
||||
item in its memory: it will be reused on each execute.
|
||||
(and don't juggle with mem_root's if it is ordinary statement).
|
||||
We come here only during first fix_fields() because after creating
|
||||
conversion item we will have arguments with compatible collations.
|
||||
*/
|
||||
Item_arena *arena= thd->current_arena, backup;
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
if (arena->is_conventional())
|
||||
arena= 0;
|
||||
else
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
conv= new Item_func_conv_charset(args[weak],
|
||||
args[strong]->collation.collation);
|
||||
thd->restore_backup_item_arena(arena, &backup);
|
||||
if (arena)
|
||||
thd->restore_backup_item_arena(arena, &backup);
|
||||
conv->collation.set(args[weak]->collation.derivation);
|
||||
conv->fix_fields(thd, 0, &conv);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue