mirror of
https://github.com/MariaDB/server.git
synced 2025-11-09 11:41:36 +03:00
Merge mysql.com:/home/mydev/mysql-5.1--main
into mysql.com:/home/mydev/mysql-5.1-amerge
This commit is contained in:
@@ -61,6 +61,7 @@ prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# bug#15225 (ANALYZE temporary has no effect)
|
||||
|
||||
@@ -226,6 +226,7 @@ drop table t1;
|
||||
# Test create table if not exists with duplicate key error
|
||||
#
|
||||
|
||||
flush status;
|
||||
create table t1 (a int not null, b int, primary key (a));
|
||||
insert into t1 values (1,1);
|
||||
create table if not exists t1 select 2;
|
||||
@@ -233,6 +234,8 @@ select * from t1;
|
||||
create table if not exists t1 select 3 as 'a',4 as 'b';
|
||||
--error 1062
|
||||
create table if not exists t1 select 3 as 'a',3 as 'b';
|
||||
show warnings;
|
||||
show status like "Opened_tables";
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
@@ -676,3 +679,37 @@ insert into t1 values('aaa');
|
||||
drop table t1;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
||||
#
|
||||
# Test of behaviour with CREATE ... SELECT
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
--error 1062
|
||||
CREATE TABLE t2 (primary key (a)) select * from t1;
|
||||
# This should give warning
|
||||
drop table if exists t2;
|
||||
--error 1062
|
||||
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
|
||||
# This should give warning
|
||||
drop table if exists t2;
|
||||
CREATE TABLE t2 (a int, b int, primary key (a));
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error 1062
|
||||
INSERT INTO t2 select * from t1;
|
||||
SELECT * from t2;
|
||||
drop table t2;
|
||||
|
||||
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
|
||||
--error 1062
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error 1062
|
||||
INSERT INTO t2 select * from t1;
|
||||
SELECT * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#events_stress : BUG#17619 2006-02-21 andrey Race conditions
|
||||
#events : BUG#17619 2006-02-21 andrey Race conditions
|
||||
#events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked.
|
||||
im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
|
||||
im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
|
||||
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
|
||||
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
|
||||
#ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown
|
||||
@@ -22,17 +24,17 @@ ndb_load : BUG#17233 2006-05-04 tomas failed load data from infi
|
||||
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
|
||||
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
|
||||
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
|
||||
rpl_ndb_2myisam : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
|
||||
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
|
||||
rpl_ndb_auto_inc : BUG#17086 2006-02-16 jmiller CR: auto_increment_increment and auto_increment_offset produce duplicate key er
|
||||
#rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
|
||||
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
|
||||
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
|
||||
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
#rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
|
||||
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
|
||||
rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
|
||||
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
|
||||
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
|
||||
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
|
||||
rpl_row_inexist_tbl : BUG#18948 2006-03-09 mats Disabled since patch makes this test wait forever
|
||||
rpl_sp : BUG#16456 2006-02-16 jmiller
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@ CREATE TABLE table_3(a int);
|
||||
CREATE TABLE table_4(a int);
|
||||
CREATE TABLE T19170(s1 TIMESTAMP);
|
||||
SET GLOBAL event_scheduler=1;
|
||||
CREATE EVENT E19170 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
|
||||
# We need to have 2 to make it safe with valgrind. This is probably because
|
||||
# of when we calculate the timestamp value
|
||||
CREATE EVENT E19170 ON SCHEDULE EVERY 2 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
|
||||
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
|
||||
CREATE EVENT start_n_end
|
||||
ON SCHEDULE EVERY 1 SECOND
|
||||
|
||||
@@ -15,9 +15,9 @@ explain select * from t1 ignore key (str) where str="foo";
|
||||
explain select * from t1 use key (str,str) where str="foo";
|
||||
|
||||
#The following should give errors
|
||||
--error 1072
|
||||
--error 1176
|
||||
explain select * from t1 use key (str,str,foo) where str="foo";
|
||||
--error 1072
|
||||
--error 1176
|
||||
explain select * from t1 ignore key (str,str,foo) where str="foo";
|
||||
drop table t1;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
source include/federated.inc;
|
||||
--source include/not_embedded.inc
|
||||
--source include/federated.inc
|
||||
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
@@ -1310,6 +1310,57 @@ select * from federated.t1 where fld_parentid=0 and fld_delt=0;
|
||||
DROP TABLE federated.t1;
|
||||
connection slave;
|
||||
DROP TABLE federated.bug_17377_table;
|
||||
DROP TABLE federated.t1;
|
||||
|
||||
#
|
||||
# Test multi updates and deletes without keys
|
||||
#
|
||||
|
||||
source include/federated_cleanup.inc;
|
||||
# The following can be enabled when bug #19773 has been fixed
|
||||
--disable_parsing
|
||||
connection slave;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int);
|
||||
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20));
|
||||
connection master;
|
||||
eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
|
||||
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
|
||||
insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2;
|
||||
update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2 order by id;
|
||||
delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2 order by id;
|
||||
drop table federated.t1, federated.t2;
|
||||
connection slave;
|
||||
drop table federated.t1, federated.t2;
|
||||
connection master;
|
||||
|
||||
# Test multi updates and deletes with keys
|
||||
|
||||
connection slave;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1));
|
||||
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id));
|
||||
connection master;
|
||||
eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
|
||||
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
|
||||
insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2 order by id;
|
||||
update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2 order by id;
|
||||
delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
|
||||
select * from federated.t1 order by i1;
|
||||
select * from federated.t2 order by id;
|
||||
drop table federated.t1, federated.t2;
|
||||
connection slave;
|
||||
drop table federated.t1, federated.t2;
|
||||
connection master;
|
||||
--enable_parsing
|
||||
|
||||
--source include/federated_cleanup.inc
|
||||
|
||||
@@ -176,8 +176,8 @@ select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5)
|
||||
select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1;
|
||||
|
||||
# The following returns random results as we are sorting on blob addresses
|
||||
# select group_concat(c order by (select group_concat(c order by a) from t2 where t2.a=t1.a)) as grp from t1;
|
||||
# select group_concat(c order by (select group_concat(c) from t2 where a=t1.a)) as grp from t1;
|
||||
select group_concat(c order by (select concat(5-t1.c,group_concat(c order by a)) from t2 where t2.a=t1.a)) as grp from t1;
|
||||
select group_concat(c order by (select concat(t1.c,group_concat(c)) from t2 where a=t1.a)) as grp from t1;
|
||||
|
||||
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
|
||||
drop table t1,t2;
|
||||
|
||||
@@ -385,6 +385,7 @@ select time_format('100:00:00', '%H %k %h %I %l');
|
||||
create table t1 (a timestamp default '2005-05-05 01:01:01',
|
||||
b timestamp default '2005-05-05 01:01:01');
|
||||
delimiter //;
|
||||
drop function if exists t_slow_sysdate;
|
||||
create function t_slow_sysdate() returns timestamp
|
||||
begin
|
||||
do sleep(2);
|
||||
|
||||
@@ -490,6 +490,7 @@ insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_gr
|
||||
flush privileges;
|
||||
delete from tables_priv where host = '' and user = 'mysqltest_1';
|
||||
flush privileges;
|
||||
use test;
|
||||
|
||||
#
|
||||
# Bug #10892 user variables not auto cast for comparisons
|
||||
@@ -518,7 +519,6 @@ create user mysqltest_7@;
|
||||
set password for mysqltest_7@ = password('systpass');
|
||||
show grants for mysqltest_7@;
|
||||
drop user mysqltest_7@;
|
||||
flush privileges; # BUG#16297(flush should be removed when that bug is fixed)
|
||||
--error 1141
|
||||
show grants for mysqltest_7@;
|
||||
|
||||
@@ -539,3 +539,145 @@ flush privileges;
|
||||
drop database mysqltest;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug #16297 In memory grant tables not flushed when users's hostname is ""
|
||||
#
|
||||
use test;
|
||||
create table t1 (a int);
|
||||
|
||||
# Backup anonymous users and remove them. (They get in the way of
|
||||
# the one we test with here otherwise.)
|
||||
create table t2 as select * from mysql.user where user='';
|
||||
delete from mysql.user where user='';
|
||||
flush privileges;
|
||||
|
||||
# Create some users with different hostnames
|
||||
create user mysqltest_8@'';
|
||||
create user mysqltest_8;
|
||||
create user mysqltest_8@host8;
|
||||
|
||||
# Try to create them again
|
||||
--error 1396
|
||||
create user mysqltest_8@'';
|
||||
--error 1396
|
||||
create user mysqltest_8;
|
||||
--error 1396
|
||||
create user mysqltest_8@host8;
|
||||
|
||||
select user, QUOTE(host) from mysql.user where user="mysqltest_8";
|
||||
|
||||
--echo Schema privileges
|
||||
grant select on mysqltest.* to mysqltest_8@'';
|
||||
show grants for mysqltest_8@'';
|
||||
grant select on mysqltest.* to mysqltest_8@;
|
||||
show grants for mysqltest_8@;
|
||||
grant select on mysqltest.* to mysqltest_8;
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.schema_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
connect (conn3,localhost,mysqltest_8,,);
|
||||
select * from t1;
|
||||
disconnect conn3;
|
||||
connection master;
|
||||
revoke select on mysqltest.* from mysqltest_8@'';
|
||||
revoke select on mysqltest.* from mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.schema_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8@;
|
||||
grant select on mysqltest.* to mysqltest_8@'';
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@;
|
||||
revoke select on mysqltest.* from mysqltest_8@'';
|
||||
flush privileges;
|
||||
|
||||
--echo Column privileges
|
||||
grant update (a) on t1 to mysqltest_8@'';
|
||||
grant update (a) on t1 to mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.column_privileges;
|
||||
connect (conn4,localhost,mysqltest_8,,);
|
||||
select * from t1;
|
||||
disconnect conn4;
|
||||
connection master;
|
||||
revoke update (a) on t1 from mysqltest_8@'';
|
||||
revoke update (a) on t1 from mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.column_privileges;
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
|
||||
--echo Table privileges
|
||||
grant update on t1 to mysqltest_8@'';
|
||||
grant update on t1 to mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.table_privileges;
|
||||
connect (conn5,localhost,mysqltest_8,,);
|
||||
select * from t1;
|
||||
disconnect conn5;
|
||||
connection master;
|
||||
revoke update on t1 from mysqltest_8@'';
|
||||
revoke update on t1 from mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.table_privileges;
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
|
||||
--echo "DROP USER" should clear privileges
|
||||
grant all privileges on mysqltest.* to mysqltest_8@'';
|
||||
grant select on mysqltest.* to mysqltest_8@'';
|
||||
grant update on t1 to mysqltest_8@'';
|
||||
grant update (a) on t1 to mysqltest_8@'';
|
||||
grant all privileges on mysqltest.* to mysqltest_8;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.user_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
connect (conn5,localhost,mysqltest_8,,);
|
||||
select * from t1;
|
||||
disconnect conn5;
|
||||
connection master;
|
||||
flush privileges;
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
drop user mysqltest_8@'';
|
||||
--error 1141
|
||||
show grants for mysqltest_8@'';
|
||||
show grants for mysqltest_8;
|
||||
select * from information_schema.user_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
drop user mysqltest_8;
|
||||
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
||||
--error 1045
|
||||
connect (conn6,localhost,mysqltest_8,,);
|
||||
connection master;
|
||||
--error 1141
|
||||
show grants for mysqltest_8;
|
||||
drop user mysqltest_8@host8;
|
||||
--error 1141
|
||||
show grants for mysqltest_8@host8;
|
||||
|
||||
# Restore the anonymous users.
|
||||
insert into mysql.user select * from t2;
|
||||
flush privileges;
|
||||
drop table t2;
|
||||
|
||||
drop table t1;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
|
||||
--enable_warnings
|
||||
|
||||
# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
|
||||
@@ -223,3 +223,52 @@ explain select distinct f1 a, f1 b from t1;
|
||||
explain select distinct f1, f2 from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# Test of behaviour with CREATE ... SELECT
|
||||
#
|
||||
|
||||
set storage_engine=innodb;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
--error 1062
|
||||
CREATE TABLE t2 (primary key (a)) select * from t1;
|
||||
# This should give warning
|
||||
drop table if exists t2;
|
||||
--error 1062
|
||||
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
|
||||
# This should give warning
|
||||
drop table if exists t2;
|
||||
CREATE TABLE t2 (a int, b int, primary key (a));
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(100,100);
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
ROLLBACK;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error 1062
|
||||
INSERT INTO t2 select * from t1;
|
||||
SELECT * from t2;
|
||||
drop table t2;
|
||||
|
||||
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(100,100);
|
||||
--error 1062
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(101,101);
|
||||
--error 1062
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
ROLLBACK;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error 1062
|
||||
INSERT INTO t2 select * from t1;
|
||||
SELECT * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
@@ -9,8 +9,8 @@ drop table if exists t1,t2,t3;
|
||||
create table t1 (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 values (a+3),(a+4);
|
||||
insert into t1 values (5),(a+6);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
@@ -176,3 +176,28 @@ insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 =
|
||||
select count(*) from t2;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Test different cases of duplicate fields
|
||||
#
|
||||
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 (a,b) values (a,b);
|
||||
insert into t1 SET a=1, b=a+1;
|
||||
insert into t1 (a,b) select 1,2;
|
||||
INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
|
||||
prepare stmt1 from ' replace into t1 (a,a) select 100, ''hundred'' ';
|
||||
--error 1110
|
||||
execute stmt1;
|
||||
--error 1110
|
||||
insert into t1 (a,b,b) values (1,1,1);
|
||||
--error 1136
|
||||
insert into t1 (a,a) values (1,1,1);
|
||||
--error 1110
|
||||
insert into t1 (a,a) values (1,1);
|
||||
--error 1110
|
||||
insert into t1 SET a=1,b=2,a=1;
|
||||
--error 1110
|
||||
insert into t1 (b,b) select 1,2;
|
||||
--error 1110
|
||||
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
|
||||
drop table t1;
|
||||
|
||||
@@ -92,6 +92,10 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
|
||||
select * from t1;
|
||||
select @a, @b;
|
||||
truncate table t1;
|
||||
# Reading of all columns with set
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
|
||||
select * from t1;
|
||||
truncate table t1;
|
||||
# now going to test fixed field-row file format
|
||||
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
|
||||
select * from t1;
|
||||
|
||||
@@ -532,3 +532,33 @@ select * from t1;
|
||||
select * from t2;
|
||||
drop view v1;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Test multi updates and deletes using primary key and without.
|
||||
#
|
||||
create table t1 (i1 int, i2 int, i3 int);
|
||||
create table t2 (id int, c1 varchar(20), c2 varchar(20));
|
||||
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
|
||||
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
|
||||
select * from t1 order by i1;
|
||||
select * from t2;
|
||||
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
|
||||
select * from t1 order by i1;
|
||||
select * from t2 order by id;
|
||||
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
|
||||
select * from t1 order by i1;
|
||||
select * from t2 order by id;
|
||||
drop table t1, t2;
|
||||
create table t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1));
|
||||
create table t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id));
|
||||
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
|
||||
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
|
||||
select * from t1 order by i1;
|
||||
select * from t2 order by id;
|
||||
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
|
||||
select * from t1 order by i1;
|
||||
select * from t2 order by id;
|
||||
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
|
||||
select * from t1 order by i1;
|
||||
select * from t2 order by id;
|
||||
drop table t1, t2;
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
# depends on the presence of the log tables (which are CSV-based).
|
||||
--source include/have_csv.inc
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists client_test_db;
|
||||
--enable_warnings
|
||||
|
||||
DROP SCHEMA test;
|
||||
CREATE SCHEMA test;
|
||||
#
|
||||
|
||||
@@ -610,7 +610,7 @@ drop database db1;
|
||||
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
|
||||
#
|
||||
|
||||
--exec $MYSQL_MY_PRINT_DEFAULTS --defaults-extra-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
|
||||
--exec $MYSQL_MY_PRINT_DEFAULTS --defaults-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -14,6 +14,19 @@ partition by key(a)
|
||||
(partition p0 engine = MEMORY);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG 19067 ALTER TABLE .. ADD PARTITION for subpartitioned table crashes
|
||||
#
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
subpartition by key (a)
|
||||
(partition p0 values less than (1));
|
||||
alter table t1 add partition (partition p1 values less than (2));
|
||||
show create table t1;
|
||||
alter table t1 reorganize partition p1 into (partition p1 values less than (3));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Partition by key no partition defined => OK
|
||||
#
|
||||
|
||||
@@ -1145,5 +1145,5 @@ prepare stmt from "analyze table t4, t1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
# End of 5.0 tests
|
||||
|
||||
@@ -321,13 +321,15 @@ execute stmt4;
|
||||
prepare stmt4 from ' show variables like ''sql_mode'' ';
|
||||
execute stmt4;
|
||||
prepare stmt4 from ' show engine bdb logs ';
|
||||
# The output depends on the history (actions of the bdb engine).
|
||||
# The output depends on the bdb being enabled and on the history
|
||||
# history (actions of the bdb engine).
|
||||
# That is the reason why, we switch the output here off.
|
||||
# (The real output will be tested in ps_6bdb.test)
|
||||
# --replace_result $MYSQL_TEST_DIR TEST_DIR
|
||||
--disable_warnings
|
||||
--disable_result_log
|
||||
execute stmt4;
|
||||
--enable_result_log
|
||||
--enable_warnings
|
||||
prepare stmt4 from ' show grants for user ';
|
||||
--error 1295
|
||||
prepare stmt4 from ' show create table t2 ';
|
||||
|
||||
@@ -1 +1 @@
|
||||
--default-storage-engine=ndb --binlog-format=row
|
||||
--default-storage-engine=ndbcluster
|
||||
|
||||
@@ -1 +1 @@
|
||||
--innodb --default-storage-engine=innodb --binlog-format=row
|
||||
--innodb --default-storage-engine=innodb
|
||||
|
||||
@@ -1 +1 @@
|
||||
--default-storage-engine=ndb --binlog-format=row
|
||||
--default-storage-engine=ndbcluster
|
||||
|
||||
@@ -1 +1 @@
|
||||
--default-storage-engine=myisam --binlog-format=row
|
||||
--default-storage-engine=myisam
|
||||
|
||||
@@ -1 +1 @@
|
||||
--innodb --binlog-format=row
|
||||
--innodb
|
||||
|
||||
@@ -1 +1 @@
|
||||
--binlog-format=row --default-storage-engine=ndbcluster
|
||||
--default-storage-engine=ndbcluster
|
||||
|
||||
@@ -1 +1 @@
|
||||
--default-storage-engine=ndbcluster --binlog-format=row
|
||||
--default-storage-engine=ndbcluster
|
||||
|
||||
@@ -1296,9 +1296,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
|
||||
# The next should give an error
|
||||
#
|
||||
|
||||
-- error 1072
|
||||
--error 1176
|
||||
explain select fld3 from t2 ignore index (fld3,not_used);
|
||||
-- error 1072
|
||||
--error 1176
|
||||
explain select fld3 from t2 use index (not_used);
|
||||
|
||||
#
|
||||
|
||||
@@ -516,7 +516,7 @@ drop table t1;
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
create view v1 as select a, sum(b) from t1 group by a;
|
||||
-- error 1072
|
||||
--error 1176
|
||||
select b from v1 use index (some_index) where b=1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest;
|
||||
drop view if exists v1;
|
||||
drop view if exists v1,v2,v3;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user