Commit 2e79201c authored by unknown's avatar unknown

Post-merge fixes.

parent 61e454c0
......@@ -667,13 +667,13 @@ counter datavalue
57 newval
58 newval
drop table t1;
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
select * from t1;
b
drop table t1;
create table atablewithareallylongandirritatingname (a int);
insert into atablewithareallylongandirritatingname values (2);
select * from atablewithareallylongandirritatingname;
a
2
drop table atablewithareallylongandirritatingname;
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
select * from t1;
b
drop table t1;
......@@ -806,3 +806,22 @@ execute stmt;
@@tx_isolation
REPEATABLE-READ
deallocate prepare stmt;
prepare stmt from "create temporary table t1 (letter enum('','a','b','c')
not null)";
execute stmt;
drop table t1;
execute stmt;
drop table t1;
execute stmt;
drop table t1;
set names latin1;
prepare stmt from "create table t1 (a enum('test') default 'test')
character set utf8";
execute stmt;
drop table t1;
execute stmt;
drop table t1;
execute stmt;
drop table t1;
set names default;
deallocate prepare stmt;
......@@ -2708,6 +2708,14 @@ select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
count(f2) >0
1
drop table t1,t2;
create table t1 (f1 int,f2 int);
insert into t1 values(1,1);
create table t2 (f3 int, f4 int, primary key(f3,f4));
insert into t2 values(1,1);
select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2));
f1 f2
1 1
drop table t1,t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
......
......@@ -729,7 +729,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
Create the typelib in prepared statement memory if we're
executing one.
*/
MEM_ROOT *stmt_root= thd->current_arena->mem_root;
MEM_ROOT *stmt_root= thd->stmt_arena->mem_root;
interval= sql_field->interval= typelib(stmt_root,
sql_field->interval_list);
......@@ -763,21 +763,20 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
*/
if (sql_field->def && cs != sql_field->def->collation.collation)
{
Item_arena backup_arena;
bool need_to_change_arena=
!thd->current_arena->is_conventional_execution();
Query_arena backup_arena;
bool need_to_change_arena= !thd->stmt_arena->is_conventional();
if (need_to_change_arena)
{
/* Asser that we don't do that at every PS execute */
DBUG_ASSERT(thd->current_arena->is_first_stmt_execute() ||
thd->current_arena->is_first_sp_execute());
thd->set_n_backup_item_arena(thd->current_arena, &backup_arena);
DBUG_ASSERT(thd->stmt_arena->is_first_stmt_execute() ||
thd->stmt_arena->is_first_sp_execute());
thd->set_n_backup_active_arena(thd->stmt_arena, &backup_arena);
}
sql_field->def= sql_field->def->safe_charset_converter(cs);
if (need_to_change_arena)
thd->restore_backup_item_arena(thd->current_arena, &backup_arena);
thd->restore_active_arena(thd->stmt_arena, &backup_arena);
if (! sql_field->def)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment