diff options
author | unknown <ingo@mysql.com> | 2005-01-19 21:20:55 +0100 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2005-01-19 21:20:55 +0100 |
commit | ab7f56e36559d0ad234ad5760f0c4628a3c408ea (patch) | |
tree | c6d0c97d5f422270c1c63a8e94fbca2afd16bf64 /mysql-test/t/insert_select.test | |
parent | 09aa1e07630efa7388c8b128ec3635a0aa1f4600 (diff) | |
download | mariadb-git-ab7f56e36559d0ad234ad5760f0c4628a3c408ea.tar.gz |
BUG#6034 - Error code 124: Wrong medium type.
Version for 5.0. 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.
Now the preparation is split into two prepare methods.
The first detects the situation and defers some preparations
until the second phase.
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_class.h:
BUG#6034 - Error code 124: Wrong medium type.
Added a new method for deferred preparation actions.
sql/sql_insert.cc:
BUG#6034 - Error code 124: Wrong medium type.
If the insert table is one of the select tables, a part
of the result table preparations like disabling indexes
has to be done after the select phase.
This is now done in the new method select_insert::prepare2().
sql/sql_select.cc:
BUG#6034 - Error code 124: Wrong medium type.
The result table preparation is now split into prepare() and
prepare2(). Disabling indexes and other preparation stuff
is deferred until after the selection phase.
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 15509b06679..a5b163b3533 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -180,3 +180,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; + |