mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #17766: The server accepts to create MERGE tables which cannot work
Changed the error reporting (and a crash) when inserting data into a MERGE table that has no underlying tables or no INSERT_METHOD specified by reporting that it is read-only. include/my_base.h: Add new handler error mysql-test/r/merge.result: Update results mysql-test/t/merge.test: Add new regression test sql/ha_myisammrg.cc: When trying to insert into a MERGE table with no underlying tables or no INSERT_METHOD, report that it is read-only. sql/handler.cc: Handle new error message
This commit is contained in:
@ -782,3 +782,15 @@ create table tm (b bit(1)) engine = merge union = (t1,t2);
|
||||
select * from tm;
|
||||
b
|
||||
drop table tm, t1, t2;
|
||||
create table t1 (a int) insert_method = last engine = merge;
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Table 't1' is read only
|
||||
create table t2 (a int) engine = myisam;
|
||||
alter table t1 union (t2);
|
||||
insert into t1 values (1);
|
||||
alter table t1 insert_method = no;
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Table 't1' is read only
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -399,4 +399,19 @@ create table tm (b bit(1)) engine = merge union = (t1,t2);
|
||||
select * from tm;
|
||||
drop table tm, t1, t2;
|
||||
|
||||
# End of 5.0 tests
|
||||
#
|
||||
# Bug #17766: The server accepts to create MERGE tables which cannot work
|
||||
#
|
||||
create table t1 (a int) insert_method = last engine = merge;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
insert into t1 values (1);
|
||||
create table t2 (a int) engine = myisam;
|
||||
alter table t1 union (t2);
|
||||
insert into t1 values (1);
|
||||
alter table t1 insert_method = no;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
insert into t1 values (1);
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user