List:Commits« Previous MessageNext Message »
From:holyfoot Date:February 12 2007 10:22pm
Subject:bk commit into 5.1 tree (holyfoot:1.2421)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-02-13 01:22:43+04:00, holyfoot@hfmain.(none) +4 -0
  Merge mysql.com:/home/hf/work/20691/my50-20691
  into  mysql.com:/home/hf/work/20691/my51-20691
  MERGE: 1.1810.2372.77

  mysql-test/r/default.result@stripped, 2007-02-13 01:20:21+04:00, holyfoot@hfmain.(none) +0 -0
    Auto merged
    MERGE: 1.3.1.2

  mysql-test/r/gis.result@stripped, 2007-02-13 01:21:44+04:00, holyfoot@hfmain.(none) +0 -0
    SCCS merged
    MERGE: 1.35.1.4

  mysql-test/t/gis.test@stripped, 2007-02-13 01:22:35+04:00, holyfoot@hfmain.(none) +0 -1
    merging
    MERGE: 1.29.1.3

  sql/item.cc@stripped, 2007-02-13 01:20:21+04:00, holyfoot@hfmain.(none) +0 -0
    Auto merged
    MERGE: 1.113.1.140

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	holyfoot
# Host:	hfmain.(none)
# Root:	/home/hf/work/20691/my51-20691/RESYNC

--- 1.233/sql/item.cc	2007-02-13 01:22:48 +04:00
+++ 1.234/sql/item.cc	2007-02-13 01:22:48 +04:00
@@ -5592,6 +5592,13 @@ int Item_default_value::save_in_field(Fi
   {
     if (field_arg->flags & NO_DEFAULT_VALUE_FLAG)
     {
+      if (field_arg->reset())
+      {
+        my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
+                   ER(ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
+        return -1;
+      }
+
       if (context->error_processor == &view_error_processor)
       {
         TABLE_LIST *view= cached_table->top_table();
@@ -5610,7 +5617,6 @@ int Item_default_value::save_in_field(Fi
                             ER(ER_NO_DEFAULT_FOR_FIELD),
                             field_arg->field_name);
       }
-      field_arg->set_default();
       return 1;
     }
     field_arg->set_default();

--- 1.41/mysql-test/r/gis.result	2007-02-13 01:22:48 +04:00
+++ 1.42/mysql-test/r/gis.result	2007-02-13 01:22:48 +04:00
@@ -718,6 +718,10 @@ desc t1;
 Field	Type	Null	Key	Default	Extra
 GeomFromText('point(1 1)')	geometry	NO			
 drop table t1;
+create table t1 (g geometry not null);
+insert into t1 values(default);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
 create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
 create view v1 as select * from t1;
 desc v1;

--- 1.33/mysql-test/t/gis.test	2007-02-13 01:22:48 +04:00
+++ 1.34/mysql-test/t/gis.test	2007-02-13 01:22:48 +04:00
@@ -430,6 +430,14 @@ desc t1;
 drop table t1;
 
 #
+# Bug #20691 (DEFAULT over NOT NULL field)
+#
+create table t1 (g geometry not null);
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+insert into t1 values(default);
+drop table t1;
+
+#
 # Bug #11335 View redefines column types
 #
 create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);

--- 1.5/mysql-test/r/default.result	2007-02-13 01:22:48 +04:00
+++ 1.6/mysql-test/r/default.result	2007-02-13 01:22:48 +04:00
@@ -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.
Thread
bk commit into 5.1 tree (holyfoot:1.2421)holyfoot12 Feb