215
215
drop table t2, t3;
218
--echo # Bug#39843 DELETE requires write access to table in subquery in where clause
221
DROP TABLE IF EXISTS t1,t2;
224
table1_rowid SMALLINT NOT NULL
227
table2_rowid SMALLINT NOT NULL
229
INSERT INTO t1 VALUES (1);
230
INSERT INTO t2 VALUES (1);
231
LOCK TABLES t1 WRITE, t2 READ;
232
--echo # Sub-select should not try to aquire a write lock.
238
WHERE t1.table1_rowid = t2.table2_rowid
240
--echo # While implementing the patch we didn't break old behavior;
241
--echo # The following sub-select should still requires a write lock:
242
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
243
SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE);
217
247
--echo End of 5.1 tests.