diff options
author | unknown <ingo@mysql.com> | 2005-01-19 21:16:27 +0100 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2005-01-19 21:16:27 +0100 |
commit | 699a530a0a7915a50ed2e042ff7e5f088f9d359a (patch) | |
tree | 35ace0defa95ca054f917494cc043c64af98c289 /mysql-test/t/insert_select.test | |
parent | e46d235a08a35bdd5536b4b2b99ed3a5b6910cdf (diff) | |
download | mariadb-git-699a530a0a7915a50ed2e042ff7e5f088f9d359a.tar.gz |
BUG#6034 - Error code 124: Wrong medium type.
Version for 4.1. Committed for merge.
If the result table is one of the select tables in INSERT SELECT,
we must not disable the result tables indexes before selecting.
mysql_execute_command() detects the match for other reasons and
adds the flag OPTION_BUFFER_RESULT to the 'select_options'.
In this case the result is put into a temporary table first.
Hence, we can defer the preparation of the insert
table until the result is to be used.
mysql-test/r/insert_select.result:
BUG#6034 - Error code 124: Wrong medium type.
The test results.
mysql-test/t/insert_select.test:
BUG#6034 - Error code 124: Wrong medium type.
The test case.
sql/sql_select.cc:
BUG#6034 - Error code 124: Wrong medium type.
With OPTION_BUFFER_RESULT in the 'select_options',
defer the preparation of the insert table until the
result is to be used.
Diffstat (limited to 'mysql-test/t/insert_select.test')
-rw-r--r-- | mysql-test/t/insert_select.test | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index e1459310bb9..39b8bfcaaaa 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -182,3 +182,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2 select * from t2; drop table t1, t2; + +# +# BUG#6034 - Error code 124: Wrong medium type +# +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + NO int(11) NOT NULL default '0', + SEQ int(11) NOT NULL default '0', + PRIMARY KEY (ID), + KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +drop table t1; + |