As the result of DOUBLE claculations can be bigger
than DBL_MAX constant we use in code, we shouldn't use this constatn
as a biggest possible value.
Particularly the rtree_pick_key function set 'min_area= DBL_MAX' relying
that any rtree_area_increase result will be less so we return valid
key. Though in rtree_area_increase function we calculate the area
of the rectangle, so the result can be 'inf' if the rectangle is
huge enough, which is bigger than DBL_MAX.
Code of the rtree_pick_key modified so we always return a valid key.
myisam/rt_index.c:
Bug #30286 spatial index cause corruption and server crash!
always set the best_key with the first key we get, so we always return
somthing valid.
myisam/rt_mbr.c:
Bug #30286 spatial index cause corruption and server crash!
function comment extended
mysql-test/r/gis-rtree.result:
Bug #30286 spatial index cause corruption and server crash!
test result
mysql-test/t/gis-rtree.test:
Bug #30286 spatial index cause corruption and server crash!
test case
CHECK TABLE could complain about a fully intact spatial index.
A wrong comparison operator was used for table checking.
The result was that it checked for non-matching spatial keys.
This succeeded if at least two different keys were present,
but failed if only the matching key was present.
I fixed the key comparison.
myisam/mi_check.c:
Bug#17877 - Corrupted spatial index
Fixed the comparison operator for checking a spatial index.
Using MBR_EQUAL | MBR_DATA to compare for equality and
include the data pointer in the comparison. The latter
finds the index entry that points to the current record.
This is necessary for non-unique indexes.
The old operator, SEARCH_SAME, is unknown to the rtree
search functions and handled like MBR_DISJOINT.
myisam/mi_key.c:
Bug#17877 - Corrupted spatial index
Added a missing DBUG_RETURN.
myisam/rt_index.c:
Bug#17877 - Corrupted spatial index
Included the data pointer in the copy of the search key.
This is necessary for searching the index entry that points
to a specific record if the search_flag contains MBR_DATA.
myisam/rt_mbr.c:
Bug#17877 - Corrupted spatial index
Extended the RT_CMP() macro with an assert for an
unexpected comparison operator.
mysql-test/r/gis-rtree.result:
Bug#17877 - Corrupted spatial index
The test result.
mysql-test/t/gis-rtree.test:
Bug#17877 - Corrupted spatial index
The test case.
This bug is the result of weird error happening with mi_float8get and double
arythmetic. I described that in 'Bug that looks potentially dangerous' email
myisam/rt_mbr.c:
*ab_area was changed with the local variable just to make the function
working without errors
mysql-test/r/gis.result:
appropriate test result
mysql-test/t/gis.test:
Test case
myisam/rt_index.c:
Auto merged
myisam/rt_index.h:
Auto merged
myisam/rt_mbr.c:
Auto merged
myisam/rt_mbr.h:
Auto merged
myisam/rt_split.c:
Auto merged
myisam/rt_test.c:
Auto merged
sql/spatial.cc:
Auto merged
some changes to make code nicer
include/myisampack.h:
mi_sint1korr and similar things added to do conversion in an
uniform way
myisam/rt_index.c:
'if' simplified
myisam/rt_mbr.c:
some fixes to make code nicer and smaller
myisam/rt_test.c:
some modifications to extend test
mysql-test/r/gis-rtree.result:
result became slightly different because of changes made
A set of changes improving our RTree indexes and fixed few bugs
found during the tests
myisam/rt_index.c:
Algorythm for picking the branch to insert was fixed.
pick_by_perimeter version of the algorythm added (mostly for testing
purposes)
myisam/rt_index.h:
minimal size of the page set to 1/3
It noticeable increases searching performance
myisam/rt_key.c:
counting of the size of the filled part of the page fixed
rtree_choose_key moved to rt_index.c
myisam/rt_key.h:
no need to make rtree_choose_key global
myisam/rt_mbr.c:
operations for counting the perimeter of MBR added
myisam/rt_mbr.h:
interface for rtree_perimeter_increase
myisam/rt_split.c:
my_multi_malloc changed with my_alloca
sql/spatial.cc:
LINESTRING object can consist of single point
Don't use new password format if mysql.user has old format
tables_priv was not reset on FLUSH PRIVILEGES if tables_priv was empty
Portability fixes for Windows
client/mysql.cc:
Removed compiler warnings.
Make quote handling simpler
include/config-win.h:
Fix for myisam/rt_mbr.c
include/mysql.h:
Change client_flag to unsigned long to handle more options.
libmysql/libmysql.c:
Change client_flag to unsigned long to handle more options.
libmysqld/libmysqld.c:
Change client_flag to unsigned long to handle more options.
myisam/rt_mbr.c:
Portability fix for Windows
mysql-test/r/rpl_loaddata.result:
Fix test case
sql/item_strfunc.cc:
Don't use new password format if mysql.user has old format
sql/item_strfunc.h:
Don't use new password format if mysql.user has old format
sql/mysql_priv.h:
Don't use new password format if mysql.user has old format
sql/mysqld.cc:
Don't use new password format if mysql.user has old format
sql/sql_acl.cc:
Don't use new password format if mysql.user has old format.
tables_priv was not reset on FLUSH PRIVILEGES if tables_priv was empty
sql/sql_class.h:
Don't use new password format if mysql.user has old format
sql/sql_parse.cc:
Change client_flag to unsigned long to handle more options.
sql/sql_yacc.yy:
Don't use new password format if mysql.user has old format
strings/ctype-utf8.c:
Remove compiler warnings
strings/ctype-win1250ch.c:
Remove compiler warnings
tests/grant.res:
Update results
RTREEs will be used for GIS extension in MySQL
myisam/.cvsignore:
Added sp_test and rt_test
myisam/Makefile.am:
Added RTREE files
myisam/mi_create.c:
Added RTREE/SPATIAL initialization
myisam/mi_delete.c:
Switched to use virual function, instead of mi_ck_delete() direct call
myisam/mi_key.c:
Added sp_make_key() call in the case of SPATIAL index type
myisam/mi_open.c:
Added some new initialization actions which depend on key_alg being used: RTREE or BTREE
myisam/mi_range.c:
Rtree estimation
myisam/mi_rkey.c:
rtree
myisam/mi_rnext.c:
rtree
myisam/mi_rnext_same.c:
rtree
myisam/mi_static.c:
New search flags for bounding rectungles
myisam/mi_test1.c:
one now should always specify key_alg during keyinfo initializing: BTREE or RTREE
myisam/mi_test2.c:
Added key_alg initializing
myisam/mi_test3.c:
Added key_alg initialization
myisam/mi_update.c:
Switched to virtual functions, instead of mi_ck_delete/mi_ck_write direct call
myisam/mi_write.c:
Virtual function instead of mi_ck_write() direct call
myisam/myisamdef.h:
Rtree additions