summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-06-09 20:18:53 +0200
committerSergei Golubchik <sergii@pisem.net>2014-06-09 20:18:53 +0200
commit2510f9c6066f8702fad6865330bf99031f9b4b60 (patch)
tree69062a5c22cab8230db8424fe4475b41c1ccbf03 /sql/sql_select.h
parentdc9b2a95bff1fbcd5cb9f91a0ed3ba9caef17c49 (diff)
downloadmariadb-git-2510f9c6066f8702fad6865330bf99031f9b4b60.tar.gz
cleanup: remove special case from store_key::store_key(), add Field_blob::new_key_field
(prep for MDEV-6065)
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index bc6aa1eda1e..dc86825e8e9 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1548,21 +1548,8 @@ public:
store_key(THD *thd, Field *field_arg, uchar *ptr, uchar *null, uint length)
:null_key(0), null_ptr(null), err(0)
{
- if (field_arg->type() == MYSQL_TYPE_BLOB
- || field_arg->type() == MYSQL_TYPE_GEOMETRY)
- {
- /*
- Key segments are always packed with a 2 byte length prefix.
- See mi_rkey for details.
- */
- to_field= new Field_varstring(ptr, length, 2, null, 1,
- Field::NONE, field_arg->field_name,
- field_arg->table->s, field_arg->charset());
- to_field->init(field_arg->table);
- }
- else
- to_field=field_arg->new_key_field(thd->mem_root, field_arg->table,
- ptr, null, 1);
+ to_field=field_arg->new_key_field(thd->mem_root, field_arg->table,
+ ptr, length, null, 1);
}
store_key(store_key &arg)
:Sql_alloc(), null_key(arg.null_key), to_field(arg.to_field),