mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Code cleanup, more tests.
This commit is contained in:
@ -242,3 +242,12 @@ analyze update t1 set i=8;
|
|||||||
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
|
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
|
||||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4 100.00 100.00
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4 100.00 100.00
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Check ANALYZE SELECT INTO
|
||||||
|
#
|
||||||
|
create table t1 (i int);
|
||||||
|
insert into t1 values (1);
|
||||||
|
analyze select * from t1 into @var;
|
||||||
|
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
|
||||||
|
1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL
|
||||||
|
drop table t1;
|
||||||
|
@ -191,3 +191,10 @@ insert into t1 values (1),(2),(3),(4);
|
|||||||
analyze update t1 set i=8;
|
analyze update t1 set i=8;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Check ANALYZE SELECT INTO
|
||||||
|
--echo #
|
||||||
|
create table t1 (i int);
|
||||||
|
insert into t1 values (1);
|
||||||
|
analyze select * from t1 into @var;
|
||||||
|
drop table t1;
|
||||||
|
@ -5256,11 +5256,9 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
select_result *save_result;
|
|
||||||
Protocol *save_protocol;
|
Protocol *save_protocol;
|
||||||
if (lex->analyze_stmt)
|
if (lex->analyze_stmt)
|
||||||
{
|
{
|
||||||
save_result= result;
|
|
||||||
result= new select_send_analyze();
|
result= new select_send_analyze();
|
||||||
save_protocol= thd->protocol;
|
save_protocol= thd->protocol;
|
||||||
thd->protocol= new Protocol_discard(thd);
|
thd->protocol= new Protocol_discard(thd);
|
||||||
@ -5277,16 +5275,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
|
|||||||
|
|
||||||
if (lex->analyze_stmt)
|
if (lex->analyze_stmt)
|
||||||
{
|
{
|
||||||
result= save_result;
|
|
||||||
if (!result && !(result= new select_send()))
|
|
||||||
return 1;
|
|
||||||
delete thd->protocol;
|
delete thd->protocol;
|
||||||
thd->protocol= save_protocol;
|
thd->protocol= save_protocol;
|
||||||
if (!res)
|
if (!res)
|
||||||
thd->lex->explain->send_explain(thd);
|
res= thd->lex->explain->send_explain(thd);
|
||||||
|
|
||||||
if (result != lex->result)
|
|
||||||
delete result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user