summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-08-08 11:36:55 +0400
committerunknown <kostja@bodhi.(none)>2007-08-08 11:36:55 +0400
commit3ea18c5d51e1acca12da346ee19681d0bb7630f1 (patch)
treed67937ae90085c7da4b1c6fd69d3ad9e558353c3 /mysql-test
parent7ad6fb41b0ec903c0be433c012238aae672cdb6d (diff)
parent0d61c359d40b3d0454f0519cbdabf9ca92f21e99 (diff)
downloadmariadb-git-3ea18c5d51e1acca12da346ee19681d0bb7630f1.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.(none):/opt/local/work/mysql-5.1-runtime client/mysqldump.c: Auto merged mysql-test/r/federated.result: Auto merged mysql-test/t/federated.test: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/federated.result14
-rw-r--r--mysql-test/r/lock.result70
-rw-r--r--mysql-test/r/lock_multi.result10
-rw-r--r--mysql-test/t/federated.test14
-rw-r--r--mysql-test/t/lock.test65
-rw-r--r--mysql-test/t/lock_multi.test35
6 files changed, 208 insertions, 0 deletions
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index ca936cd5fde..8f1fe20ea3b 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -1920,6 +1920,20 @@ a b
2 Curly
drop table federated.t1;
drop table federated.t1;
+
+Bug#18287 create federated table always times out, error 1159 ' '
+
+Test that self-references work
+
+create table federated.t1 (a int primary key);
+create table federated.t2 (a int primary key)
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 (a) values (1);
+select * from federated.t2;
+a
+1
+drop table federated.t1, federated.t2;
CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8;
CREATE TABLE federated.t1 (a INT PRIMARY KEY)
ENGINE=FEDERATED
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result
index e2000a9ec91..6152e403637 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -96,4 +96,74 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
DROP TABLE t1;
+
+Bug#5719 impossible to lock VIEW
+
+Just covering existing behaviour with tests.
+Consistency has not been found here.
+
+drop view if exists v_bug5719;
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create temporary table t2 (a int);
+create table t3 (a int);
+create view v_bug5719 as select 1;
+lock table v_bug5719 write;
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+
+Allowed to select from a temporary talbe under LOCK TABLES
+
+select * from t2;
+a
+select * from t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+select * from v_bug5719;
+1
+1
+drop view v_bug5719;
+
+sic: did not left LOCK TABLES mode automatically
+
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+unlock tables;
+create view v_bug5719 as select * from t1;
+lock tables v_bug5719 write;
+select * from v_bug5719;
+a
+
+Allowed to use an underlying table under LOCK TABLES <view>
+
+select * from t1;
+a
+
+Allowed to select from a temporary table under LOCK TABLES
+
+select * from t2;
+a
+select * from t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+drop table t1;
+
+sic: left LOCK TABLES mode
+
+select * from t3;
+a
+select * from v_bug5719;
+ERROR HY000: View 'test.v_bug5719' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+unlock tables;
+drop view v_bug5719;
+
+When limitation to use temporary tables in views is removed, please
+add a test that shows what happens under LOCK TABLES when a view
+references a temporary table, is locked, and the underlying table
+is dropped.
+
+create view v_bug5719 as select * from t2;
+ERROR HY000: View's SELECT refers to a temporary table 't2'
+
+Cleanup.
+
+drop table t2, t3;
End of 5.1 tests.
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 2445b3e0c69..a3f7ab4505c 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -95,3 +95,13 @@ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1
alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
unlock tables;
drop table t1;
+create table t1 (i int);
+lock table t1 read;
+update t1 set i= 10;;
+select * from t1;;
+kill query ID;
+i
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 6597c77e798..90f1fa36bb4 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1725,6 +1725,20 @@ drop table federated.t1;
connection slave;
drop table federated.t1;
+--echo
+--echo Bug#18287 create federated table always times out, error 1159 ' '
+--echo
+--echo Test that self-references work
+--echo
+connection slave;
+create table federated.t1 (a int primary key);
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t2 (a int primary key)
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+insert into federated.t1 (a) values (1);
+select * from federated.t2;
+drop table federated.t1, federated.t2;
#
# BUG#29875 Disable support for transactions
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 2b8b430f096..6069bbf7018 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -148,5 +148,70 @@ LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
DROP TABLE t1;
+--echo
+--echo Bug#5719 impossible to lock VIEW
+--echo
+--echo Just covering existing behaviour with tests.
+--echo Consistency has not been found here.
+--echo
+--disable_warnings
+drop view if exists v_bug5719;
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (a int);
+create temporary table t2 (a int);
+create table t3 (a int);
+create view v_bug5719 as select 1;
+lock table v_bug5719 write;
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+--echo
+--echo Allowed to select from a temporary talbe under LOCK TABLES
+--echo
+select * from t2;
+--error ER_TABLE_NOT_LOCKED
+select * from t3;
+select * from v_bug5719;
+drop view v_bug5719;
+--echo
+--echo sic: did not left LOCK TABLES mode automatically
+--echo
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+unlock tables;
+create view v_bug5719 as select * from t1;
+lock tables v_bug5719 write;
+select * from v_bug5719;
+--echo
+--echo Allowed to use an underlying table under LOCK TABLES <view>
+--echo
+select * from t1;
+--echo
+--echo Allowed to select from a temporary table under LOCK TABLES
+--echo
+select * from t2;
+--error ER_TABLE_NOT_LOCKED
+select * from t3;
+drop table t1;
+--echo
+--echo sic: left LOCK TABLES mode
+--echo
+select * from t3;
+--error ER_VIEW_INVALID
+select * from v_bug5719;
+unlock tables;
+drop view v_bug5719;
+--echo
+--echo When limitation to use temporary tables in views is removed, please
+--echo add a test that shows what happens under LOCK TABLES when a view
+--echo references a temporary table, is locked, and the underlying table
+--echo is dropped.
+--echo
+--error ER_VIEW_SELECT_TMPTABLE
+create view v_bug5719 as select * from t2;
+--echo
+--echo Cleanup.
+--echo
+drop table t2, t3;
--echo End of 5.1 tests.
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 4a6b4ff5e56..b7c406f9637 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -270,3 +270,38 @@ drop table t1;
# 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 = "Locked" 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 = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" 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;
+
+--echo End of 5.1 tests