diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-09-03 12:59:48 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-09-03 12:59:48 +0500 |
commit | dd1d9adbb087d351ba69e51831dbf4ea628bbf9e (patch) | |
tree | 9b5636161cce73736d072f1edee6375228b3ddf3 /mysql-test | |
parent | 31d76e8d526da59070f0c75cae0b9672c11a1b03 (diff) | |
parent | 59b9d50c8a881e709e11da72d2617c7f66eb6b8b (diff) | |
download | mariadb-git-dd1d9adbb087d351ba69e51831dbf4ea628bbf9e.tar.gz |
merge with local tree
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/default.result | 15 | ||||
-rw-r--r-- | mysql-test/t/default.test | 19 |
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index e2eda69c2e7..5f27af882f2 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -205,4 +205,19 @@ Warnings: Warning 1364 Field 'id' doesn't have a default value drop view v1; drop table t1; +create table t1 (a int unique); +create table t2 (b int default 10); +insert into t1 (a) values (1); +insert into t2 (b) values (1); +insert into t1 (a) select b from t2 on duplicate key update a=default; +select * from t1; +a +NULL +insert into t1 (a) values (1); +insert into t1 (a) select b from t2 on duplicate key update a=default(b); +select * from t1; +a +NULL +10 +drop table t1, t2; End of 5.0 tests. diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 14aa4b02cfe..b719cb83448 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -145,5 +145,24 @@ insert into t1 values(default); drop view v1; drop table t1; +# +# Bug #39002: crash with +# INSERT ... SELECT ... ON DUPLICATE KEY UPDATE col=DEFAULT +# + +create table t1 (a int unique); +create table t2 (b int default 10); +insert into t1 (a) values (1); +insert into t2 (b) values (1); + +insert into t1 (a) select b from t2 on duplicate key update a=default; +select * from t1; + +insert into t1 (a) values (1); +insert into t1 (a) select b from t2 on duplicate key update a=default(b); +select * from t1; + +drop table t1, t2; + --echo End of 5.0 tests. |