diff options
author | svoj@mysql.com/june.mysql.com <> | 2007-04-28 14:37:40 +0500 |
---|---|---|
committer | svoj@mysql.com/june.mysql.com <> | 2007-04-28 14:37:40 +0500 |
commit | 0c7631e76312c5e8872adfd02a14c9ab2a27700b (patch) | |
tree | 7f92a900379be5fa3debdfc612c3731cd99f95e1 | |
parent | f6989772986c75067f9ca38ce3bd2a31994704ec (diff) | |
download | mariadb-git-0c7631e76312c5e8872adfd02a14c9ab2a27700b.tar.gz |
BUG#27998 - mysqld crashed when executing INSERT DELAYED
on a BLACKHOLE table
Using INSERT DELAYED on BLACKHOLE tables could lead to server
crash.
This happens because delayed thread wants to upgrade a lock,
but BLACKHOLE tables do not have locks at all.
This patch rejects attempts to use INSERT DELAYED on MERGE
tables.
-rw-r--r-- | mysql-test/r/blackhole.result | 4 | ||||
-rw-r--r-- | mysql-test/t/blackhole.test | 9 | ||||
-rw-r--r-- | sql/ha_blackhole.h | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result index 4b779094376..2d020e0eed7 100644 --- a/mysql-test/r/blackhole.result +++ b/mysql-test/r/blackhole.result @@ -123,3 +123,7 @@ master-bin.000001 # Query 1 # use `test`; create table t3 like t1 master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3 master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3 drop table t1,t2,t3; +CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; +INSERT DELAYED INTO t1 VALUES(1); +ERROR HY000: Table storage engine for 't1' doesn't have this option +DROP TABLE t1; diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index 257770d311c..4375f1c13ce 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -126,4 +126,13 @@ show binlog events; drop table t1,t2,t3; +# +# BUG#27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE +# table +# +CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; +--error 1031 +INSERT DELAYED INTO t1 VALUES(1); +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/ha_blackhole.h b/sql/ha_blackhole.h index 177b59fa970..e5f5ee69a82 100644 --- a/sql/ha_blackhole.h +++ b/sql/ha_blackhole.h @@ -46,8 +46,7 @@ public: { return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | - HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME | - HA_CAN_INSERT_DELAYED); + HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME); } ulong index_flags(uint inx, uint part, bool all_parts) const { |