mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-6400: "ANALYZE SELECT ... INTO @var" doesn't set @var
Make ANALYZE work for - ANALYZE SELECT ... INTO @var - ANALYZE INSERT SELECT ...; - ANALYZE SELECT .. INTO OUTFILE
This commit is contained in:
@ -276,3 +276,20 @@ select * from t1;
|
||||
a b
|
||||
1 2
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-6400 "ANALYZE SELECT ... INTO @var" doesn't set @var
|
||||
#
|
||||
create table t1(a int);
|
||||
insert into t1 values (1),(2);
|
||||
analyze select a from t1 where a <2 into @var;
|
||||
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 2 2 100.00 50.00 Using where
|
||||
analyze select a from t1 into @var;
|
||||
ERROR 42000: Result consisted of more than one row
|
||||
analyze insert into t1 select * from t1;
|
||||
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 2 2 100.00 100.00 Using temporary
|
||||
analyze select * into outfile '../../tmp/data1.tmp' from t1;
|
||||
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
|
||||
drop table t1;
|
||||
|
@ -217,3 +217,19 @@ analyze replace t1 values (1,2);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-6400 "ANALYZE SELECT ... INTO @var" doesn't set @var
|
||||
--echo #
|
||||
create table t1(a int);
|
||||
insert into t1 values (1),(2);
|
||||
|
||||
analyze select a from t1 where a <2 into @var;
|
||||
--error ER_TOO_MANY_ROWS
|
||||
analyze select a from t1 into @var;
|
||||
|
||||
analyze insert into t1 select * from t1;
|
||||
|
||||
analyze select * into outfile '../../tmp/data1.tmp' from t1;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
|
||||
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user