diff options
author | unknown <gkodinov/kgeorge@macbook.gmz> | 2007-03-16 10:35:39 +0200 |
---|---|---|
committer | unknown <gkodinov/kgeorge@macbook.gmz> | 2007-03-16 10:35:39 +0200 |
commit | 2e8e78a42cbe49d2e74381c9229d2e93c8df6f0d (patch) | |
tree | bcb1b42fa6a2377ab144ada7be2095e71e0c647e /mysql-test/r/insert_update.result | |
parent | 1f93b0c83af4b30b90e3a71eb6f2a663375feebc (diff) | |
download | mariadb-git-2e8e78a42cbe49d2e74381c9229d2e93c8df6f0d.tar.gz |
Bug #26261:
INSERT uses query_id to verify what fields are
mentioned in the fields list of the INSERT command.
However the check for that is made after the
ON DUPLICATE KEY is processed. This causes all
the fields mentioned in ON DUPLICATE KEY to be
considered as mentioned in the fields list of
INSERT.
Moved the check up, right after processing the
fields list.
mysql-test/r/insert_update.result:
Bug #26261: test case
mysql-test/t/insert_update.test:
Bug #26261: test case
sql/mysql_priv.h:
Bug #26261: moved the check inside mysql_prepare_insert
sql/sql_insert.cc:
Bug #26261: move the check inside mysql_prepare_insert
before setting up the ON DUPLICATE KEY part
sql/sql_prepare.cc:
Bug #26261: moved the check inside mysql_prepare_insert
Diffstat (limited to 'mysql-test/r/insert_update.result')
-rw-r--r-- | mysql-test/r/insert_update.result | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index f658ff06624..2403de5f7a9 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -236,3 +236,14 @@ INSERT INTO t2 VALUES (1), (3); INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; ERROR 42S22: Unknown column 'a' in 'field list' DROP TABLE t1,t2; +SET SQL_MODE = 'TRADITIONAL'; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); +INSERT INTO t1 (a) VALUES (1); +ERROR HY000: Field 'b' doesn't have a default value +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; +ERROR HY000: Field 'b' doesn't have a default value +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; +ERROR HY000: Field 'b' doesn't have a default value +SELECT * FROM t1; +a b +DROP TABLE t1; |