From 07f36668aecfd3d811c4ed5eb23b1bfdb8c86fdd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Feb 2007 15:41:36 +0400 Subject: bug #20691 (INSERT (DEFAULT) may insert garbage with NO DEFAULT NOT NULL field) Some fields (GEOMETRY first of all) can't be handled properly in this case at all. So we return an error in this case mysql-test/r/default.result: result fixed mysql-test/r/gis.result: result fixed mysql-test/t/default.test: VIEW test added mysql-test/t/gis.test: testcase added sql/item.cc: set_defaults() changed with the 'reset()' --- mysql-test/r/default.result | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mysql-test/r/default.result') diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index e2aa3b4a3cc..0b2b6769505 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -193,6 +193,16 @@ a b c d e f g h i x two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 1 small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 2 two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 3 - small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4 + 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4 drop table bug20691; +create table t1 (id int not null); +insert into t1 values(default); +Warnings: +Warning 1364 Field 'id' doesn't have a default value +create view v1 (c) as select id from t1; +insert into t1 values(default); +Warnings: +Warning 1364 Field 'id' doesn't have a default value +drop view v1; +drop table t1; End of 5.0 tests. -- cgit v1.2.1