mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Lot's of clean-ups and fixes for 4.0.14.
include/my_global.h: CONFIG_SMP mysql-test/r/grant.result: Test cases for bug fixes mysql-test/r/insert_select.result: Test cases for bug fixes mysql-test/r/union.result: Test cases for bug fixes mysql-test/t/grant.test: Test cases for bug fixes mysql-test/t/insert_select.test: Test cases for bug fixes mysql-test/t/union.test: Test cases for bug fixes sql/sql_acl.cc: Fix for granting global privileges on db level sql/sql_parse.cc: Fix for INSERT... SELECT sql/sql_select.cc: removing a fix sql/sql_union.cc: P
This commit is contained in:
@ -106,3 +106,5 @@ delete from mysql.tables_priv where user='mysqltest_1';
|
||||
delete from mysql.columns_priv where user='mysqltest_1';
|
||||
flush privileges;
|
||||
drop table t1;
|
||||
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
||||
Wrong usage of DB GRANT and GLOBAL PRIVILEGES
|
||||
|
@ -80,3 +80,493 @@ Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
master-bin.001 79 Query 1 79 use test; insert into t1 select * from t2
|
||||
drop table t1, t2;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (a+2);
|
||||
insert into t1 values (a+3);
|
||||
insert into t1 values (4),(a+5);
|
||||
insert into t1 select * from t1;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
insert into t1 select * from t1 as t2;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
insert into t2 select * from t1 as t2;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
insert into t1 select t2.a from t1,t2;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
5
|
||||
drop table t1,t2;
|
||||
|
@ -96,6 +96,13 @@ a b
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
|
||||
a b
|
||||
1 a
|
||||
2 b
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
explain select a,b from t1 union all select a,b from t2;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
@ -259,3 +266,14 @@ uid rl g1 cid gg
|
||||
uid rl g1 cid gg
|
||||
1 NULL V1 NULL 1
|
||||
drop table t1,t2,t3,t4,t5,t6;
|
||||
CREATE TABLE t1 (a int not null, b char (10) not null);
|
||||
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||
create table t3 select a,b from t1 union select a,b from t2;
|
||||
create table t4 (select a,b from t1) union (select a,b from t2) limit 2;
|
||||
insert into t4 select a,b from t1 union select a,b from t2;
|
||||
insert into t3 (select a,b from t1) union (select a,b from t2) limit 2;
|
||||
select * from t3;
|
||||
select * from t4;
|
||||
drop table t1,t2,t3,t4;
|
||||
|
@ -72,3 +72,5 @@ delete from mysql.tables_priv where user='mysqltest_1';
|
||||
delete from mysql.columns_priv where user='mysqltest_1';
|
||||
flush privileges;
|
||||
drop table t1;
|
||||
--error 1054
|
||||
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
||||
|
@ -87,3 +87,19 @@ let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION
|
||||
show binlog events;
|
||||
drop table t1, t2;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (a+2);
|
||||
insert into t1 values (a+3);
|
||||
insert into t1 values (4),(a+5);
|
||||
insert into t1 select * from t1;
|
||||
select * from t1;
|
||||
insert into t1 select * from t1 as t2;
|
||||
select * from t1;
|
||||
insert into t2 select * from t1 as t2;
|
||||
select * from t1;
|
||||
insert into t1 select t2.a from t1,t2;
|
||||
select * from t1;
|
||||
drop table t1,t2;
|
||||
|
@ -23,6 +23,8 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
|
||||
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
|
||||
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
|
||||
select found_rows();
|
||||
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
|
||||
select found_rows();
|
||||
|
||||
#
|
||||
# Test some error conditions with UNION
|
||||
@ -157,3 +159,14 @@ SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left
|
||||
(SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t3.must IS NOT NULL AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test") UNION (SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test");
|
||||
|
||||
drop table t1,t2,t3,t4,t5,t6;
|
||||
CREATE TABLE t1 (a int not null, b char (10) not null);
|
||||
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||
create table t3 select a,b from t1 union select a,b from t2;
|
||||
create table t4 (select a,b from t1) union (select a,b from t2) limit 2;
|
||||
insert into t4 select a,b from t1 union select a,b from t2;
|
||||
insert into t3 (select a,b from t1) union (select a,b from t2) limit 2;
|
||||
select * from t3;
|
||||
select * from t4;
|
||||
drop table t1,t2,t3,t4;
|
||||
|
Reference in New Issue
Block a user