diff options
author | unknown <msvensson@neptunus.(none)> | 2006-06-10 20:33:50 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-06-10 20:33:50 +0200 |
commit | d889c1a8bdaafa69787ea6cd300cb01dce61d8e0 (patch) | |
tree | a19132f98ae7c58aa6233f7efa53dcbe6b4d2cdc /mysql-test/t | |
parent | 9f9d7e0ae23e47b74b8d635ec0f1f7d1496d06b8 (diff) | |
parent | d7b474e1e673b120d8aebc295f29a7dbd215b79c (diff) | |
download | mariadb-git-d889c1a8bdaafa69787ea6cd300cb01dce61d8e0.tar.gz |
Merge bk-internal:/home/bk/mysql-5.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
BUILD/compile-dist:
Auto merged
client/mysqltest.c:
Auto merged
config/ac-macros/ssl.m4:
Auto merged
include/config-win.h:
Auto merged
include/my_base.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/group_min_max.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/rpl_insert_id_pk.result:
Auto merged
mysql-test/r/rpl_ndb_multi_update3.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/r/rpl_ndb_sp006.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysys/my_clock.c:
Auto merged
mysys/my_copy.c:
Auto merged
mysys/my_create.c:
Auto merged
mysys/my_dup.c:
Auto merged
mysys/my_lib.c:
Auto merged
mysys/my_open.c:
Auto merged
mysys/my_redel.c:
Auto merged
mysql-test/r/create.result:
Manual merge
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/r/join_outer.result:
Manual merge
mysql-test/t/func_group.test:
Manual merge
mysql-test/t/group_min_max.test:
Manual merge
mysql-test/t/innodb_mysql.test:
Manual merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/create.test | 7 | ||||
-rw-r--r-- | mysql-test/t/func_group.test | 21 | ||||
-rw-r--r-- | mysql-test/t/func_group_innodb.test | 85 | ||||
-rw-r--r-- | mysql-test/t/group_min_max.test | 25 | ||||
-rw-r--r-- | mysql-test/t/group_min_max_innodb.test | 95 | ||||
-rw-r--r-- | mysql-test/t/innodb_mysql.test | 8 | ||||
-rw-r--r-- | mysql-test/t/join_outer.test | 18 | ||||
-rw-r--r-- | mysql-test/t/join_outer_innodb.test | 26 | ||||
-rw-r--r-- | mysql-test/t/ndb_cache_multi.test | 7 | ||||
-rw-r--r-- | mysql-test/t/partition.test | 8 | ||||
-rw-r--r-- | mysql-test/t/partition_innodb.test | 9 | ||||
-rw-r--r-- | mysql-test/t/rpl_drop_db.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl_stm_no_op.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl_variables.test | 3 | ||||
-rw-r--r-- | mysql-test/t/sp-security.test | 23 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 17 | ||||
-rw-r--r-- | mysql-test/t/sp_trans.test | 39 |
17 files changed, 318 insertions, 79 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index e4a7d1cd9af..b4ba3878580 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -670,13 +670,6 @@ alter table t1 max_rows=100000000000; show create table t1; drop table t1; -# -# Bug#17530: Incorrect key truncation on table creation caused server crash. -# -create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb - character set utf8 collate utf8_general_ci; -insert into t1 values('aaa'); -drop table t1; # End of 5.0 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index fb9470c16dd..eacc4fc6710 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -378,13 +378,15 @@ explain select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; drop table t1, t2; ---disable_warnings -create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB; ---enable_warnings -insert into t1 values (1, 3); -select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ; -select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ; -drop table t1; +# Moved to func_group_innodb +#--disable_warnings +#create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB; +#--enable_warnings +#insert into t1 values (1, 3); +#select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ; +#select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ; +#drop table t1; + create table t1 (a char(10)); insert into t1 values ('a'),('b'),('c'); @@ -539,6 +541,11 @@ INSERT INTO t1 VALUES SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; DROP TABLE t1; + +# +# Bug #12882 min/max inconsistent on empty table +# +# Test case moved to func_group_innodb # End of 4.1 tests # diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test new file mode 100644 index 00000000000..1bdfd8f54bb --- /dev/null +++ b/mysql-test/t/func_group_innodb.test @@ -0,0 +1,85 @@ +# +# Test of group functions that depend on innodb +# + +--source include/have_innodb.inc + +--disable_warnings +create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB; +--enable_warnings +insert into t1 values (1, 3); +select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ; +select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ; +drop table t1; + + +# +# Bug #12882 min/max inconsistent on empty table +# + +--disable_warnings +create table t1m (a int) engine=myisam; +create table t1i (a int) engine=innodb; +create table t2m (a int) engine=myisam; +create table t2i (a int) engine=innodb; +--enable_warnings +insert into t2m values (5); +insert into t2i values (5); + +# test with MyISAM +select min(a) from t1m; +select min(7) from t1m; +select min(7) from DUAL; +explain select min(7) from t2m join t1m; +select min(7) from t2m join t1m; + +select max(a) from t1m; +select max(7) from t1m; +select max(7) from DUAL; +explain select max(7) from t2m join t1m; +select max(7) from t2m join t1m; + +select 1, min(a) from t1m where a=99; +select 1, min(a) from t1m where 1=99; +select 1, min(1) from t1m where a=99; +select 1, min(1) from t1m where 1=99; + +select 1, max(a) from t1m where a=99; +select 1, max(a) from t1m where 1=99; +select 1, max(1) from t1m where a=99; +select 1, max(1) from t1m where 1=99; + +# test with InnoDB +select min(a) from t1i; +select min(7) from t1i; +select min(7) from DUAL; +explain select min(7) from t2i join t1i; +select min(7) from t2i join t1i; + +select max(a) from t1i; +select max(7) from t1i; +select max(7) from DUAL; +explain select max(7) from t2i join t1i; +select max(7) from t2i join t1i; + +select 1, min(a) from t1i where a=99; +select 1, min(a) from t1i where 1=99; +select 1, min(1) from t1i where a=99; +select 1, min(1) from t1i where 1=99; + +select 1, max(a) from t1i where a=99; +select 1, max(a) from t1i where 1=99; +select 1, max(1) from t1i where a=99; +select 1, max(1) from t1i where 1=99; + +# mixed MyISAM/InnoDB test +explain select count(*), min(7), max(7) from t1m, t1i; +select count(*), min(7), max(7) from t1m, t1i; + +explain select count(*), min(7), max(7) from t1m, t2i; +select count(*), min(7), max(7) from t1m, t2i; + +explain select count(*), min(7), max(7) from t2m, t1i; +select count(*), min(7), max(7) from t2m, t1i; + +drop table t1m, t1i, t2m, t2i; diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 874f3cd1a80..292b5cde77f 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -659,7 +659,30 @@ select a1 from t1 where a2 = 'b' group by a1; explain select distinct a1 from t1 where a2 = 'b'; select distinct a1 from t1 where a2 = 'b'; -drop table t1,t2,t3; +# +# Bug #12672: primary key implcitly included in every innodb index +# +# Test case moved to group_min_max_innodb + + +# +# Bug #6142: a problem with the empty innodb table +# +# Test case moved to group_min_max_innodb + + +# +# Bug #9798: group by with rollup +# +# Test case moved to group_min_max_innodb + + +# +# Bug #13293 Wrongly used index results in endless loop. +# +# Test case moved to group_min_max_innodb + + # # Bug #14920 Ordering aggregated result sets with composite primary keys # corrupts resultset diff --git a/mysql-test/t/group_min_max_innodb.test b/mysql-test/t/group_min_max_innodb.test new file mode 100644 index 00000000000..ea2a603a8a4 --- /dev/null +++ b/mysql-test/t/group_min_max_innodb.test @@ -0,0 +1,95 @@ +# +# Test file for WL#1724 (Min/Max Optimization for Queries with Group By Clause). +# The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT +# that depends on InnoDB +# + +--source include/have_innodb.inc + +# +# Bug #12672: primary key implcitly included in every innodb index +# + +--disable_warnings +create table t4 ( + pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' +) engine=innodb; +--enable_warnings + +insert into t4 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'), +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'); + +create index idx12672_0 on t4 (a1); +create index idx12672_1 on t4 (a1,a2,b,c); +create index idx12672_2 on t4 (a1,a2,b); +analyze table t4; + +select distinct a1 from t4 where pk_col not in (1,2,3,4); + +drop table t4; + + +# +# Bug #6142: a problem with the empty innodb table +# + +--disable_warnings +create table t1 ( + a varchar(30), b varchar(30), primary key(a), key(b) +) engine=innodb; +--enable_warnings +select distinct a from t1; +drop table t1; + +# +# Bug #9798: group by with rollup +# + +--disable_warnings +create table t1(a int, key(a)) engine=innodb; +--enable_warnings +insert into t1 values(1); +select a, count(a) from t1 group by a with rollup; +drop table t1; + + +# +# Bug #13293 Wrongly used index results in endless loop. +# +create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb; +insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d"); +alter table t1 drop primary key, add primary key (f2, f1); +explain select distinct f1 a, f1 b from t1; +explain select distinct f1, f2 from t1; +drop table t1; diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 0a9eeb049b0..bea2d3bc8e0 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -272,3 +272,11 @@ TRUNCATE table t2; INSERT INTO t2 select * from t1; SELECT * from t2; drop table t1,t2; + +# +# Bug#17530: Incorrect key truncation on table creation caused server crash. +# +create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb + character set utf8 collate utf8_general_ci; +insert into t1 values('aaa'); +drop table t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index dc4e240750c..3f82219fadb 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -761,24 +761,10 @@ DROP TABLE t1,t2; # # Test for bug #17164: ORed FALSE blocked conversion of outer join into join -# - -CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20), - INDEX (name)) ENGINE=InnoDB; -CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11), - FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B'); -INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3); - -EXPLAIN -SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id - WHERE t1.name LIKE 'A%'; +# -EXPLAIN -SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id - WHERE t1.name LIKE 'A%' OR FALSE; +# Test case moved to join_outer_innodb -DROP TABLE t1,t2; # # Bug 19396: LEFT OUTER JOIN over views in curly braces diff --git a/mysql-test/t/join_outer_innodb.test b/mysql-test/t/join_outer_innodb.test new file mode 100644 index 00000000000..40add7f488f --- /dev/null +++ b/mysql-test/t/join_outer_innodb.test @@ -0,0 +1,26 @@ +# +# test of left outer join for tests that depends on innodb +# + +--source include/have_innodb.inc + +# +# Test for bug #17164: ORed FALSE blocked conversion of outer join into join +# + +CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20), + INDEX (name)) ENGINE=InnoDB; +CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11), + FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B'); +INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3); + +EXPLAIN +SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id + WHERE t1.name LIKE 'A%'; + +EXPLAIN +SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id + WHERE t1.name LIKE 'A%' OR FALSE; + +DROP TABLE t1,t2; diff --git a/mysql-test/t/ndb_cache_multi.test b/mysql-test/t/ndb_cache_multi.test index beb8e4bc2ac..404393c211e 100644 --- a/mysql-test/t/ndb_cache_multi.test +++ b/mysql-test/t/ndb_cache_multi.test @@ -63,3 +63,10 @@ show status like "Qcache_hits"; drop table t1, t2; +# Turn off query cache on server1 +connection server1; +set GLOBAL query_cache_size=0; + +# Turn off query cache on server2 +connection server2; +set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index be4fc1081f3..90cd27ded55 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -770,13 +770,6 @@ alter table t1 rebuild partition; drop table t1; # -# Bug #14673: Wrong InnoDB default row format -# -create table t1 (a int) engine=innodb partition by hash(a) ; -show table status like 't1'; -drop table t1; - -# # Bug #14526: Partitions: indexed searches fail # create table t2 (s1 int not null auto_increment, primary key (s1)) partition by list (s1) (partition p1 values in (1),partition p2 values in (2),partition p3 values in (3),partition p4 values in (4)); @@ -866,6 +859,7 @@ delimiter ;| CALL test.p1(12); CALL test.p1(13); drop table t1; +drop procedure test.p1; # # Bug 13520: Problem with delimiters in COMMENT DATA DIRECTORY .. diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test new file mode 100644 index 00000000000..84c74855fbb --- /dev/null +++ b/mysql-test/t/partition_innodb.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc + +# +# Bug #14673: Wrong InnoDB default row format +# +create table t1 (a int) engine=innodb partition by hash(a) ; +show table status like 't1'; +drop table t1; + diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/t/rpl_drop_db.test index 38ad07f72f1..ffdc605b402 100644 --- a/mysql-test/t/rpl_drop_db.test +++ b/mysql-test/t/rpl_drop_db.test @@ -56,3 +56,7 @@ connection slave; stop slave; #system rm -rf $MYSQLTEST_VARDIR/master-data/mysqltest1; +connection master; +use test; +drop table t1; + diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/t/rpl_stm_no_op.test index d1e0b49abe9..f82bbd8cd55 100644 --- a/mysql-test/t/rpl_stm_no_op.test +++ b/mysql-test/t/rpl_stm_no_op.test @@ -89,5 +89,5 @@ select * from t2; # cleanup connection master; -drop table t1; +drop table t1, t2; sync_slave_with_master; diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/t/rpl_variables.test index 57ae2b9c3c4..b1744c57c9b 100644 --- a/mysql-test/t/rpl_variables.test +++ b/mysql-test/t/rpl_variables.test @@ -12,3 +12,6 @@ show variables like 'slave_load_tmpdir'; # We just set some arbitrary values in variables-master.opt so we can test # that a list of values works correctly show variables like 'slave_skip_errors'; + +# Cleanup +set global slave_net_timeout=default; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index a8c3c0a22eb..e791729fac4 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -527,29 +527,6 @@ drop database db_bug14533; # -# BUG#7787: Stored procedures: improper warning for "grant execute" statement -# - -# Prepare. - -CREATE DATABASE db_bug7787; -use db_bug7787; - -# Test. - -CREATE PROCEDURE p1() - SHOW INNODB STATUS; - -GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost; - -# Cleanup. - -DROP DATABASE db_bug7787; -drop user user_bug7787@localhost; -use test; - - -# # WL#2897: Complete definer support in the stored routines. # # The following cases are tested: diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 8f5fcdc9d52..885d76ff3f9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -5637,23 +5637,6 @@ drop table t3| drop procedure bug16887| # -# Bug#13575 SP funcs in select with distinct/group and order by can -# produce bad data -# -create table t3 (f1 int, f2 varchar(3), primary key(f1)) engine=innodb| -insert into t3 values (1,'aaa'),(2,'bbb'),(3,'ccc')| -CREATE FUNCTION bug13575 ( p1 integer ) -returns varchar(3) -BEGIN -DECLARE v1 VARCHAR(10) DEFAULT null; -SELECT f2 INTO v1 FROM t3 WHERE f1 = p1; -RETURN v1; -END| -select distinct f1, bug13575(f1) from t3 order by f1| -drop function bug13575; -drop table t3| - -# # BUG#16474: SP crashed MySQL # (when using "order by localvar", where 'localvar' is just that. # diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 1ea32316f1e..325e11b1ec9 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -552,6 +552,45 @@ drop table t3, t4| drop procedure bug14210| set @@session.max_heap_table_size=default| +# +# BUG#7787: Stored procedures: improper warning for "grant execute" statement +# + +# Prepare. + +CREATE DATABASE db_bug7787| +use db_bug7787| + +# Test. + +CREATE PROCEDURE p1() + SHOW INNODB STATUS; | + +GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| + +# Cleanup. + +DROP DATABASE db_bug7787| +drop user user_bug7787@localhost| +use test| + +# +# Bug#13575 SP funcs in select with distinct/group and order by can +# produce bad data +# +create table t3 (f1 int, f2 varchar(3), primary key(f1)) engine=innodb| +insert into t3 values (1,'aaa'),(2,'bbb'),(3,'ccc')| +CREATE FUNCTION bug13575 ( p1 integer ) +returns varchar(3) +BEGIN +DECLARE v1 VARCHAR(10) DEFAULT null; +SELECT f2 INTO v1 FROM t3 WHERE f1 = p1; +RETURN v1; +END| +select distinct f1, bug13575(f1) from t3 order by f1| +drop function bug13575| +drop table t3| + # # BUG#NNNN: New bug synopsis |