mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
take into account table lock mode when opening table:
try to find most suitable table, to avouid pickup table with too low locking mode or occupy table with write mode for select when it will be need for update later (BUG#9597) mysql-test/r/view.result: opening table in correct locking mode test mysql-test/t/view.test: opening table in correct locking mode test sql/sql_base.cc: take into account table lock mode when opening table: try to find most suitable table, to avouid pickup table with too low locking mode or occupy table with write mode for select when it will be need for update later
This commit is contained in:
@ -1977,3 +1977,17 @@ A
|
||||
B
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 ( bug_table_seq INTEGER NOT NULL);
|
||||
CREATE OR REPLACE VIEW v1 AS SELECT * from t1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
Warnings:
|
||||
Note 1305 PROCEDURE p1 does not exist
|
||||
CREATE PROCEDURE p1 ( )
|
||||
BEGIN
|
||||
DO (SELECT @next := IFNULL(max(bug_table_seq),0) + 1 FROM v1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
END //
|
||||
CALL p1();
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
@ -1804,7 +1804,6 @@ drop table t1;
|
||||
#
|
||||
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (f1 char) ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES ('A');
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
@ -1815,3 +1814,21 @@ SELECT * FROM t1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# opening table in correct locking mode (BUG#9597)
|
||||
#
|
||||
CREATE TABLE t1 ( bug_table_seq INTEGER NOT NULL);
|
||||
CREATE OR REPLACE VIEW v1 AS SELECT * from t1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
delimiter //;
|
||||
CREATE PROCEDURE p1 ( )
|
||||
BEGIN
|
||||
DO (SELECT @next := IFNULL(max(bug_table_seq),0) + 1 FROM v1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
END //
|
||||
delimiter ;//
|
||||
CALL p1();
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user