summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2005-04-04 20:31:04 +0300
committerunknown <heikki@hundin.mysql.fi>2005-04-04 20:31:04 +0300
commit1b93271393b58e67cb2927a82fa297a1076ce534 (patch)
tree429bfb11722183480e8946863cd51d44937a9dcd /innobase
parentb1a9b761711d94c272346292404349e1bb207d4e (diff)
downloadmariadb-git-1b93271393b58e67cb2927a82fa297a1076ce534.tar.gz
ha_innodb.cc, row0sel.c:
Fix Bug #9526 in 5.0: MySQL ENUM and SET columns are internally actually unsigned integer types; we must take care that old tables still treat ENUM and SET (incorrectly) as a character string, while new created tables treat it correctly as an unsigned integer innobase/row/row0sel.c: Fix Bug #9526 in 5.0: MySQL ENUM and SET columns are internally actually unsigned integer types; we must take care that old tables still treat ENUM and SET (incorrectly) as a character string, while new created tables treat it correctly as an unsigned integer sql/ha_innodb.cc: Fix Bug #9526 in 5.0: MySQL ENUM and SET columns are internally actually unsigned integer types; we must take care that old tables still treat ENUM and SET (incorrectly) as a character string, while new created tables treat it correctly as an unsigned integer
Diffstat (limited to 'innobase')
-rw-r--r--innobase/row/row0sel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 10fc89bbb37..09a6f1eacff 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2145,12 +2145,16 @@ row_sel_convert_mysql_key_to_innobase(
}
if (dtype_get_mysql_type(dfield_get_type(dfield))
- == DATA_MYSQL_TRUE_VARCHAR) {
+ == DATA_MYSQL_TRUE_VARCHAR
+ && dfield_get_type(dfield)->mtype != DATA_INT) {
/* In a MySQL key value format, a true VARCHAR is
always preceded by 2 bytes of a length field.
dfield_get_type(dfield)->len returns the maximum
'payload' len in bytes. That does not include the
- 2 bytes that tell the actual data length. */
+ 2 bytes that tell the actual data length.
+
+ We added the check != DATA_INT to make sure we do
+ not treat MySQL ENUM or SET as a true VARCHAR! */
data_len += 2;
data_field_len += 2;