summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-04-08 20:39:50 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2003-04-08 20:39:50 +0300
commit7786126befbe83a3779af4846e62a1e49c682596 (patch)
tree740935f87302ff7678bc5aa364edfcb5afe5bece /sql
parentf4216c526bcd7b3e68249f4349f856a8dfcc7f73 (diff)
downloadmariadb-git-7786126befbe83a3779af4846e62a1e49c682596.tar.gz
a fix for a crashing bug when attempting to create InnoDB table
with GEOMETRY field type.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisam.h2
-rw-r--r--sql/handler.h1
-rw-r--r--sql/sql_table.cc6
3 files changed, 8 insertions, 1 deletions
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index 5dc294b3b9f..154429ecc0d 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -46,7 +46,7 @@ class ha_myisam: public handler
ha_myisam(TABLE *table): handler(table), file(0),
int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY),
+ HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY | HA_HAS_GEOMETRY),
enable_activate_all_index(1)
{}
~ha_myisam() {}
diff --git a/sql/handler.h b/sql/handler.h
index c6a4578a26c..06c24214d0f 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -48,6 +48,7 @@
#define HA_TABLE_SCAN_ON_INDEX 4 /* No separate data/index file */
#define HA_REC_NOT_IN_SEQ 8 /* ha_info don't return recnumber;
It returns a position to ha_r_rnd */
+#define HA_HAS_GEOMETRY 16
#define HA_NO_INDEX 32 /* No index needed for next/prev */
#define HA_KEY_READ_WRONG_STR 64 /* keyread returns converted strings */
#define HA_NULL_KEY 128 /* One can have keys with NULL */
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f4bcd6bd684..36056851753 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -486,6 +486,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
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);