summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <mats@mysql.com>2006-06-01 11:53:27 +0200
committerunknown <mats@mysql.com>2006-06-01 11:53:27 +0200
commitddc25698262f3a1b9ebedd0e07a92b78fb736c90 (patch)
tree4d52734e028ebab6510c5185b289737375dafd9e /mysql-test/t
parent564a94da7b744442cb4721cd53cb2d6c28452e51 (diff)
downloadmariadb-git-ddc25698262f3a1b9ebedd0e07a92b78fb736c90.tar.gz
Bug#19066 (DELETE FROM inconsistency for NDB):
Under row-based replication, DELETE FROM will now always be replicated as individual row deletions, while TRUNCATE TABLE will always be replicated as a statement. mysql-test/extra/rpl_tests/rpl_ddl.test: Using --echo instead of SELECT to print message. mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change. mysql-test/r/federated.result: Result change. mysql-test/r/range.result: Result change. mysql-test/r/rpl_sp_effects.result: Result change. mysql-test/r/show_check.result: Result change. mysql-test/r/sp-error.result: Result change. mysql-test/r/sp.result: Result change. mysql-test/r/timezone2.result: Result change. mysql-test/r/trigger-grant.result: Result change. mysql-test/r/type_datetime.result: Result change. mysql-test/r/type_ranges.result: Result change. mysql-test/r/type_timestamp.result: Result change. mysql-test/r/view.result: Result change. mysql-test/t/archive.test: Test contain statements that only works for statement-based logging. mysql-test/t/disabled.def: Disabling test due to reported bug. mysql-test/t/federated.test: Adding ORDER BY clause to SELECT statements mysql-test/t/range.test: Adding ORDER BY clause to SELECT (sub-)statement mysql-test/t/rpl_sp_effects.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/show_check.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/sp-error.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/sp.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/timezone2.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/trigger-grant.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/type_datetime.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/type_ranges.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/type_timestamp.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/view.test: Adding ORDER BY clause to SELECT statement. sql/sql_class.h: Adding member function to set replication to statement-based. sql/sql_delete.cc: When row-based replication is used, DELETE FROM will always delete the contents of the table row-by-row and not use delete_all_rows(). mysql-test/extra/rpl_tests/rpl_truncate.test: New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate.test'' mysql-test/extra/rpl_tests/rpl_truncate_helper.inc: New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate_helper.inc'' mysql-test/r/rpl_truncate_2myisam.result: New BitKeeper file ``mysql-test/r/rpl_truncate_2myisam.result'' mysql-test/r/rpl_truncate_3innodb.result: New BitKeeper file ``mysql-test/r/rpl_truncate_3innodb.result'' mysql-test/r/rpl_truncate_7ndb.result: New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb.result'' mysql-test/t/rpl_truncate_2myisam.test: New BitKeeper file ``mysql-test/t/rpl_truncate_2myisam.test'' mysql-test/t/rpl_truncate_3innodb.test: New BitKeeper file ``mysql-test/t/rpl_truncate_3innodb.test'' mysql-test/t/rpl_truncate_7ndb.test: New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb.test''
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/archive.test1
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/federated.test6
-rw-r--r--mysql-test/t/range.test2
-rw-r--r--mysql-test/t/rpl_sp_effects.test4
-rw-r--r--mysql-test/t/rpl_truncate_2myisam.test4
-rw-r--r--mysql-test/t/rpl_truncate_3innodb.test5
-rw-r--r--mysql-test/t/rpl_truncate_7ndb.test64
-rw-r--r--mysql-test/t/show_check.test6
-rw-r--r--mysql-test/t/sp-error.test6
-rw-r--r--mysql-test/t/sp.test87
-rw-r--r--mysql-test/t/timezone2.test10
-rw-r--r--mysql-test/t/trigger-grant.test4
-rw-r--r--mysql-test/t/type_datetime.test2
-rw-r--r--mysql-test/t/type_ranges.test2
-rw-r--r--mysql-test/t/type_timestamp.test8
-rw-r--r--mysql-test/t/view.test10
17 files changed, 148 insertions, 74 deletions
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 7e091991475..f49c8f280f4 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -3,6 +3,7 @@
# Taken FROM the select test
#
-- source include/have_archive.inc
+-- source include/have_binlog_format_statement.inc
--disable_warnings
drop table if exists t1,t2;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 7cbe4419904..f355660d38e 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -35,6 +35,7 @@ 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_inexist_tbl : BUG#18948 2006-03-09 mats Disabled since patch makes this test wait forever
rpl_sp : BUG#16456 2006-02-16 jmiller
+rpl_sp_effects : BUG#19862 SELECT from view with ORDER BY...
udf : BUG#18564 2006-03-27 ian (Permission by Brian)
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 3c43fb1d1f9..3b26a556dc2 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -83,7 +83,7 @@ eval SHOW CREATE TABLE federated.t2;
INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
-SELECT * FROM federated.t2;
+SELECT * FROM federated.t2 ORDER BY id, name;
DROP TABLE federated.t2;
connection slave;
@@ -110,7 +110,7 @@ eval CREATE TABLE federated.t1 (
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
-SELECT * FROM federated.t1;
+SELECT * FROM federated.t1 ORDER BY id,name;
DELETE FROM federated.t1;
DROP TABLE IF EXISTS federated.t1;
@@ -125,7 +125,7 @@ eval CREATE TABLE federated.`t1%` (
INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo');
INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee');
-SELECT * FROM federated.`t1%`;
+SELECT * FROM federated.`t1%` ORDER BY id, name;
DELETE FROM federated.`t1%`;
DROP TABLE IF EXISTS federated.`t1%`;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index f6493bac244..d1ce1104322 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -370,7 +370,7 @@ insert into t2(uid, name) values
(25, CHAR(64+25)),
(26, CHAR(64+26));
-insert into t1(uid, name) select uid, name from t2;
+insert into t1(uid, name) select uid, name from t2 order by uid;
delete from t2;
insert into t2(id, uid, name) select id, uid, name from t1;
diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/t/rpl_sp_effects.test
index 40c9a5d0b74..e1746682b76 100644
--- a/mysql-test/t/rpl_sp_effects.test
+++ b/mysql-test/t/rpl_sp_effects.test
@@ -106,8 +106,8 @@ delete from t2;
# 4. VIEWs
delete from t1;
insert into t2 values(1),(2);
-create view v1 as select f1(a) from t2;
-select * from v1;
+create view v1 as select f1(a) as f from t2;
+select * from v1 order by f;
SELECT 'master:',a FROM t1 ORDER BY a;
sync_slave_with_master;
diff --git a/mysql-test/t/rpl_truncate_2myisam.test b/mysql-test/t/rpl_truncate_2myisam.test
new file mode 100644
index 00000000000..1a2cb1d0fb3
--- /dev/null
+++ b/mysql-test/t/rpl_truncate_2myisam.test
@@ -0,0 +1,4 @@
+
+let $engine=MyISAM;
+--source extra/rpl_tests/rpl_truncate.test
+
diff --git a/mysql-test/t/rpl_truncate_3innodb.test b/mysql-test/t/rpl_truncate_3innodb.test
new file mode 100644
index 00000000000..7f3145feb1b
--- /dev/null
+++ b/mysql-test/t/rpl_truncate_3innodb.test
@@ -0,0 +1,5 @@
+
+--source include/have_innodb.inc
+
+let $engine=InnoDB;
+--source extra/rpl_tests/rpl_truncate.test
diff --git a/mysql-test/t/rpl_truncate_7ndb.test b/mysql-test/t/rpl_truncate_7ndb.test
new file mode 100644
index 00000000000..7a8101cbf55
--- /dev/null
+++ b/mysql-test/t/rpl_truncate_7ndb.test
@@ -0,0 +1,64 @@
+
+--source include/have_ndb.inc
+--source include/master-slave.inc
+
+--disable_query_log
+--disable_warnings
+connection slave;
+STOP SLAVE;
+connection master;
+DROP TABLE IF EXISTS t1;
+RESET MASTER;
+connection slave;
+DROP TABLE IF EXISTS t1;
+RESET SLAVE;
+START SLAVE;
+--enable_warnings
+--enable_query_log
+
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+# Should be empty
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DROP TABLE t1;
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+# Should be empty
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DROP TABLE t1;
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index a7b24a5e06c..2f44f4e97c5 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -255,9 +255,9 @@ delete from t2 where b=3;
delete from t3 where a=3;
--replace_column 6 # 7 # 8 # 9 # 10 #
show table status;
-delete from t1;
-delete from t2;
-delete from t3;
+truncate table t1;
+truncate table t2;
+truncate table t3;
--replace_column 6 # 7 # 8 # 9 #
show table status;
insert into t1 values (5);
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index c9ce26b6dda..24b0d4674c5 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -508,7 +508,7 @@ end|
insert into t1 values (666, 51.3)|
--error 1054
call bug2272()|
-delete from t1|
+truncate table t1|
drop procedure bug2272|
#
@@ -742,7 +742,7 @@ begin
fetch c into v;
end|
-delete from t1|
+truncate table t1|
--error ER_SP_FETCH_NO_DATA
call bug7299()|
drop procedure bug7299|
@@ -871,7 +871,7 @@ insert into t1 value (2, 2.7), (3, 3.14), (7, 7.0)|
select *,bug8408() from t1|
drop function bug8408|
-delete from t1|
+truncate table t1|
#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 8ccd954eeea..6e4e403ccfb 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -143,7 +143,7 @@ begin
end|
call setcontext()|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure setcontext|
@@ -287,7 +287,7 @@ create procedure inc(inout io int)
set io = io + 1|
call iotest("io1", "io2", 1)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure iotest|
drop procedure inc2|
@@ -333,7 +333,7 @@ begin
end|
call cbv1()|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure cbv1|
drop procedure cbv2|
@@ -371,7 +371,7 @@ call sub1("sub1b", (select max(i) from t2))|
call sub1("sub1c", (select i,d from t2 limit 1))|
call sub1("sub1d", (select 1 from (select 1) a))|
call sub2("sub2")|
-select * from t1|
+select * from t1 order by id|
select sub3((select max(i) from t2))|
drop procedure sub1|
drop procedure sub2|
@@ -392,7 +392,7 @@ while x do
end while|
call a0(3)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure a0|
@@ -408,7 +408,7 @@ while x > 0 do
end while|
call a(3)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure a|
@@ -424,7 +424,7 @@ repeat
until x = 0 end repeat|
call b(3)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure b|
@@ -456,7 +456,7 @@ hmm: while x > 0 do
end while hmm|
call c(3)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure c|
@@ -493,7 +493,7 @@ foo: loop
end loop foo|
call e(3)|
-select * from t1|
+select * from t1 order by data desc|
delete from t1|
drop procedure e|
@@ -514,7 +514,7 @@ end if|
call f(-2)|
call f(0)|
call f(4)|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure f|
@@ -536,7 +536,7 @@ end case|
call g(-42)|
call g(0)|
call g(1)|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure g|
@@ -558,7 +558,7 @@ end case|
call h(0)|
call h(1)|
call h(17)|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure h|
@@ -592,7 +592,7 @@ drop procedure if exists sel1|
--enable_warnings
create procedure sel1()
begin
- select * from t1;
+ select * from t1 order by data;
end|
call sel1()|
@@ -603,8 +603,8 @@ drop procedure if exists sel2|
--enable_warnings
create procedure sel2()
begin
- select * from t1;
- select * from t2;
+ select * from t1 order by data;
+ select * from t2 order by s;
end|
call sel2()|
@@ -624,7 +624,7 @@ begin
end|
call into_test("into", 100)|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure into_test|
@@ -641,7 +641,7 @@ begin
end|
call into_test2("into", 100)|
-select id,data,@z from t1|
+select id,data,@z from t1 order by data|
delete from t1|
drop procedure into_test2|
@@ -819,9 +819,9 @@ insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))|
# Disable PS because double's give a bit different values
--disable_ps_protocol
select * from t2 where s = append("a", "b")|
-select * from t2 where i = mul(4,3) or i = mul(mul(3,4),2)|
+select * from t2 where i = mul(4,3) or i = mul(mul(3,4),2) order by i|
select * from t2 where d = e()|
-select * from t2|
+select * from t2 order by i|
--enable_ps_protocol
delete from t2|
@@ -976,8 +976,8 @@ drop procedure if exists cur2|
create procedure cur2()
begin
declare done int default 0;
- declare c1 cursor for select id,data from test.t1;
- declare c2 cursor for select i from test.t2;
+ declare c1 cursor for select id,data from test.t1 order by id,data;
+ declare c2 cursor for select i from test.t2 order by i;
declare continue handler for sqlstate '02000' set done = 1;
open c1;
@@ -1003,7 +1003,7 @@ begin
end|
call cur2()|
-select * from t3|
+select * from t3 order by i,s|
delete from t1|
delete from t2|
drop table t3|
@@ -1178,13 +1178,13 @@ create function f1() returns int
return (select sum(data) from t1)|
select f1()|
# This should work too (and give 2 rows as result)
-select id, f1() from t1|
+select id, f1() from t1 order by id|
# Function which uses two instances of table simultaneously
create function f2() returns int
- return (select data from t1 where data <= (select sum(data) from t1) limit 1)|
+ return (select data from t1 where data <= (select sum(data) from t1) order by data limit 1)|
select f2()|
-select id, f2() from t1|
+select id, f2() from t1 order by id|
# Function which uses the same table twice in different queries
create function f3() returns int
@@ -1196,17 +1196,17 @@ begin
return n < m;
end|
select f3()|
-select id, f3() from t1|
+select id, f3() from t1 order by id|
# Calling two functions using same table
select f1(), f3()|
-select id, f1(), f3() from t1|
+select id, f1(), f3() from t1 order by id|
# Function which uses two different tables
create function f4() returns double
return (select d from t1, t2 where t1.data = t2.i and t1.id= "b")|
select f4()|
-select s, f4() from t2|
+select s, f4() from t2 order by s|
# Recursive functions which due to this recursion require simultaneous
# access to several instance of the same table won't work
@@ -1239,7 +1239,7 @@ end|
create function f7() returns int
return (select sum(data) from t1 where data <= f1())|
select f6()|
-select id, f6() from t1|
+select id, f6() from t1 order by id|
#
# Let us test how new locking work with views
@@ -1247,12 +1247,12 @@ select id, f6() from t1|
# The most trivial view
create view v1 (a) as select f1()|
select * from v1|
-select id, a from t1, v1|
+select id, a from t1, v1 order by id|
select * from v1, v1 as v|
# A bit more complex construction
create view v2 (a) as select a*10 from v1|
select * from v2|
-select id, a from t1, v2|
+select id, a from t1, v2 order by id|
select * from v1, v2|
# Nice example where the same view is used on
@@ -1297,7 +1297,7 @@ select *, f0() from v0|
lock tables t1 read, t1 as t11 read|
# These should work well
select f3()|
-select id, f3() from t1 as t11|
+select id, f3() from t1 as t11 order by id|
# Degenerate cases work too :)
select f0()|
select * from v0|
@@ -1407,8 +1407,8 @@ drop function f12_2|
drop view v0|
drop view v1|
drop view v2|
-delete from t1 |
-delete from t2 |
+truncate table t1 |
+truncate table t2 |
drop table t4|
# End of non-bug tests
@@ -1596,7 +1596,7 @@ call fib(3)|
select * from t3 order by f asc|
-delete from t3|
+truncate table t3|
# The original test, 20 levels, ran into memory limits on some machines
# and builds. Try 10 instead...
@@ -1693,7 +1693,6 @@ begin
end if;
return x;
end|
-
select * from t1 where data = getcount("bar")|
select * from t3|
select getcount("zip")|
@@ -2120,7 +2119,7 @@ delete from t1|
call bug822('foo', 42)|
call bug822('foo', 42)|
call bug822('bar', 666)|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure bug822|
@@ -2148,7 +2147,7 @@ delete from t1 where id='foo'|
insert into t1 values ('bar', 7)|
call bug1495()|
delete from t1 where id='bar'|
-select * from t1|
+select * from t1 order by data|
delete from t1|
drop procedure bug1495|
@@ -2173,7 +2172,7 @@ end|
insert into t1 values ("foo", 12), ("bar", 7)|
call bug1547("foo")|
call bug1547("bar")|
-select * from t1|
+select * from t1 order by id|
delete from t1|
drop procedure bug1547|
@@ -2240,7 +2239,7 @@ end|
insert into t1 (data) values (3), (1), (5), (9), (4)|
call bug1874()|
-select * from t2|
+select * from t2 order by i|
delete from t1|
delete from t2|
drop procedure bug1874|
@@ -5260,7 +5259,7 @@ call bug13012()|
call bug13012()|
drop procedure bug13012|
drop view v1;
-select * from t1|
+select * from t1 order by data|
#
# A test case for Bug#15392 "Server crashes during prepared statement
@@ -5669,7 +5668,7 @@ create procedure bug16474_1()
begin
declare x int;
- select id from t1 order by x;
+ select id from t1 order by x, id;
end|
#
@@ -5689,7 +5688,7 @@ drop procedure bug14945|
# This does NOT order by column index; variable is an expression.
create procedure bug16474_2(x int)
- select id from t1 order by x|
+ select id from t1 order by x, id|
call bug16474_1()|
call bug16474_2(1)|
@@ -5699,7 +5698,7 @@ drop procedure bug16474_2|
# For reference: user variables are expressions too and do not affect ordering.
set @x = 2|
-select * from t1 order by @x|
+select * from t1 order by @x, data|
delete from t1|
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
index bfc909d6995..bad1df554d9 100644
--- a/mysql-test/t/timezone2.test
+++ b/mysql-test/t/timezone2.test
@@ -69,7 +69,7 @@ set time_zone='UTC';
select * from t1;
-delete from t1;
+truncate table t1;
# Simple check for 'Europe/Moscow' time zone just for showing that it works
set time_zone='Europe/Moscow';
@@ -79,7 +79,7 @@ insert into t1 (i, ts) values
(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'),
(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00');
select * from t1;
-delete from t1;
+truncate table t1;
#
@@ -94,7 +94,7 @@ insert into t1 (i, ts) values
(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'),
(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00');
select * from t1;
-delete from t1;
+truncate table t1;
# Let us test leap jump
insert into t1 (i, ts) values
(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
@@ -115,14 +115,14 @@ insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'),
('1970-01-01 00:00:00'),('1970-01-01 00:00:01'),
('2037-12-31 23:59:59'),('2038-01-01 00:00:00');
select * from t1;
-delete from t1;
+truncate table t1;
# MET time zone has range shifted by one hour
set time_zone='MET';
insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'),
('1970-01-01 01:00:00'),('1970-01-01 01:00:01'),
('2038-01-01 00:59:59'),('2038-01-01 01:00:00');
select * from t1;
-delete from t1;
+truncate table t1;
# same for +01:30 time zone
set time_zone='+01:30';
insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'),
diff --git a/mysql-test/t/trigger-grant.test b/mysql-test/t/trigger-grant.test
index 67aec1496dd..55dc3be7835 100644
--- a/mysql-test/t/trigger-grant.test
+++ b/mysql-test/t/trigger-grant.test
@@ -151,8 +151,8 @@ INSERT INTO t1 VALUES(0);
# Cleanup for further tests.
DROP TRIGGER trg1;
-DELETE FROM t1;
-DELETE FROM t2;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
--disconnect wl2818_definer_con
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 4b6741b4242..f8953686c89 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -98,7 +98,7 @@ insert into t1 values
select * from t1;
delete from t1;
insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
-select * from t1;
+select * from t1 order by t;
drop table t1;
#
diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test
index 03ee91f14d8..4a897c1e440 100644
--- a/mysql-test/t/type_ranges.test
+++ b/mysql-test/t/type_ranges.test
@@ -162,7 +162,7 @@ select t1.id as id_A, t2.id as id_B from t1 left join t2 on (t1.id = t2.id);
create table t3 (id_A integer unsigned not null, id_B integer unsigned null );
insert into t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id );
select * from t3;
-delete from t3;
+truncate table t3;
insert into t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 on (t1.id = t2.id);
select * from t3;
drop table t3;
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index f96beedbebc..9b09421dd1f 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -41,7 +41,7 @@ drop table t1;
create table t1 (ix timestamp);
insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
select ix+0 from t1;
-delete from t1;
+truncate table t1;
insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000");
select ix+0 from t1;
drop table t1;
@@ -82,10 +82,10 @@ drop table t1;
create table t1 (ix timestamp);
insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
select ix+0 from t1;
-delete from t1;
+truncate table t1;
insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000");
select ix+0 from t1;
-delete from t1;
+truncate table t1;
insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
select ix+0 from t1;
drop table t1;
@@ -186,7 +186,7 @@ insert into t1 (t1) values (default);
select * from t1;
show create table t1;
show columns from t1;
-delete from t1;
+truncate table t1;
#
# Let us test some cases when auto-set should be disabled or influence
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 6094382c094..0b07057a749 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1035,18 +1035,18 @@ create table t2 (a int);
insert into t2 values (2),(3),(0);
# INSERT SELECT with ignore test
insert ignore into v1 SELECT a from t2;
-select * from t1;
+select * from t1 order by a desc;
#simple UPDATE test
update v1 set a=-1 where a=0;
-- error 1369
update v1 set a=2 where a=1;
-select * from t1;
+select * from t1 order by a desc;
# prepare data for next check
update v1 set a=0 where a=0;
insert into t2 values (1);
# multiupdate test
update v1,t2 set v1.a=v1.a-1 where v1.a=t2.a;
-select * from t1;
+select * from t1 order by a desc;
# prepare data for next check
update v1 set a=a+1;
# multiupdate with ignore test
@@ -1226,8 +1226,8 @@ select * from t1;
select * from v1;
delete from t1;
load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
-select * from t1;
-select * from v1;
+select * from t1 order by a,b;
+select * from v1 order by a,b;
drop view v1;
drop table t1;
# variable length fields