List:Internals« Previous MessageNext Message »
From:holyfoot Date:October 15 2005 7:23pm
Subject:bk commit into 5.0 tree (hf:1.2046) BUG#12267
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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
  1.2046 05/10/15 22:23:13 hf@deer.(none) +4 -0
  Additional fix for bug #12267 (Can't use POINT for primary key)

  sql/sql_yacc.yy
    1.435 05/10/15 22:23:03 hf@deer.(none) +3 -1
    no need to specify length for Point type

  sql/sql_table.cc
    1.276 05/10/15 22:23:03 hf@deer.(none) +3 -0
    no need to specify keylength for Point type

  mysql-test/t/gis.test
    1.24 05/10/15 22:23:03 hf@deer.(none) +3 -0
    testcase added

  mysql-test/r/gis.result
    1.27 05/10/15 22:23:03 hf@deer.(none) +3 -0
    result fixed

# 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:	hf
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.12267

--- 1.275/sql/sql_table.cc	Sat Oct 15 21:05:20 2005
+++ 1.276/sql/sql_table.cc	Sat Oct 15 22:23:03 2005
@@ -1156,6 +1156,9 @@
 	    my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name);
 	    DBUG_RETURN(-1);
 	  }
+          if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
+              Field::GEOM_POINT)
+            column->length= 21;
 	  if (!column->length)
 	  {
 	    my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name);

--- 1.434/sql/sql_yacc.yy	Thu Oct 13 19:27:29 2005
+++ 1.435/sql/sql_yacc.yy	Sat Oct 15 22:23:03 2005
@@ -2969,7 +2969,9 @@
 spatial_type:
 	GEOMETRY_SYM	      { $$= Field::GEOM_GEOMETRY; }
 	| GEOMETRYCOLLECTION  { $$= Field::GEOM_GEOMETRYCOLLECTION; }
-	| POINT_SYM           { $$= Field::GEOM_POINT; }
+	| POINT_SYM           { Lex->length= (char*)"21";
+                                $$= Field::GEOM_POINT;
+                              }
 	| MULTIPOINT          { $$= Field::GEOM_MULTIPOINT; }
 	| LINESTRING          { $$= Field::GEOM_LINESTRING; }
 	| MULTILINESTRING     { $$= Field::GEOM_MULTILINESTRING; }

--- 1.26/mysql-test/r/gis.result	Mon Sep 26 14:54:41 2005
+++ 1.27/mysql-test/r/gis.result	Sat Oct 15 22:23:03 2005
@@ -682,6 +682,9 @@
 drop function fn3;
 create table t1(pt POINT);
 alter table t1 add primary key pti(pt);
+drop table t1;
+create table t1(pt GEOMETRY);
+alter table t1 add primary key pti(pt);
 ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
 alter table t1 add primary key pti(pt(20));
 drop table t1;

--- 1.23/mysql-test/t/gis.test	Mon Sep 26 14:54:41 2005
+++ 1.24/mysql-test/t/gis.test	Sat Oct 15 22:23:03 2005
@@ -399,6 +399,9 @@
 # Bug #12267 (primary key over GIS)
 #
 create table t1(pt POINT);
+alter table t1 add primary key pti(pt);
+drop table t1;
+create table t1(pt GEOMETRY);
 --error 1170
 alter table t1 add primary key pti(pt);
 alter table t1 add primary key pti(pt(20));
Thread
bk commit into 5.0 tree (hf:1.2046) BUG#12267holyfoot15 Oct