summaryrefslogtreecommitdiff
path: root/mysql-test/suite/pbxt/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/pbxt/t')
-rw-r--r--mysql-test/suite/pbxt/t/grant_cache.test13
-rw-r--r--mysql-test/suite/pbxt/t/join.test2
-rw-r--r--mysql-test/suite/pbxt/t/lock_multi.test35
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_xa_binlog.test32
-rw-r--r--mysql-test/suite/pbxt/t/range.test3
-rw-r--r--mysql-test/suite/pbxt/t/select.test3
-rw-r--r--mysql-test/suite/pbxt/t/subselect.test8
-rw-r--r--mysql-test/suite/pbxt/t/type_timestamp.test2
-rw-r--r--mysql-test/suite/pbxt/t/union.test9
9 files changed, 100 insertions, 7 deletions
diff --git a/mysql-test/suite/pbxt/t/grant_cache.test b/mysql-test/suite/pbxt/t/grant_cache.test
index f3faa579035..ce53a88ac0c 100644
--- a/mysql-test/suite/pbxt/t/grant_cache.test
+++ b/mysql-test/suite/pbxt/t/grant_cache.test
@@ -5,6 +5,17 @@
--source include/add_anonymous_users.inc
#
+# some statements have different results in ps-mode
+#
+let $actual1=4;
+let $actual2=5;
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ let $actual1=3;
+ let $actual2=4;
+}
+
+#
# Test grants with query cache
#
--disable_warnings
@@ -112,6 +123,7 @@ select * from t2;
select mysqltest.t1.c from test.t1,mysqltest.t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+--replace_result $actual1 4
show status like "Qcache_not_cached";
# Connect without a database
@@ -128,6 +140,7 @@ select a from mysqltest.t1;
select a from mysqltest.t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+--replace_result $actual2 5
show status like "Qcache_not_cached";
# Cleanup
diff --git a/mysql-test/suite/pbxt/t/join.test b/mysql-test/suite/pbxt/t/join.test
index 7e7e1c10f06..02c17d8bcaa 100644
--- a/mysql-test/suite/pbxt/t/join.test
+++ b/mysql-test/suite/pbxt/t/join.test
@@ -521,7 +521,7 @@ select * from v1a join v1b on t1.b = t2.b;
# Bug #17523 natural join and information_schema
#
# We mask out the Privileges column because it differs with embedded server
---replace_column 31 #
+--replace_column 32 #
select * from information_schema.statistics join information_schema.columns
using(table_name,column_name) where table_name='user';
diff --git a/mysql-test/suite/pbxt/t/lock_multi.test b/mysql-test/suite/pbxt/t/lock_multi.test
index b15e6c9dea3..82188e36098 100644
--- a/mysql-test/suite/pbxt/t/lock_multi.test
+++ b/mysql-test/suite/pbxt/t/lock_multi.test
@@ -416,6 +416,41 @@ drop table t1,t2;
--echo End of 5.0 tests
+#
+# Bug#21281 Pending write lock is incorrectly removed when its
+# statement being KILLed
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+send
+update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Table Lock" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+send
+select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Table Lock" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Table Lock" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
# Disconnect sessions used in many subtests above
disconnect locker;
disconnect reader;
diff --git a/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test b/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test
new file mode 100644
index 00000000000..4a4578a5595
--- /dev/null
+++ b/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+SET binlog_format = 'mixed';
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
+BEGIN;
+# verify that binlog is on
+SELECT @@log_bin;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+COMMIT;
+select * from t1;
+select * from t2;
+
+# Test 2-phase commit when we disable binlogging.
+SET sql_log_bin = 0;
+BEGIN;
+INSERT INTO t1 VALUES (3);
+INSERT INTO t2 VALUES (4);
+COMMIT;
+select * from t1 order by a;
+select * from t2 order by b;
+
+drop table t1, t2;
+drop database pbxt;
+
diff --git a/mysql-test/suite/pbxt/t/range.test b/mysql-test/suite/pbxt/t/range.test
index 83e3a1e1f51..4eea4228136 100644
--- a/mysql-test/suite/pbxt/t/range.test
+++ b/mysql-test/suite/pbxt/t/range.test
@@ -322,6 +322,7 @@ create table t2 (
primary key (id),
index uid_index (uid));
+begin;
insert into t1(id, uid, name) values(1, 0, ' ');
insert into t1(uid, name) values(0, ' ');
@@ -375,6 +376,8 @@ 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;
+commit;
+
select count(*) from t1;
select count(*) from t2;
diff --git a/mysql-test/suite/pbxt/t/select.test b/mysql-test/suite/pbxt/t/select.test
index a5f7186f753..e870eb95fa4 100644
--- a/mysql-test/suite/pbxt/t/select.test
+++ b/mysql-test/suite/pbxt/t/select.test
@@ -2925,8 +2925,9 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
analyze table t2;
-select 'In next EXPLAIN, B.rows must be exactly 10:' Z;
+-- echo In next EXPLAIN, B.rows must be exactly 10 (when using MyISAM):
+# We mask out the 'rows' column because it may differ from run to run
--replace_column 9 #
explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
diff --git a/mysql-test/suite/pbxt/t/subselect.test b/mysql-test/suite/pbxt/t/subselect.test
index fae6d07a97e..891e23d923e 100644
--- a/mysql-test/suite/pbxt/t/subselect.test
+++ b/mysql-test/suite/pbxt/t/subselect.test
@@ -2052,7 +2052,7 @@ SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 2);
--error 1242
SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 1);
-
+--sorted_result
SELECT a FROM t1 GROUP BY a
HAVING IFNULL((SELECT b FROM t2 WHERE b > 2),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
@@ -2060,7 +2060,7 @@ SELECT a FROM t1 GROUP BY a
SELECT a FROM t1 GROUP BY a
HAVING IFNULL((SELECT b FROM t2 WHERE b > 1),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
-
+--sorted_result
SELECT a FROM t1 GROUP BY a
HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
@@ -2068,7 +2068,7 @@ SELECT a FROM t1 GROUP BY a
SELECT a FROM t1 GROUP BY a
HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3;
-
+--sorted_result
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
@@ -2076,7 +2076,7 @@ SELECT a FROM t1
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1),
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
-
+--sorted_result
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
diff --git a/mysql-test/suite/pbxt/t/type_timestamp.test b/mysql-test/suite/pbxt/t/type_timestamp.test
index edd2857f4d3..65659b2acca 100644
--- a/mysql-test/suite/pbxt/t/type_timestamp.test
+++ b/mysql-test/suite/pbxt/t/type_timestamp.test
@@ -287,7 +287,7 @@ drop table t1;
# mode regardless of whether a display width is given.
#
set sql_mode='maxdb';
-create table t1 (a timestamp, b timestamp);
+create table t1 (a timestamp, b timestamp(5));
show create table t1;
# restore default mode
set sql_mode='';
diff --git a/mysql-test/suite/pbxt/t/union.test b/mysql-test/suite/pbxt/t/union.test
index fe23b27d500..a66aba0d46c 100644
--- a/mysql-test/suite/pbxt/t/union.test
+++ b/mysql-test/suite/pbxt/t/union.test
@@ -904,6 +904,15 @@ drop table t1, t2;
#
select _utf8'12' union select _latin1'12345';
+#
+# lp:732124 union + limit returns wrong result
+#
+create table t1 (a int);
+insert into t1 values (10),(10),(10),(2),(3),(4),(5),(6),(7),(8),(9),(1),(10);
+--sorted_result
+select a from t1 where false UNION select a from t1 limit 8;
+drop table t1;
+
--disable_query_log
drop database pbxt;