summaryrefslogtreecommitdiff
path: root/mysql-test/r/lock.result
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-10-17 14:05:43 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-10-17 14:05:43 -0400
commitf48feae696f2ce6cf2261c50789911da245b9aa6 (patch)
tree892096ddfa11f5fea89ad26528d5c64fbc05ffce /mysql-test/r/lock.result
parent1fc9612c670264500e726a10e85332da2feed9a6 (diff)
parent03bef972d3b508013cfcad2de294569ecdf16158 (diff)
downloadmariadb-git-f48feae696f2ce6cf2261c50789911da245b9aa6.tar.gz
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-comeng-unification
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-recentcommmerge BitKeeper/deleted/.del-ha_berkeley.cc: Auto merged BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb: Auto merged BitKeeper/triggers/post-commit: Auto merged client/mysqlcheck.c: Auto merged include/config-win.h: Auto merged include/my_dbug.h: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/r/func_in.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/r/information_schema_db.result: Auto merged mysql-test/t/func_in.test: Auto merged mysql-test/t/information_schema.test: Auto merged sql/Makefile.am: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/lock.cc: Auto merged sql/log_event.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/table.h: Auto merged storage/archive/ha_archive.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/ndb/src/common/util/File.cpp: Auto merged configure.in: Manual merge. sql/CMakeLists.txt: Manual merge. sql/mysql_priv.h: Manual merge. sql/mysqld.cc: Manual merge. sql/set_var.cc: Manual merge. sql/slave.cc: Manual merge. sql/sql_cache.cc: Manual merge. sql/sql_class.cc: Manual merge. sql/sql_lex.h: Manual merge. sql/sql_parse.cc: Manual merge. sql/sql_select.cc: Manual merge. sql/sql_show.cc: Manual merge. sql/sql_table.cc: Manual merge. sql/sql_update.cc: Manual merge. sql/sql_yacc.yy: Manual merge.
Diffstat (limited to 'mysql-test/r/lock.result')
-rw-r--r--mysql-test/r/lock.result73
1 files changed, 72 insertions, 1 deletions
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result
index 1a2099b7a94..6152e403637 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -40,7 +40,8 @@ test.t1 check status OK
lock tables t1 write;
check table t2;
Table Op Msg_type Msg_text
-test.t2 check error Table 't2' was not locked with LOCK TABLES
+test.t2 check Error Table 't2' was not locked with LOCK TABLES
+test.t2 check error Corrupt
insert into t1 select index1,nr from t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
unlock tables;
@@ -95,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.