From 2b141612128d90e62032f5a898b3e14df96ef2cf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Feb 2003 16:47:48 +0400 Subject: sql_table.cc, field.cc: Bug fix opt_range.cc: Buf fix sql/field.cc: Bug fix sql/opt_range.cc: Buf fix sql/sql_table.cc: Bug fix --- sql/sql_table.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 77e896a630e..c6fa4d25120 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -705,14 +705,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, { if (key->type == Key::FULLTEXT) column->length=1; /* ft-code ignores it anyway :-) */ - else if (key->type == Key::SPATIAL) - { - /* - BAR: 4 is: (Xmin,Xmax,Ymin,Ymax), this is for 2D case - Lately we'll extend this code to support more dimensions - */ - column->length=4*sizeof(double); - } else { my_printf_error(ER_BLOB_KEY_WITHOUT_LENGTH, @@ -722,6 +714,17 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, } } } + if (key->type == Key::SPATIAL) + { + if (!column->length ) + { + /* + BAR: 4 is: (Xmin,Xmax,Ymin,Ymax), this is for 2D case + Lately we'll extend this code to support more dimensions + */ + column->length=4*sizeof(double); + } + } if (!(sql_field->flags & NOT_NULL_FLAG)) { if (key->type == Key::PRIMARY) @@ -757,6 +760,9 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, DBUG_RETURN(-1); } } + else if (f_is_geom(sql_field->pack_flag)) + { + } else if (column->length > length || ((f_is_packed(sql_field->pack_flag) || ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) && -- cgit v1.2.1