diff options
author | unknown <holyfoot/hf@hfmain.(none)> | 2007-03-16 22:09:10 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@hfmain.(none)> | 2007-03-16 22:09:10 +0400 |
commit | 793c30612ac1a2736018919649973e6c3d30cfe8 (patch) | |
tree | 9b40ddfb35af3b50d0b25f3ef372ac695ccb5c61 /mysql-test | |
parent | 0270e811d047d3892d7641724e5ab7ca15b37f65 (diff) | |
parent | 43b9ff1b21b2d645e5cd52d82878a48b47b01f8d (diff) | |
download | mariadb-git-793c30612ac1a2736018919649973e6c3d30cfe8.tar.gz |
Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
mysql-test/r/insert_update.result:
Auto merged
mysql-test/t/insert_update.test:
Auto merged
mysql-test/t/skip_grants.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_insert.cc:
merging
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/insert_update.result | 11 | ||||
-rw-r--r-- | mysql-test/r/skip_grants.result | 12 | ||||
-rw-r--r-- | mysql-test/t/insert_update.test | 21 | ||||
-rw-r--r-- | mysql-test/t/skip_grants.test | 8 |
4 files changed, 52 insertions, 0 deletions
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index b7a5a9a65ff..c7351258266 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -236,6 +236,17 @@ 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; CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(5) NOT NULL UNIQUE); INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index 58ced16acac..3052bae8e97 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -58,3 +58,15 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; +select count(*) from information_schema.COLUMN_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.SCHEMA_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.TABLE_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.USER_PRIVILEGES; +count(*) +0 diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 027902ccdb6..1ed1e8657ac 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -164,6 +164,27 @@ INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; DROP TABLE t1,t2; # +# Bug #26261: Missing default value isn't noticed in +# insert ... on duplicate key update +# +SET SQL_MODE = 'TRADITIONAL'; + +CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); + +--error 1364 +INSERT INTO t1 (a) VALUES (1); + +--error 1364 +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; + +--error 1364 +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; + +SELECT * FROM t1; + +DROP TABLE t1; + +# # Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were # touched but not actually changed. # diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test index 6dda97fcf8a..75694672a17 100644 --- a/mysql-test/t/skip_grants.test +++ b/mysql-test/t/skip_grants.test @@ -108,3 +108,11 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; + +# +# Bug#26285 Selecting information_schema crahes server +# +select count(*) from information_schema.COLUMN_PRIVILEGES; +select count(*) from information_schema.SCHEMA_PRIVILEGES; +select count(*) from information_schema.TABLE_PRIVILEGES; +select count(*) from information_schema.USER_PRIVILEGES; |