mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
cleunup() of count() and max()/min() added (BUG#2687)
This commit is contained in:
@@ -656,3 +656,31 @@ select stddev(2) from t1;
|
||||
stddev(2)
|
||||
NULL
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
prepare stmt1 from 'SELECT COUNT(*) FROM t1';
|
||||
execute stmt1;
|
||||
COUNT(*)
|
||||
2
|
||||
execute stmt1;
|
||||
COUNT(*)
|
||||
2
|
||||
execute stmt1;
|
||||
COUNT(*)
|
||||
2
|
||||
deallocate prepare stmt1;
|
||||
drop table t1;
|
||||
create table t1 (a int, primary key(a));
|
||||
insert into t1 values (1),(2);
|
||||
prepare stmt1 from 'SELECT max(a) FROM t1';
|
||||
execute stmt1;
|
||||
max(a)
|
||||
2
|
||||
execute stmt1;
|
||||
max(a)
|
||||
2
|
||||
execute stmt1;
|
||||
max(a)
|
||||
2
|
||||
deallocate prepare stmt1;
|
||||
drop table t1;
|
||||
|
@@ -396,3 +396,25 @@ create table t1 (a int);
|
||||
select variance(2) from t1;
|
||||
select stddev(2) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# cleunup() of optimized away count(*) and max/min
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
prepare stmt1 from 'SELECT COUNT(*) FROM t1';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int, primary key(a));
|
||||
insert into t1 values (1),(2);
|
||||
prepare stmt1 from 'SELECT max(a) FROM t1';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user