Crash with Spatial Index (4.1)

Crash with Spatial Index (4.1)

am 06.01.2003 00:08:03 von Georg Richter

Hi,

how-to-repeat:

mysql> drop table a;
Query OK, 0 rows affected (0.00 sec)

mysql> create table a (a blob, spatial key(a));
Query OK, 0 rows affected (0.00 sec)

mysql> create table b (a int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into b values (1);
Query OK, 1 row affected (0.03 sec)

mysql> insert into a (a) values (point(1,1));
Query OK, 1 row affected (0.02 sec)

mysql> insert into a (a) values (point(1, (select a from b)));
ERROR 2013: Lost connection to MySQL server during query

When spatial key isn't defined query works ok

Btw: Is there any docu available which is more up to date than gis.txt in the
Docs-subdir?

Stack-Trace:

0x80f112b handle_segfault + 447
0x40047bc4 _end + 935313260
0x8260dbd sp_get_geometry_mbr + 17
0x8260c30 sp_mbr_from_wkb + 84
0x8260b56 sp_make_key + 86
0x823acdb _mi_make_key + 107
0x82434a7 mi_write + 839
0x81524a1 write_row__9ha_myisamPc + 105
0x812a447 write_record__FP8st_tableP12st_copy_info + 643
0x8129cb4
mysql_insert__FP3THDP13st_table_listRt4List1Z4ItemRt4List1Zt 4List1Z4ItemT2T215enum_duplicates
+ 1564
0x80fe22e mysql_execute_command__FP3THD + 7570
0x8100d01 mysql_parse__FP3THDPcUi + 229
0x80fb90c dispatch_command__F19enum_server_commandP3THDPcUi + 1732
0x80fb23d do_command__FP3THD + 301
0x80fa947 handle_one_connection + 723
0x40044f37 _end + 935301855
0x401a0baa _end + 936726354

Regards

Georg

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13407@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with Spatial Index (4.1)

am 08.01.2003 16:52:16 von Holyfoot

Georg Richter writes:
>Subject: Crash with Spatial Index (4.1)
> mysql> insert into a (a) values (point(1, (select a from b)));
> ERROR 2013: Lost connection to MySQL server during query

This bug is fixed now.
Thanks for reporting!

Here is the patch
--- 1.78/sql/item_strfunc.cc Thu Jan 2 19:03:58 2003
+++ 1.79/sql/item_strfunc.cc Wed Jan 8 19:41:38 2003
@@ -2666,6 +2666,9 @@

String *Item_func_point::val_str(String *str)
{
+ double x= args[0]->val();
+ double y= args[1]->val();
+
if ( (null_value = (args[0]->null_value ||
args[1]->null_value ||
str->realloc(1+4+8+8))))
@@ -2674,8 +2677,8 @@
str->length(0);
str->q_append((char)Geometry::wkbNDR);
str->q_append((uint32)Geometry::wkbPoint);
- str->q_append((double)args[0]->val());
- str->q_append((double)args[1]->val());
+ str->q_append(x);
+ str->q_append(y);
return str;
}

@@ -2707,10 +2710,9 @@

for (i = 0; i < arg_count; ++i)
{
+ String *res = args[i]->val_str(&arg_value);
if (args[i]->null_value)
goto ret;
-
- String *res = args[i]->val_str(&arg_value);

if ( coll_type == Geometry::wkbGeometryCollection )
{


Regards.
HF
--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexey Botchkov
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Izhevsk, Russia
<___/ www.mysql.com


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13426@lists.mysql.com
To unsubscribe, e-mail