diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 15fce66cff1..82655dd46ec 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1868,6 +1868,19 @@ CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 467455460 DROP TABLE t1; +# +# BUG#48438 - crash with error in unioned query against merge table and view... +# +SET GLOBAL table_open_cache=3; +CREATE TABLE t1(a INT); +SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE; +1 +SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; +TABLE_ROWS DATA_LENGTH +0 0 +DROP TABLE t1; +SET GLOBAL table_open_cache=DEFAULT; End of 5.0 tests create table t1 (a int not null, key `a` (a) key_block_size=1024); show create table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 568eadb5e39..d12dbce1cc1 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1198,6 +1198,17 @@ CHECKSUM TABLE t1 EXTENDED; DROP TABLE t1; +--echo # +--echo # BUG#48438 - crash with error in unioned query against merge table and view... +--echo # +SET GLOBAL table_open_cache=3; +CREATE TABLE t1(a INT); +SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE; +SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; +DROP TABLE t1; +SET GLOBAL table_open_cache=DEFAULT; + --echo End of 5.0 tests diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index 6a4c21160f4..342efff4842 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -321,8 +321,8 @@ void mi_update_status(void* param) (long) info->s->state.state.data_file_length)); #endif info->s->state.state= *info->state; - info->state= &info->s->state.state; } + info->state= &info->s->state.state; info->append_insert_at_end= 0; /*