diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-02-17 16:47:48 +0400 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-02-17 16:47:48 +0400 |
commit | 2b141612128d90e62032f5a898b3e14df96ef2cf (patch) | |
tree | d12f49eb13f17341ac554a3a473b0b491177db2f /sql | |
parent | b3982368a8607db812ac548a6f29a4762f05cd06 (diff) | |
download | mariadb-git-2b141612128d90e62032f5a898b3e14df96ef2cf.tar.gz |
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
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 1 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 22 |
3 files changed, 15 insertions, 10 deletions
diff --git a/sql/field.cc b/sql/field.cc index 697de878c03..e6de2dc5224 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4530,7 +4530,6 @@ void Field_geom::get_key_image(char *buff,uint length,CHARSET_INFO *cs, ulong blob_length=get_length(ptr); char *blob; get_ptr(&blob); - memcpy(buff+2,blob,length); MBR mbr; Geometry gobj; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 9c546c99057..80f1e52954c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2153,7 +2153,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, if (tmp_min_flag & GEOM_FLAG) { tmp= param->table->file-> - records_in_range((int) keynr, (byte*)(param->min_key + 1), + records_in_range((int) keynr, (byte*)(param->min_key), min_key_length, (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG), (byte *)NullS, 0, HA_READ_KEY_EXACT); 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) && |