summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-12-06 19:18:35 +0200
committermonty@mysql.com <>2004-12-06 19:18:35 +0200
commit77207d19f20f21c54b8d5279c6924f4c4bdaaa51 (patch)
tree44698f6f68c51daacf7552356ae071b8e8fdb035 /include
parente99d5fee828e40589d7a29b81bba32b53e94037a (diff)
parent67ce24796584e80cf843b37b09aeb794c9231190 (diff)
downloadmariadb-git-77207d19f20f21c54b8d5279c6924f4c4bdaaa51.tar.gz
Merge with new VARCHAR code
Diffstat (limited to 'include')
-rw-r--r--include/decimal.h2
-rw-r--r--include/m_ctype.h6
-rw-r--r--include/my_base.h10
-rw-r--r--include/my_handler.h7
-rw-r--r--include/mysql_com.h2
5 files changed, 20 insertions, 7 deletions
diff --git a/include/decimal.h b/include/decimal.h
index fddae1f54a6..4d1fbfddc01 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -17,8 +17,6 @@
#ifndef _decimal_h
#define _decimal_h
-#include <my_global.h>
-
typedef enum {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} decimal_round_mode;
typedef int32 decimal_digit;
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 26e285b9683..d7a4af08b0f 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -106,7 +106,8 @@ typedef struct my_collation_handler_st
int (*strnncoll)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint, my_bool);
int (*strnncollsp)(struct charset_info_st *,
- const uchar *, uint, const uchar *, uint);
+ const uchar *, uint, const uchar *, uint,
+ my_bool diff_if_only_endspace_difference);
int (*strnxfrm)(struct charset_info_st *,
uchar *, uint, const uchar *, uint);
my_bool (*like_range)(struct charset_info_st *,
@@ -259,7 +260,8 @@ extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint, my_bool);
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
- const uchar *, uint);
+ const uchar *, uint,
+ my_bool diff_if_only_endspace_difference);
extern void my_hash_sort_simple(CHARSET_INFO *cs,
const uchar *key, uint len,
diff --git a/include/my_base.h b/include/my_base.h
index 815a1c76c0e..88d3ec0b270 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -213,7 +213,7 @@ enum ha_base_keytype {
/*
Key has a part that can have end space. If this is an unique key
we have to handle it differently from other unique keys as we can find
- many matching rows for one key (becaue end space are not compared)
+ many matching rows for one key (because end space are not compared)
*/
#define HA_END_SPACE_KEY 4096
@@ -221,12 +221,17 @@ enum ha_base_keytype {
#define HA_SPACE_PACK 1 /* Pack space in key-seg */
#define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */
-#define HA_VAR_LENGTH 8
+#define HA_VAR_LENGTH_PART 8
#define HA_NULL_PART 16
#define HA_BLOB_PART 32
#define HA_SWAP_KEY 64
#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
+/*
+ End space in unique/varchar are considered equal. (Like 'a' and 'a ')
+ Only needed for internal temporary tables.
+*/
+#define HA_END_SPACE_ARE_EQUAL 512
/* optionbits for database */
#define HA_OPTION_PACK_RECORD 1
@@ -345,6 +350,7 @@ enum ha_base_keytype {
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */
#define HA_STATE_EXTEND_BLOCK 2048
+#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */
enum en_fieldtype {
FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
diff --git a/include/my_handler.h b/include/my_handler.h
index 18a6234d3f6..d81c4590f8e 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -57,6 +57,13 @@ typedef struct st_HA_KEYSEG /* Key-portion */
{ length=mi_uint2korr((key)+1); (key)+=3; length_pack=3; } \
}
+#define store_key_length_inc(key,length) \
+{ if ((length) < 255) \
+ { *(key)++=(length); } \
+ else \
+ { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
+}
+
extern int mi_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
my_bool, my_bool);
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 92a67ac0279..6a03fe90eb5 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -209,7 +209,7 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
- MYSQL_TYPE_NEWDATE,
+ MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,