diff options
Diffstat (limited to 'include/my_base.h')
-rw-r--r-- | include/my_base.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/my_base.h b/include/my_base.h index 88d3ec0b270..b300adc3adf 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -181,8 +181,12 @@ enum ha_base_keytype { HA_KEYTYPE_INT24=12, HA_KEYTYPE_UINT24=13, HA_KEYTYPE_INT8=14, - HA_KEYTYPE_VARTEXT=15, /* Key is sorted as letters */ - HA_KEYTYPE_VARBINARY=16 /* Key is sorted as unsigned chars */ + /* Varchar (0-255 bytes) with length packed with 1 byte */ + HA_KEYTYPE_VARTEXT1=15, /* Key is sorted as letters */ + HA_KEYTYPE_VARBINARY1=16, /* Key is sorted as unsigned chars */ + /* Varchar (0-65535 bytes) with length packed with 2 bytes */ + HA_KEYTYPE_VARTEXT2=17, /* Key is sorted as letters */ + HA_KEYTYPE_VARBINARY2=18 /* Key is sorted as unsigned chars */ }; #define HA_MAX_KEYTYPE 31 /* Must be log2-1 */ @@ -390,4 +394,6 @@ typedef ulong ha_rows; #define MAX_FILE_SIZE LONGLONG_MAX #endif +#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) + #endif /* _my_base_h */ |