summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2005-03-16 10:35:18 +0200
committerunknown <jan@hundin.mysql.fi>2005-03-16 10:35:18 +0200
commit97a281f5177259b3621e69619d8c033310973749 (patch)
tree2f7ed6e331ec79fb63ee43c25d4d4f9e7c5de442 /innobase/row
parent6f36a062c96cfa8e178b27f7819e58305596b2a6 (diff)
downloadmariadb-git-97a281f5177259b3621e69619d8c033310973749.tar.gz
Fixed a core dump bug after VARCHAR push in InnoDB.
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0sel.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index a09e09342e0..48bca5d7b6f 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2100,9 +2100,12 @@ row_sel_convert_mysql_key_to_innobase(
/* Calculate data length and data field total length */
- if (type == DATA_BLOB) {
- /* The key field is a column prefix of a BLOB or
- TEXT type column */
+ if (type == DATA_BLOB || ( type == DATA_VARCHAR &&
+ dtype_get_mysql_type(dfield_get_type(dfield))
+ == DATA_MYSQL_TRUE_VARCHAR)) {
+
+ /* The key field is a column prefix of a BLOB,
+ TEXT, OR TRUE VARCHAR type column */
ut_a(field->prefix_len > 0);
@@ -2118,7 +2121,10 @@ row_sel_convert_mysql_key_to_innobase(
data_len = key_ptr[data_offset]
+ 256 * key_ptr[data_offset + 1];
data_field_len = data_offset + 2 + field->prefix_len;
- data_offset += 2;
+
+ if (type == DATA_BLOB) {
+ data_offset += 2;
+ }
/* now that we know the length, we store the column
value like it would be a fixed char field */