MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:holyfoot Date:August 9 2005 4:30pm
Subject:bk commit into 4.1 tree (hf:1.2370) BUG#9465
View as plain text  
Below is the list of changes that have just been committed into a local
4.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
  1.2370 05/08/09 21:30:28 hf@deer.(none) +3 -0
  Fix for bug #9465 (check table extended fails with SPATIAL)

  mysql-test/t/gis-rtree.test
    1.11 05/08/09 21:29:38 hf@deer.(none) +15 -0
    test case

  mysql-test/r/gis-rtree.result
    1.11 05/08/09 21:29:38 hf@deer.(none) +13 -0
    test result fixed

  myisam/mi_check.c
    1.148 05/08/09 21:29:38 hf@deer.(none) +13 -9
    different search function is used for SPATIAL keys

# 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-4.1.9645

--- 1.147/myisam/mi_check.c	Tue Jun  7 18:34:09 2005
+++ 1.148/myisam/mi_check.c	Tue Aug  9 21:29:38 2005
@@ -1035,7 +1035,7 @@
       {
 	if ((((ulonglong) 1 << key) & info->s->state.key_map))
 	{
-	  if(!(keyinfo->flag & HA_FULLTEXT))
+          if(!(keyinfo->flag & HA_FULLTEXT))
 	  {
 	    uint key_length=_mi_make_key(info,key,info->lastkey,record,
 					 start_recpos);
@@ -1044,14 +1044,18 @@
 	      /* We don't need to lock the key tree here as we don't allow
 		 concurrent threads when running myisamchk
 	      */
-	      if (_mi_search(info,keyinfo,info->lastkey,key_length,
-			     SEARCH_SAME, info->s->state.key_root[key]))
-	      {
-		mi_check_print_error(param,"Record at: %10s  Can't find key for index: %2d",
-			    llstr(start_recpos,llbuff),key+1);
-		if (error++ > MAXERR || !(param->testflag & T_VERBOSE))
-		  goto err2;
-	      }
+              int search_result= (keyinfo->flag & HA_SPATIAL) ?
+                rtree_find_first(info, key, info->lastkey, key_length,
+                                 SEARCH_SAME) : 
+                _mi_search(info,keyinfo,info->lastkey,key_length,
+                           SEARCH_SAME, info->s->state.key_root[key]);
+              if (search_result)
+              {
+                mi_check_print_error(param,"Record at: %10s  Can't find key for index: %2d",
+                                     llstr(start_recpos,llbuff),key+1);
+                if (error++ > MAXERR || !(param->testflag & T_VERBOSE))
+                  goto err2;
+              }
 	    }
 	    else
 	      key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey,

--- 1.10/mysql-test/r/gis-rtree.result	Fri Dec 10 16:05:59 2004
+++ 1.11/mysql-test/r/gis-rtree.result	Tue Aug  9 21:29:38 2005
@@ -804,3 +804,16 @@
 INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
 ERROR HY000: Unknown error
 drop table t1, t2;
+CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 (geometry) VALUES
+(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
+-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
+-18.6086111000 -66.9327777000))'));
+INSERT INTO t1 (geometry) VALUES
+(PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
+-96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
+-65.7402776999 -96.6686111000))'));
+check table t1 extended;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+drop table t1;

--- 1.10/mysql-test/t/gis-rtree.test	Thu Jul 28 05:21:42 2005
+++ 1.11/mysql-test/t/gis-rtree.test	Tue Aug  9 21:29:38 2005
@@ -173,4 +173,19 @@
 INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
 drop table t1, t2;
 
+CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 (geometry) VALUES
+(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
+-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
+-18.6086111000 -66.9327777000))'));
+
+INSERT INTO t1 (geometry) VALUES
+(PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
+-96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
+-65.7402776999 -96.6686111000))'));
+check table t1 extended;
+
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (hf:1.2370) BUG#9465holyfoot9 Aug