Bug #250 point column in innodb-table results in crash
Submitted: 8 Apr 2003 12:37 Modified: 9 Apr 2003 3:42
Reporter: Daniel Penning Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.0 OS:Microsoft Windows (Windows)
Assigned to: Sinisa Milivojevic CPU Architecture:Any

[8 Apr 2003 12:37] Daniel Penning
Description:
the following script crashes mysql

CREATE TABLE test (p point) type=MyISAM;
INSERT INTO test VALUES(NULL);
ALTER TABLE test type=InnoDB;

info: mysql doesnt crash without the INSERT statement

How to repeat:
[8 Apr 2003 15:47] Miguel Solorzano
Thanks for the debug report.

Windows stack trace:

abort() line 44 + 7 bytes
_assert(void * 0x0073bdec `string', void * 0x0073dc78 `string', unsigned int 1547) line 267
get_innobase_type_from_mysql_type(Field * 0x0457b1f8) line 1547 + 32 bytes
create_table_def(trx_struct * 0x01fedaa0, st_table * 0x05e4e0f0, const char * 0x05e4dc64) line 2942 + 9 bytes
ha_innobase::create(const char * 0x05e4e870, st_table * 0x05e4e0f0, st_ha_create_information * 0x0456a7f0) line 3118 + 20 bytes
ha_create_table(const char * 0x05e4e870, st_ha_create_information * 0x0456a7f0, int 0) line 903 + 35 bytes
rea_create_table(THD * 0x0456a318, char * 0x05e4e870, st_ha_create_information * 0x0456a7f0, List<create_field> & {...}, unsigned int 0, st_key * 0x01201590) line 153 + 15 bytes
mysql_create_table(THD * 0x0456a318, const char * 0x04563e10, const char * 0x05e4f734, st_ha_create_information * 0x0456a7f0, List<create_field> & {...}, List<Key> & {...}, int 1, int 1, unsigned int 0) line 896 + 38 bytes
mysql_alter_table(THD * 0x0456a318, char * 0x04563e10, char * 0x012013d0, st_ha_create_information * 0x0456a7f0, st_table_list * 0x012013f8, List<create_field> & {...}, List<Key> & {...}, List<Alter_drop> & {...}, List<Alter_column> & {...}, unsigned int 0, st_order * 0x00000000, int 0, enum_duplicates DUP_ERROR, enum_enable_or_disable LEAVE_AS_IS, int 0) line 2065 + 41 bytes
mysql_execute_command(THD * 0x0456a318) line 2096 + 132 bytes
mysql_parse(THD * 0x0456a318, char * 0x012013a0, unsigned int 28) line 3362 + 9 bytes
dispatch_command(enum_server_command COM_QUERY, THD * 0x0456a318, char * 0x045633b9, unsigned int 29) line 1249 + 29 bytes
do_command(THD * 0x0456a318) line 1049 + 55 bytes
handle_one_connection(void * 0x0456a318) line 838 + 9 bytes
pthread_start(void * 0x0120a0d0) line 63 + 7 bytes
_threadstart(void * 0x04563bf8) line 173 + 13 bytes
KERNEL32! 77e887dd()
[9 Apr 2003 3:42] Sinisa Milivojevic
===== sql/sql_table.cc 1.157 vs 1.158 =====
*** /tmp/sql_table.cc-1.157-26444       Mon Mar 17 15:06:04 2003
--- 1.158/sql/sql_table.cc      Tue Apr  8 20:39:45 2003
***************
*** 486,491 ****
--- 486,497 ----
        blob_columns++;
        break;
      case FIELD_TYPE_GEOMETRY:
+       if (!(file->table_flags() & HA_HAS_GEOMETRY))
+       {
+       my_printf_error(ER_WRONG_USAGE,ER(ER_WRONG_USAGE),MYF(0),
+                       "GEOMETRY FIELD TYPE","not supported by this storage engine  ");
+       DBUG_RETURN(-1);
+       }
        sql_field->pack_flag=FIELDFLAG_GEOM |
        pack_length_to_packflag(sql_field->pack_length -
                                portable_sizeof_char_ptr);