mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
This commit is contained in:
commit
62179ccb22
66 changed files with 390 additions and 683 deletions
|
@ -939,7 +939,8 @@ static COMMANDS *find_command (char *name,char cmd_char)
|
|||
{
|
||||
if (commands[i].func &&
|
||||
((name &&
|
||||
!my_strncasecmp(charset_info,name,commands[i].name,len) &&
|
||||
!my_strnncoll(charset_info,(uchar*)name,len,
|
||||
(uchar*)commands[i].name,len) &&
|
||||
!commands[i].name[len] &&
|
||||
(!end || (end && commands[i].takes_params))) ||
|
||||
!name && commands[i].cmd_char == cmd_char))
|
||||
|
|
|
@ -184,135 +184,135 @@ private const el_action_t el_map_emacs[] = {
|
|||
/* 124 */ ED_INSERT, /* | */
|
||||
/* 125 */ ED_INSERT, /* } */
|
||||
/* 126 */ ED_INSERT, /* ~ */
|
||||
/* 127 */ ED_DELETE_PREV_CHAR, /* ^? */
|
||||
/* 128 */ ED_UNASSIGNED, /* M-^@ */
|
||||
/* 129 */ ED_UNASSIGNED, /* M-^A */
|
||||
/* 130 */ ED_UNASSIGNED, /* M-^B */
|
||||
/* 131 */ ED_UNASSIGNED, /* M-^C */
|
||||
/* 132 */ ED_UNASSIGNED, /* M-^D */
|
||||
/* 133 */ ED_UNASSIGNED, /* M-^E */
|
||||
/* 134 */ ED_UNASSIGNED, /* M-^F */
|
||||
/* 135 */ ED_UNASSIGNED, /* M-^G */
|
||||
/* 136 */ ED_DELETE_PREV_WORD, /* M-^H */
|
||||
/* 137 */ ED_UNASSIGNED, /* M-^I */
|
||||
/* 138 */ ED_UNASSIGNED, /* M-^J */
|
||||
/* 139 */ ED_UNASSIGNED, /* M-^K */
|
||||
/* 140 */ ED_CLEAR_SCREEN, /* M-^L */
|
||||
/* 141 */ ED_UNASSIGNED, /* M-^M */
|
||||
/* 142 */ ED_UNASSIGNED, /* M-^N */
|
||||
/* 143 */ ED_UNASSIGNED, /* M-^O */
|
||||
/* 144 */ ED_UNASSIGNED, /* M-^P */
|
||||
/* 145 */ ED_UNASSIGNED, /* M-^Q */
|
||||
/* 146 */ ED_UNASSIGNED, /* M-^R */
|
||||
/* 147 */ ED_UNASSIGNED, /* M-^S */
|
||||
/* 148 */ ED_UNASSIGNED, /* M-^T */
|
||||
/* 149 */ ED_UNASSIGNED, /* M-^U */
|
||||
/* 150 */ ED_UNASSIGNED, /* M-^V */
|
||||
/* 151 */ ED_UNASSIGNED, /* M-^W */
|
||||
/* 152 */ ED_UNASSIGNED, /* M-^X */
|
||||
/* 153 */ ED_UNASSIGNED, /* M-^Y */
|
||||
/* 154 */ ED_UNASSIGNED, /* M-^Z */
|
||||
/* 155 */ ED_UNASSIGNED, /* M-^[ */
|
||||
/* 156 */ ED_UNASSIGNED, /* M-^\ */
|
||||
/* 157 */ ED_UNASSIGNED, /* M-^] */
|
||||
/* 158 */ ED_UNASSIGNED, /* M-^^ */
|
||||
/* 159 */ EM_COPY_PREV_WORD, /* M-^_ */
|
||||
/* 160 */ ED_UNASSIGNED, /* M-SPACE */
|
||||
/* 161 */ ED_UNASSIGNED, /* M-! */
|
||||
/* 162 */ ED_UNASSIGNED, /* M-" */
|
||||
/* 163 */ ED_UNASSIGNED, /* M-# */
|
||||
/* 164 */ ED_UNASSIGNED, /* M-$ */
|
||||
/* 165 */ ED_UNASSIGNED, /* M-% */
|
||||
/* 166 */ ED_UNASSIGNED, /* M-& */
|
||||
/* 167 */ ED_UNASSIGNED, /* M-' */
|
||||
/* 168 */ ED_UNASSIGNED, /* M-( */
|
||||
/* 169 */ ED_UNASSIGNED, /* M-) */
|
||||
/* 170 */ ED_UNASSIGNED, /* M-* */
|
||||
/* 171 */ ED_UNASSIGNED, /* M-+ */
|
||||
/* 172 */ ED_UNASSIGNED, /* M-, */
|
||||
/* 173 */ ED_UNASSIGNED, /* M-- */
|
||||
/* 174 */ ED_UNASSIGNED, /* M-. */
|
||||
/* 175 */ ED_UNASSIGNED, /* M-/ */
|
||||
/* 176 */ ED_ARGUMENT_DIGIT, /* M-0 */
|
||||
/* 177 */ ED_ARGUMENT_DIGIT, /* M-1 */
|
||||
/* 178 */ ED_ARGUMENT_DIGIT, /* M-2 */
|
||||
/* 179 */ ED_ARGUMENT_DIGIT, /* M-3 */
|
||||
/* 180 */ ED_ARGUMENT_DIGIT, /* M-4 */
|
||||
/* 181 */ ED_ARGUMENT_DIGIT, /* M-5 */
|
||||
/* 182 */ ED_ARGUMENT_DIGIT, /* M-6 */
|
||||
/* 183 */ ED_ARGUMENT_DIGIT, /* M-7 */
|
||||
/* 184 */ ED_ARGUMENT_DIGIT, /* M-8 */
|
||||
/* 185 */ ED_ARGUMENT_DIGIT, /* M-9 */
|
||||
/* 186 */ ED_UNASSIGNED, /* M-: */
|
||||
/* 187 */ ED_UNASSIGNED, /* M-; */
|
||||
/* 188 */ ED_UNASSIGNED, /* M-< */
|
||||
/* 189 */ ED_UNASSIGNED, /* M-= */
|
||||
/* 190 */ ED_UNASSIGNED, /* M-> */
|
||||
/* 191 */ ED_UNASSIGNED, /* M-? */
|
||||
/* 192 */ ED_UNASSIGNED, /* M-@ */
|
||||
/* 193 */ ED_UNASSIGNED, /* M-A */
|
||||
/* 194 */ ED_PREV_WORD, /* M-B */
|
||||
/* 195 */ EM_CAPITOL_CASE, /* M-C */
|
||||
/* 196 */ EM_DELETE_NEXT_WORD, /* M-D */
|
||||
/* 197 */ ED_UNASSIGNED, /* M-E */
|
||||
/* 198 */ EM_NEXT_WORD, /* M-F */
|
||||
/* 199 */ ED_UNASSIGNED, /* M-G */
|
||||
/* 200 */ ED_UNASSIGNED, /* M-H */
|
||||
/* 201 */ ED_UNASSIGNED, /* M-I */
|
||||
/* 202 */ ED_UNASSIGNED, /* M-J */
|
||||
/* 203 */ ED_UNASSIGNED, /* M-K */
|
||||
/* 204 */ EM_LOWER_CASE, /* M-L */
|
||||
/* 205 */ ED_UNASSIGNED, /* M-M */
|
||||
/* 206 */ ED_SEARCH_NEXT_HISTORY, /* M-N */
|
||||
/* 207 */ ED_SEQUENCE_LEAD_IN, /* M-O */
|
||||
/* 208 */ ED_SEARCH_PREV_HISTORY, /* M-P */
|
||||
/* 209 */ ED_UNASSIGNED, /* M-Q */
|
||||
/* 210 */ ED_UNASSIGNED, /* M-R */
|
||||
/* 211 */ ED_UNASSIGNED, /* M-S */
|
||||
/* 212 */ ED_UNASSIGNED, /* M-T */
|
||||
/* 213 */ EM_UPPER_CASE, /* M-U */
|
||||
/* 214 */ ED_UNASSIGNED, /* M-V */
|
||||
/* 215 */ EM_COPY_REGION, /* M-W */
|
||||
/* 216 */ ED_COMMAND, /* M-X */
|
||||
/* 217 */ ED_UNASSIGNED, /* M-Y */
|
||||
/* 218 */ ED_UNASSIGNED, /* M-Z */
|
||||
/* 219 */ ED_SEQUENCE_LEAD_IN, /* M-[ */
|
||||
/* 220 */ ED_UNASSIGNED, /* M-\ */
|
||||
/* 221 */ ED_UNASSIGNED, /* M-] */
|
||||
/* 222 */ ED_UNASSIGNED, /* M-^ */
|
||||
/* 223 */ ED_UNASSIGNED, /* M-_ */
|
||||
/* 223 */ ED_UNASSIGNED, /* M-` */
|
||||
/* 224 */ ED_UNASSIGNED, /* M-a */
|
||||
/* 225 */ ED_PREV_WORD, /* M-b */
|
||||
/* 226 */ EM_CAPITOL_CASE, /* M-c */
|
||||
/* 227 */ EM_DELETE_NEXT_WORD, /* M-d */
|
||||
/* 228 */ ED_UNASSIGNED, /* M-e */
|
||||
/* 229 */ EM_NEXT_WORD, /* M-f */
|
||||
/* 230 */ ED_UNASSIGNED, /* M-g */
|
||||
/* 231 */ ED_UNASSIGNED, /* M-h */
|
||||
/* 232 */ ED_UNASSIGNED, /* M-i */
|
||||
/* 233 */ ED_UNASSIGNED, /* M-j */
|
||||
/* 234 */ ED_UNASSIGNED, /* M-k */
|
||||
/* 235 */ EM_LOWER_CASE, /* M-l */
|
||||
/* 236 */ ED_UNASSIGNED, /* M-m */
|
||||
/* 237 */ ED_SEARCH_NEXT_HISTORY, /* M-n */
|
||||
/* 238 */ ED_UNASSIGNED, /* M-o */
|
||||
/* 239 */ ED_SEARCH_PREV_HISTORY, /* M-p */
|
||||
/* 240 */ ED_UNASSIGNED, /* M-q */
|
||||
/* 241 */ ED_UNASSIGNED, /* M-r */
|
||||
/* 242 */ ED_UNASSIGNED, /* M-s */
|
||||
/* 243 */ ED_UNASSIGNED, /* M-t */
|
||||
/* 244 */ EM_UPPER_CASE, /* M-u */
|
||||
/* 245 */ ED_UNASSIGNED, /* M-v */
|
||||
/* 246 */ EM_COPY_REGION, /* M-w */
|
||||
/* 247 */ ED_COMMAND, /* M-x */
|
||||
/* 248 */ ED_UNASSIGNED, /* M-y */
|
||||
/* 249 */ ED_UNASSIGNED, /* M-z */
|
||||
/* 250 */ ED_UNASSIGNED, /* M-{ */
|
||||
/* 251 */ ED_UNASSIGNED, /* M-| */
|
||||
/* 252 */ ED_UNASSIGNED, /* M-} */
|
||||
/* 253 */ ED_UNASSIGNED, /* M-~ */
|
||||
/* 254 */ ED_DELETE_PREV_WORD /* M-^? */
|
||||
/* 127 */ ED_INSERT, /* ^? */
|
||||
/* 128 */ ED_INSERT, /* M-^@ */
|
||||
/* 129 */ ED_INSERT, /* M-^A */
|
||||
/* 130 */ ED_INSERT, /* M-^B */
|
||||
/* 131 */ ED_INSERT, /* M-^C */
|
||||
/* 132 */ ED_INSERT, /* M-^D */
|
||||
/* 133 */ ED_INSERT, /* M-^E */
|
||||
/* 134 */ ED_INSERT, /* M-^F */
|
||||
/* 135 */ ED_INSERT, /* M-^G */
|
||||
/* 136 */ ED_INSERT, /* M-^H */
|
||||
/* 137 */ ED_INSERT, /* M-^I */
|
||||
/* 138 */ ED_INSERT, /* M-^J */
|
||||
/* 139 */ ED_INSERT, /* M-^K */
|
||||
/* 140 */ ED_INSERT, /* M-^L */
|
||||
/* 141 */ ED_INSERT, /* M-^M */
|
||||
/* 142 */ ED_INSERT, /* M-^N */
|
||||
/* 143 */ ED_INSERT, /* M-^O */
|
||||
/* 144 */ ED_INSERT, /* M-^P */
|
||||
/* 145 */ ED_INSERT, /* M-^Q */
|
||||
/* 146 */ ED_INSERT, /* M-^R */
|
||||
/* 147 */ ED_INSERT, /* M-^S */
|
||||
/* 148 */ ED_INSERT, /* M-^T */
|
||||
/* 149 */ ED_INSERT, /* M-^U */
|
||||
/* 150 */ ED_INSERT, /* M-^V */
|
||||
/* 151 */ ED_INSERT, /* M-^W */
|
||||
/* 152 */ ED_INSERT, /* M-^X */
|
||||
/* 153 */ ED_INSERT, /* M-^Y */
|
||||
/* 154 */ ED_INSERT, /* M-^Z */
|
||||
/* 155 */ ED_INSERT, /* M-^[ */
|
||||
/* 156 */ ED_INSERT, /* M-^\ */
|
||||
/* 157 */ ED_INSERT, /* M-^] */
|
||||
/* 158 */ ED_INSERT, /* M-^^ */
|
||||
/* 159 */ ED_INSERT, /* M-^_ */
|
||||
/* 160 */ ED_INSERT, /* M-SPACE */
|
||||
/* 161 */ ED_INSERT, /* M-! */
|
||||
/* 162 */ ED_INSERT, /* M-" */
|
||||
/* 163 */ ED_INSERT, /* M-# */
|
||||
/* 164 */ ED_INSERT, /* M-$ */
|
||||
/* 165 */ ED_INSERT, /* M-% */
|
||||
/* 166 */ ED_INSERT, /* M-& */
|
||||
/* 167 */ ED_INSERT, /* M-' */
|
||||
/* 168 */ ED_INSERT, /* M-( */
|
||||
/* 169 */ ED_INSERT, /* M-) */
|
||||
/* 170 */ ED_INSERT, /* M-* */
|
||||
/* 171 */ ED_INSERT, /* M-+ */
|
||||
/* 172 */ ED_INSERT, /* M-, */
|
||||
/* 173 */ ED_INSERT, /* M-- */
|
||||
/* 174 */ ED_INSERT, /* M-. */
|
||||
/* 175 */ ED_INSERT, /* M-/ */
|
||||
/* 176 */ ED_INSERT, /* M-0 */
|
||||
/* 177 */ ED_INSERT, /* M-1 */
|
||||
/* 178 */ ED_INSERT, /* M-2 */
|
||||
/* 179 */ ED_INSERT, /* M-3 */
|
||||
/* 180 */ ED_INSERT, /* M-4 */
|
||||
/* 181 */ ED_INSERT, /* M-5 */
|
||||
/* 182 */ ED_INSERT, /* M-6 */
|
||||
/* 183 */ ED_INSERT, /* M-7 */
|
||||
/* 184 */ ED_INSERT, /* M-8 */
|
||||
/* 185 */ ED_INSERT, /* M-9 */
|
||||
/* 186 */ ED_INSERT, /* M-: */
|
||||
/* 187 */ ED_INSERT, /* M-; */
|
||||
/* 188 */ ED_INSERT, /* M-< */
|
||||
/* 189 */ ED_INSERT, /* M-= */
|
||||
/* 190 */ ED_INSERT, /* M-> */
|
||||
/* 191 */ ED_INSERT, /* M-? */
|
||||
/* 192 */ ED_INSERT, /* M-@ */
|
||||
/* 193 */ ED_INSERT, /* M-A */
|
||||
/* 194 */ ED_INSERT, /* M-B */
|
||||
/* 195 */ ED_INSERT, /* M-C */
|
||||
/* 196 */ ED_INSERT, /* M-D */
|
||||
/* 197 */ ED_INSERT, /* M-E */
|
||||
/* 198 */ ED_INSERT, /* M-F */
|
||||
/* 199 */ ED_INSERT, /* M-G */
|
||||
/* 200 */ ED_INSERT, /* M-H */
|
||||
/* 201 */ ED_INSERT, /* M-I */
|
||||
/* 202 */ ED_INSERT, /* M-J */
|
||||
/* 203 */ ED_INSERT, /* M-K */
|
||||
/* 204 */ ED_INSERT, /* M-L */
|
||||
/* 205 */ ED_INSERT, /* M-M */
|
||||
/* 206 */ ED_INSERT, /* M-N */
|
||||
/* 207 */ ED_INSERT, /* M-O */
|
||||
/* 208 */ ED_INSERT, /* M-P */
|
||||
/* 209 */ ED_INSERT, /* M-Q */
|
||||
/* 210 */ ED_INSERT, /* M-R */
|
||||
/* 211 */ ED_INSERT, /* M-S */
|
||||
/* 212 */ ED_INSERT, /* M-T */
|
||||
/* 213 */ ED_INSERT, /* M-U */
|
||||
/* 214 */ ED_INSERT, /* M-V */
|
||||
/* 215 */ ED_INSERT, /* M-W */
|
||||
/* 216 */ ED_INSERT, /* M-X */
|
||||
/* 217 */ ED_INSERT, /* M-Y */
|
||||
/* 218 */ ED_INSERT, /* M-Z */
|
||||
/* 219 */ ED_INSERT, /* M-[ */
|
||||
/* 220 */ ED_INSERT, /* M-\ */
|
||||
/* 221 */ ED_INSERT, /* M-] */
|
||||
/* 222 */ ED_INSERT, /* M-^ */
|
||||
/* 223 */ ED_INSERT, /* M-_ */
|
||||
/* 223 */ ED_INSERT, /* M-` */
|
||||
/* 224 */ ED_INSERT, /* M-a */
|
||||
/* 225 */ ED_INSERT, /* M-b */
|
||||
/* 226 */ ED_INSERT, /* M-c */
|
||||
/* 227 */ ED_INSERT, /* M-d */
|
||||
/* 228 */ ED_INSERT, /* M-e */
|
||||
/* 229 */ ED_INSERT, /* M-f */
|
||||
/* 230 */ ED_INSERT, /* M-g */
|
||||
/* 231 */ ED_INSERT, /* M-h */
|
||||
/* 232 */ ED_INSERT, /* M-i */
|
||||
/* 233 */ ED_INSERT, /* M-j */
|
||||
/* 234 */ ED_INSERT, /* M-k */
|
||||
/* 235 */ ED_INSERT, /* M-l */
|
||||
/* 236 */ ED_INSERT, /* M-m */
|
||||
/* 237 */ ED_INSERT, /* M-n */
|
||||
/* 238 */ ED_INSERT, /* M-o */
|
||||
/* 239 */ ED_INSERT, /* M-p */
|
||||
/* 240 */ ED_INSERT, /* M-q */
|
||||
/* 241 */ ED_INSERT, /* M-r */
|
||||
/* 242 */ ED_INSERT, /* M-s */
|
||||
/* 243 */ ED_INSERT, /* M-t */
|
||||
/* 244 */ ED_INSERT, /* M-u */
|
||||
/* 245 */ ED_INSERT, /* M-v */
|
||||
/* 246 */ ED_INSERT, /* M-w */
|
||||
/* 247 */ ED_INSERT, /* M-x */
|
||||
/* 248 */ ED_INSERT, /* M-y */
|
||||
/* 249 */ ED_INSERT, /* M-z */
|
||||
/* 250 */ ED_INSERT, /* M-{ */
|
||||
/* 251 */ ED_INSERT, /* M-| */
|
||||
/* 252 */ ED_INSERT, /* M-} */
|
||||
/* 253 */ ED_INSERT, /* M-~ */
|
||||
/* 254 */ ED_INSERT /* M-^? */
|
||||
/* 255 */
|
||||
};
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ private void
|
|||
re_addc(EditLine *el, int c)
|
||||
{
|
||||
|
||||
if (isprint(c)) {
|
||||
if (isprint(c) || ((unsigned char)c)>127) {
|
||||
re_putc(el, c, 1);
|
||||
return;
|
||||
}
|
||||
|
@ -954,7 +954,7 @@ re_refresh_cursor(EditLine *el)
|
|||
h = 1;
|
||||
v++;
|
||||
}
|
||||
} else if (!isprint((unsigned char) c)) {
|
||||
} else if (!isprint((unsigned char) c) || ((unsigned char)c)>127) {
|
||||
h += 3;
|
||||
if (h > th) { /* if overflow, compensate */
|
||||
h = h - th;
|
||||
|
@ -1047,7 +1047,7 @@ re_fastaddc(EditLine *el)
|
|||
char mc = (c == '\177') ? '?' : (c | 0100);
|
||||
re_fastputc(el, '^');
|
||||
re_fastputc(el, mc);
|
||||
} else if (isprint((unsigned char) c)) { /* normal char */
|
||||
} else if (isprint((unsigned char) c) || ((unsigned char)c)>127) { /* normal char */
|
||||
re_fastputc(el, c);
|
||||
} else {
|
||||
re_fastputc(el, '\\');
|
||||
|
|
|
@ -25,9 +25,6 @@ extern "C" {
|
|||
typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
|
||||
typedef void (*hash_free_key)(void *);
|
||||
|
||||
/* flags for hash_init */
|
||||
#define HASH_CASE_INSENSITIVE 1
|
||||
|
||||
typedef struct st_hash_info {
|
||||
uint next; /* index to next key */
|
||||
byte *data; /* data for current entry */
|
||||
|
@ -40,7 +37,6 @@ typedef struct st_hash {
|
|||
DYNAMIC_ARRAY array; /* Place for hash_keys */
|
||||
hash_get_key get_key;
|
||||
void (*free)(void *);
|
||||
uint (*calc_hashnr)(CHARSET_INFO *cs, const byte *key,uint length);
|
||||
CHARSET_INFO *charset;
|
||||
} HASH;
|
||||
|
||||
|
|
|
@ -131,7 +131,6 @@ typedef struct charset_info_st
|
|||
/* Multibyte routines */
|
||||
uint mbmaxlen;
|
||||
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
|
||||
my_bool (*ismbhead)(struct charset_info_st *, uint);
|
||||
int (*mbcharlen)(struct charset_info_st *, uint);
|
||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||
|
@ -147,15 +146,11 @@ typedef struct charset_info_st
|
|||
void (*casedn_str)(struct charset_info_st *, char *);
|
||||
void (*caseup)(struct charset_info_st *, char *, uint);
|
||||
void (*casedn)(struct charset_info_st *, char *, uint);
|
||||
void (*tosort)(struct charset_info_st *, char *, uint);
|
||||
|
||||
/* Functions for case comparison */
|
||||
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
|
||||
int (*strncasecmp)(struct charset_info_st *, const char *, const char *,
|
||||
uint);
|
||||
|
||||
/* Hash calculation */
|
||||
uint (*hash_caseup)(struct charset_info_st *cs, const byte *key, uint len);
|
||||
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
|
||||
|
@ -218,9 +213,6 @@ extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
|||
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint);
|
||||
|
||||
extern uint my_hash_caseup_simple(CHARSET_INFO *cs,
|
||||
const byte *key, uint len);
|
||||
|
||||
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
|
@ -231,11 +223,8 @@ extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
|
|||
extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
|
||||
extern void my_caseup_8bit(CHARSET_INFO *, char *, uint);
|
||||
extern void my_casedn_8bit(CHARSET_INFO *, char *, uint);
|
||||
extern void my_tosort_8bit(CHARSET_INFO *, char *, uint);
|
||||
|
||||
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
||||
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *,
|
||||
uint);
|
||||
|
||||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
||||
|
@ -287,8 +276,7 @@ extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
|||
extern void my_caseup_mb(CHARSET_INFO *, char *, uint);
|
||||
extern void my_casedn_mb(CHARSET_INFO *, char *, uint);
|
||||
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
||||
extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t,
|
||||
uint);
|
||||
|
||||
int my_wildcmp_mb(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
|
@ -339,16 +327,13 @@ uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
|||
|
||||
#define use_mb(s) ((s)->ismbchar != NULL)
|
||||
#define my_ismbchar(s, a, b) ((s)->ismbchar((s), (a), (b)))
|
||||
#define my_ismbhead(s, a) ((s)->ismbhead((s), (a)))
|
||||
#define my_mbcharlen(s, a) ((s)->mbcharlen((s),(a)))
|
||||
|
||||
#define my_caseup(s, a, l) ((s)->caseup((s), (a), (l)))
|
||||
#define my_casedn(s, a, l) ((s)->casedn((s), (a), (l)))
|
||||
#define my_tosort(s, a, l) ((s)->tosort((s), (a), (l)))
|
||||
#define my_caseup_str(s, a) ((s)->caseup_str((s), (a)))
|
||||
#define my_casedn_str(s, a) ((s)->casedn_str((s), (a)))
|
||||
#define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b)))
|
||||
#define my_strncasecmp(s, a, b, l) ((s)->strncasecmp((s), (a), (b), (l)))
|
||||
|
||||
#define my_strntol(s, a, b, c, d, e) ((s)->strntol((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoul(s, a, b, c, d, e) ((s)->strntoul((s),(a),(b),(c),(d),(e)))
|
||||
|
|
11
isam/_key.c
11
isam/_key.c
|
@ -56,7 +56,8 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
|
|||
if (!use_strnxfrm(default_charset_info))
|
||||
{
|
||||
if (type == HA_KEYTYPE_TEXT)
|
||||
my_tosort(default_charset_info,(byte*) key,length);
|
||||
my_strnxfrm(default_charset_info,(uchar*) key, length,
|
||||
(uchar*) key, length);
|
||||
}
|
||||
key+=length;
|
||||
}
|
||||
|
@ -67,7 +68,10 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
|
|||
if (!use_strnxfrm(default_charset_info))
|
||||
{
|
||||
if (type == HA_KEYTYPE_TEXT)
|
||||
my_tosort(default_charset_info,(byte*) key,(uint) keyseg->base.length);
|
||||
my_strnxfrm(default_charset_info,(uchar*) key,
|
||||
(uint) keyseg->base.length,
|
||||
(uchar*) key,
|
||||
(uint) keyseg->base.length);
|
||||
}
|
||||
#ifdef NAN_TEST
|
||||
else if (type == HA_KEYTYPE_FLOAT)
|
||||
|
@ -148,7 +152,8 @@ uint _nisam_pack_key(register N_INFO *info, uint keynr, uchar *key, uchar *old,
|
|||
if (!use_strnxfrm(default_charset_info))
|
||||
{
|
||||
if (type == HA_KEYTYPE_TEXT)
|
||||
my_tosort(default_charset_info,(byte*) key,length);
|
||||
my_strnxfrm(default_charset_info,(uchar*) key,length,
|
||||
(uchar*) key,length);
|
||||
}
|
||||
key+= length;
|
||||
}
|
||||
|
|
|
@ -340,6 +340,6 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
|
|||
my_afree((byte*)new_page);
|
||||
|
||||
split_err:
|
||||
my_afree((byte*)coord_buf);
|
||||
my_free((gptr) coord_buf, MYF(0));
|
||||
return err_code;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ SHOW FULL COLUMNS FROM t1;
|
|||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
GROUP_ID int(10) unsigned binary PRI 0 select,insert,update,references
|
||||
LANG_ID smallint(5) unsigned binary PRI 0 select,insert,update,references
|
||||
NAME char(80) latin1 MUL select,insert,update,references
|
||||
NAME char(80) latin1_swedish_ci MUL select,insert,update,references
|
||||
DROP TABLE t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values(9),(3),(12),(10);
|
||||
|
@ -120,5 +120,5 @@ alter table t2 rename t1, add c char(10) comment "no comment";
|
|||
show columns from t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
i int(10) unsigned binary PRI NULL auto_increment
|
||||
c char(10) latin1 YES NULL
|
||||
c char(10) latin1_swedish_ci YES NULL
|
||||
drop table t1;
|
||||
|
|
|
@ -85,17 +85,17 @@ create table t1(x varchar(50) );
|
|||
create table t2 select x from t1 where 1=2;
|
||||
describe t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
x varchar(50) latin1 YES NULL
|
||||
x varchar(50) latin1_swedish_ci YES NULL
|
||||
describe t2;
|
||||
Field Type Collation Null Key Default Extra
|
||||
x char(50) latin1 YES NULL
|
||||
x char(50) latin1_swedish_ci YES NULL
|
||||
drop table t2;
|
||||
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
|
||||
describe t2;
|
||||
Field Type Collation Null Key Default Extra
|
||||
a datetime latin1 0000-00-00 00:00:00
|
||||
b time latin1 00:00:00
|
||||
c date latin1 0000-00-00
|
||||
a datetime latin1_swedish_ci 0000-00-00 00:00:00
|
||||
b time latin1_swedish_ci 00:00:00
|
||||
c date latin1_swedish_ci 0000-00-00
|
||||
d bigint(17) binary 0
|
||||
e double(18,1) binary 0.0
|
||||
f bigint(17) binary 0
|
||||
|
@ -103,9 +103,9 @@ drop table t2;
|
|||
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
|
||||
describe t2;
|
||||
Field Type Collation Null Key Default Extra
|
||||
d date latin1 0000-00-00
|
||||
t time latin1 00:00:00
|
||||
dt datetime latin1 0000-00-00 00:00:00
|
||||
d date latin1_swedish_ci 0000-00-00
|
||||
t time latin1_swedish_ci 00:00:00
|
||||
dt datetime latin1_swedish_ci 0000-00-00 00:00:00
|
||||
drop table t1,t2;
|
||||
create table t1 (a tinyint);
|
||||
create table t2 (a int) select * from t1;
|
||||
|
|
|
@ -6,7 +6,7 @@ latin1_f CHAR(32) CHARACTER SET latin1 NOT NULL
|
|||
CREATE TABLE t2 (
|
||||
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r NOT NULL
|
||||
);
|
||||
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
|
||||
COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1'
|
||||
INSERT INTO t1 (latin1_f) VALUES (_latin1'A');
|
||||
INSERT INTO t1 (latin1_f) VALUES (_latin1'a');
|
||||
INSERT INTO t1 (latin1_f) VALUES (_latin1'AD');
|
||||
|
@ -490,7 +490,7 @@ t1 CREATE TABLE `t1` (
|
|||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
latin1_f char(32) latin1
|
||||
latin1_f char(32) latin1_swedish_ci
|
||||
ALTER TABLE t1 CHANGE latin1_f
|
||||
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
@ -513,17 +513,17 @@ latin1_f char(32) latin1_bin YES NULL
|
|||
SET NAMES 'latin1';
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation latin1
|
||||
client_collation latin1_swedish_ci
|
||||
SET NAMES latin1;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation latin1
|
||||
client_collation latin1_swedish_ci
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation latin1
|
||||
client_collation latin1_swedish_ci
|
||||
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
||||
charset('a') collation('a') coercibility('a') 'a'='A'
|
||||
latin1 latin1 3 1
|
||||
latin1 latin1_swedish_ci 3 1
|
||||
SET NAMES latin1 COLLATE latin1_bin;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
|
@ -542,33 +542,33 @@ latin1 latin1_bin 3 0
|
|||
SET NAMES koi8r;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation koi8r
|
||||
client_collation koi8r_general_ci
|
||||
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
||||
charset('a') collation('a') coercibility('a') 'a'='A'
|
||||
latin1 latin1 3 1
|
||||
latin1 latin1_swedish_ci 3 1
|
||||
SET COLLATION koi8r_bin;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation koi8r_bin
|
||||
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
||||
charset('a') collation('a') coercibility('a') 'a'='A'
|
||||
latin1 latin1 3 1
|
||||
latin1 latin1_swedish_ci 3 1
|
||||
SET COLLATION DEFAULT;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation koi8r
|
||||
client_collation koi8r_general_ci
|
||||
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
||||
charset('a') collation('a') coercibility('a') 'a'='A'
|
||||
latin1 latin1 3 1
|
||||
latin1 latin1_swedish_ci 3 1
|
||||
SET NAMES DEFAULT;
|
||||
SHOW VARIABLES LIKE 'client_collation';
|
||||
Variable_name Value
|
||||
client_collation latin1
|
||||
client_collation latin1_swedish_ci
|
||||
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
||||
charset('a') collation('a') coercibility('a') 'a'='A'
|
||||
latin1 latin1 3 1
|
||||
latin1 latin1_swedish_ci 3 1
|
||||
SET NAMES latin1 COLLATE koi8r;
|
||||
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
|
||||
COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1'
|
||||
SET NAMES 'DEFAULT';
|
||||
Unknown character set: 'DEFAULT'
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -14,7 +14,7 @@ Table Create Table
|
|||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM ÔÁÂÌÉÃÁ;
|
||||
Field Type Collation Null Key Default Extra
|
||||
ÐÏÌÅ char(32) character set koi8r koi8r
|
||||
ÐÏÌÅ char(32) character set koi8r koi8r_general_ci
|
||||
SET NAMES cp1251;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
|
@ -26,7 +26,7 @@ Table Create Table
|
|||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM òàáëèöà;
|
||||
Field Type Collation Null Key Default Extra
|
||||
ïîëå char(32) character set koi8r koi8r
|
||||
ïîëå char(32) character set koi8r koi8r_general_ci
|
||||
SET NAMES utf8;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
|
@ -38,6 +38,6 @@ Table Create Table
|
|||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM таблица;
|
||||
Field Type Collation Null Key Default Extra
|
||||
поле char(32) character set koi8r koi8r
|
||||
поле char(32) character set koi8r koi8r_general_ci
|
||||
SET NAMES koi8r;
|
||||
DROP TABLE ÔÁÂÌÉÃÁ;
|
||||
|
|
|
@ -3221,17 +3221,17 @@ Field Type Collation Null Key Default Extra Privileges Comment
|
|||
auto int(11) binary PRI NULL auto_increment select,insert,update,references
|
||||
fld1 int(6) unsigned zerofill binary UNI 000000 select,insert,update,references
|
||||
companynr tinyint(2) unsigned zerofill binary 00 select,insert,update,references
|
||||
fld3 char(30) latin1 MUL select,insert,update,references
|
||||
fld4 char(35) latin1 select,insert,update,references
|
||||
fld5 char(35) latin1 select,insert,update,references
|
||||
fld6 char(4) latin1 select,insert,update,references
|
||||
fld3 char(30) latin1_swedish_ci MUL select,insert,update,references
|
||||
fld4 char(35) latin1_swedish_ci select,insert,update,references
|
||||
fld5 char(35) latin1_swedish_ci select,insert,update,references
|
||||
fld6 char(4) latin1_swedish_ci select,insert,update,references
|
||||
show full columns from t2 from test like 'f%';
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
fld1 int(6) unsigned zerofill binary UNI 000000 select,insert,update,references
|
||||
fld3 char(30) latin1 MUL select,insert,update,references
|
||||
fld4 char(35) latin1 select,insert,update,references
|
||||
fld5 char(35) latin1 select,insert,update,references
|
||||
fld6 char(4) latin1 select,insert,update,references
|
||||
fld3 char(30) latin1_swedish_ci MUL select,insert,update,references
|
||||
fld4 char(35) latin1_swedish_ci select,insert,update,references
|
||||
fld5 char(35) latin1_swedish_ci select,insert,update,references
|
||||
fld6 char(4) latin1_swedish_ci select,insert,update,references
|
||||
show full columns from t2 from test like 's%';
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
show keys from t2;
|
||||
|
|
|
@ -99,8 +99,8 @@ t1 CREATE TABLE `t1` (
|
|||
) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table'
|
||||
show full columns from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
test_set set('val1','val2','val3') latin1 select,insert,update,references
|
||||
name char(20) latin1 YES O'Brien select,insert,update,references O'Brien as default
|
||||
test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references
|
||||
name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default
|
||||
c int(11) binary 0 select,insert,update,references int column
|
||||
drop table t1;
|
||||
create table t1 (a int not null, unique aa (a));
|
||||
|
|
|
@ -3,10 +3,10 @@ CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
|
|||
show columns from t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
a blob binary YES NULL
|
||||
b text latin1 YES NULL
|
||||
b text latin1_swedish_ci YES NULL
|
||||
c blob binary YES NULL
|
||||
d mediumtext latin1 YES NULL
|
||||
e longtext latin1 YES NULL
|
||||
d mediumtext latin1_swedish_ci YES NULL
|
||||
e longtext latin1_swedish_ci YES NULL
|
||||
CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
|
||||
Warnings:
|
||||
Warning 1244 Converting column 'a' from CHAR to TEXT
|
||||
|
@ -14,9 +14,9 @@ Warning 1244 Converting column 'b' from CHAR to BLOB
|
|||
Warning 1244 Converting column 'c' from CHAR to TEXT
|
||||
show columns from t2;
|
||||
Field Type Collation Null Key Default Extra
|
||||
a text latin1 YES NULL
|
||||
a text latin1_swedish_ci YES NULL
|
||||
b mediumblob binary YES NULL
|
||||
c longtext latin1 YES NULL
|
||||
c longtext latin1_swedish_ci YES NULL
|
||||
create table t3 (a long, b long byte);
|
||||
show create TABLE t3;
|
||||
Table Create Table
|
||||
|
@ -70,15 +70,15 @@ update t1 set c="",b=null where c="1";
|
|||
lock tables t1 READ;
|
||||
show full fields from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
t text latin1 YES NULL select,insert,update,references
|
||||
c varchar(10) latin1 YES NULL select,insert,update,references
|
||||
t text latin1_swedish_ci YES NULL select,insert,update,references
|
||||
c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
b blob binary YES NULL select,insert,update,references
|
||||
d varchar(10) binary binary YES NULL select,insert,update,references
|
||||
lock tables t1 WRITE;
|
||||
show full fields from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
t text latin1 YES NULL select,insert,update,references
|
||||
c varchar(10) latin1 YES NULL select,insert,update,references
|
||||
t text latin1_swedish_ci YES NULL select,insert,update,references
|
||||
c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
b blob binary YES NULL select,insert,update,references
|
||||
d varchar(10) binary binary YES NULL select,insert,update,references
|
||||
unlock tables;
|
||||
|
|
|
@ -40,7 +40,7 @@ KEY (options,flags)
|
|||
show full fields from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto int(5) unsigned binary PRI NULL auto_increment select,insert,update,references
|
||||
string varchar(10) latin1 YES hello select,insert,update,references
|
||||
string varchar(10) latin1_swedish_ci YES hello select,insert,update,references
|
||||
tiny tinyint(4) binary MUL 0 select,insert,update,references
|
||||
short smallint(6) binary MUL 1 select,insert,update,references
|
||||
medium mediumint(8) binary MUL 0 select,insert,update,references
|
||||
|
@ -53,16 +53,16 @@ ushort smallint(5) unsigned zerofill binary MUL 00000 select,insert,update,ref
|
|||
umedium mediumint(8) unsigned binary MUL 0 select,insert,update,references
|
||||
ulong int(11) unsigned binary MUL 0 select,insert,update,references
|
||||
ulonglong bigint(13) unsigned binary MUL 0 select,insert,update,references
|
||||
time_stamp timestamp latin1 YES NULL select,insert,update,references
|
||||
date_field date latin1 YES NULL select,insert,update,references
|
||||
time_field time latin1 YES NULL select,insert,update,references
|
||||
date_time datetime latin1 YES NULL select,insert,update,references
|
||||
time_stamp timestamp latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_field date latin1_swedish_ci YES NULL select,insert,update,references
|
||||
time_field time latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_time datetime latin1_swedish_ci YES NULL select,insert,update,references
|
||||
blob_col blob binary YES NULL select,insert,update,references
|
||||
tinyblob_col tinyblob binary YES NULL select,insert,update,references
|
||||
mediumblob_col mediumblob binary select,insert,update,references
|
||||
longblob_col longblob binary select,insert,update,references
|
||||
options enum('one','two','tree') latin1 MUL one select,insert,update,references
|
||||
flags set('one','two','tree') latin1 select,insert,update,references
|
||||
options enum('one','two','tree') latin1_swedish_ci MUL one select,insert,update,references
|
||||
flags set('one','two','tree') latin1_swedish_ci select,insert,update,references
|
||||
show keys from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE
|
||||
|
@ -170,7 +170,7 @@ update t2 set string="changed" where auto=16;
|
|||
show full columns from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto int(5) unsigned binary MUL NULL auto_increment select,insert,update,references
|
||||
string varchar(10) latin1 YES new defaul select,insert,update,references
|
||||
string varchar(10) latin1_swedish_ci YES new defaul select,insert,update,references
|
||||
tiny tinyint(4) binary MUL 0 select,insert,update,references
|
||||
short smallint(6) binary MUL 0 select,insert,update,references
|
||||
medium mediumint(8) binary MUL 0 select,insert,update,references
|
||||
|
@ -183,20 +183,20 @@ ushort smallint(5) unsigned zerofill binary 00000 select,insert,update,refere
|
|||
umedium mediumint(8) unsigned binary MUL 0 select,insert,update,references
|
||||
ulong int(11) unsigned binary MUL 0 select,insert,update,references
|
||||
ulonglong bigint(13) unsigned binary MUL 0 select,insert,update,references
|
||||
time_stamp timestamp latin1 YES NULL select,insert,update,references
|
||||
date_field varchar(10) latin1 YES NULL select,insert,update,references
|
||||
time_field time latin1 YES NULL select,insert,update,references
|
||||
date_time datetime latin1 YES NULL select,insert,update,references
|
||||
new_blob_col varchar(20) latin1 YES NULL select,insert,update,references
|
||||
time_stamp timestamp latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
time_field time latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_time datetime latin1_swedish_ci YES NULL select,insert,update,references
|
||||
new_blob_col varchar(20) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
tinyblob_col tinyblob binary YES NULL select,insert,update,references
|
||||
mediumblob_col mediumblob binary select,insert,update,references
|
||||
options enum('one','two','tree') latin1 MUL one select,insert,update,references
|
||||
flags set('one','two','tree') latin1 select,insert,update,references
|
||||
new_field varchar(10) latin1 new select,insert,update,references
|
||||
options enum('one','two','tree') latin1_swedish_ci MUL one select,insert,update,references
|
||||
flags set('one','two','tree') latin1_swedish_ci select,insert,update,references
|
||||
new_field varchar(10) latin1_swedish_ci new select,insert,update,references
|
||||
show full columns from t2;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto int(5) unsigned binary 0 select,insert,update,references
|
||||
string varchar(10) latin1 YES new defaul select,insert,update,references
|
||||
string varchar(10) latin1_swedish_ci YES new defaul select,insert,update,references
|
||||
tiny tinyint(4) binary 0 select,insert,update,references
|
||||
short smallint(6) binary 0 select,insert,update,references
|
||||
medium mediumint(8) binary 0 select,insert,update,references
|
||||
|
@ -209,16 +209,16 @@ ushort smallint(5) unsigned zerofill binary 00000 select,insert,update,refere
|
|||
umedium mediumint(8) unsigned binary 0 select,insert,update,references
|
||||
ulong int(11) unsigned binary 0 select,insert,update,references
|
||||
ulonglong bigint(13) unsigned binary 0 select,insert,update,references
|
||||
time_stamp timestamp latin1 YES NULL select,insert,update,references
|
||||
date_field varchar(10) latin1 YES NULL select,insert,update,references
|
||||
time_field time latin1 YES NULL select,insert,update,references
|
||||
date_time datetime latin1 YES NULL select,insert,update,references
|
||||
new_blob_col varchar(20) latin1 YES NULL select,insert,update,references
|
||||
time_stamp timestamp latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
time_field time latin1_swedish_ci YES NULL select,insert,update,references
|
||||
date_time datetime latin1_swedish_ci YES NULL select,insert,update,references
|
||||
new_blob_col varchar(20) latin1_swedish_ci YES NULL select,insert,update,references
|
||||
tinyblob_col tinyblob binary YES NULL select,insert,update,references
|
||||
mediumblob_col mediumblob binary select,insert,update,references
|
||||
options enum('one','two','tree') latin1 one select,insert,update,references
|
||||
flags set('one','two','tree') latin1 select,insert,update,references
|
||||
new_field varchar(10) latin1 new select,insert,update,references
|
||||
options enum('one','two','tree') latin1_swedish_ci one select,insert,update,references
|
||||
flags set('one','two','tree') latin1_swedish_ci select,insert,update,references
|
||||
new_field varchar(10) latin1_swedish_ci new select,insert,update,references
|
||||
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
|
||||
auto auto
|
||||
16 16
|
||||
|
@ -231,8 +231,8 @@ show full columns from t2;
|
|||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto bigint(17) unsigned binary PRI 0 select,insert,update,references
|
||||
t1 bigint(1) binary 0 select,insert,update,references
|
||||
t2 char(1) latin1 select,insert,update,references
|
||||
t3 mediumtext latin1 select,insert,update,references
|
||||
t2 char(1) latin1_swedish_ci select,insert,update,references
|
||||
t3 mediumtext latin1_swedish_ci select,insert,update,references
|
||||
t4 mediumtext character set latin1 latin1_bin select,insert,update,references
|
||||
select * from t2;
|
||||
auto t1 t2 t3 t4
|
||||
|
|
|
@ -158,15 +158,15 @@ net_buffer_length 1048576
|
|||
set GLOBAL character set cp1251_koi8;
|
||||
show global variables like "client_collation";
|
||||
Variable_name Value
|
||||
client_collation cp1251
|
||||
client_collation cp1251_bulgarian_ci
|
||||
set character set cp1251_koi8;
|
||||
show variables like "client_collation";
|
||||
Variable_name Value
|
||||
client_collation cp1251
|
||||
client_collation cp1251_bulgarian_ci
|
||||
set global character set default, session character set default;
|
||||
show variables like "client_collation";
|
||||
Variable_name Value
|
||||
client_collation latin1
|
||||
client_collation latin1_swedish_ci
|
||||
select @@timestamp>0;
|
||||
@@timestamp>0
|
||||
1
|
||||
|
|
|
@ -72,7 +72,7 @@ static void init_state_maps(CHARSET_INFO *cs)
|
|||
else if (my_isdigit(cs,i))
|
||||
state_map[i]=(uchar) MY_LEX_NUMBER_IDENT;
|
||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
else if (use_mb(cs) && my_ismbhead(cs, i))
|
||||
else if (use_mb(cs) && (my_mbcharlen(cs, i)>1))
|
||||
state_map[i]=(uchar) MY_LEX_IDENT;
|
||||
#endif
|
||||
else if (!my_isgraph(cs,i))
|
||||
|
@ -126,10 +126,7 @@ static void simple_cs_init_functions(CHARSET_INFO *cs)
|
|||
cs->wildcmp = b->wildcmp;
|
||||
cs->strnncoll = b->strnncoll;
|
||||
cs->strnncollsp = b->strnncollsp;
|
||||
cs->tosort = b->tosort;
|
||||
cs->strcasecmp = b->strcasecmp;
|
||||
cs->strncasecmp = b->strncasecmp;
|
||||
cs->hash_caseup = b->hash_caseup;
|
||||
cs->hash_sort = b->hash_sort;
|
||||
}
|
||||
else
|
||||
|
@ -139,10 +136,7 @@ static void simple_cs_init_functions(CHARSET_INFO *cs)
|
|||
cs->wildcmp = my_wildcmp_8bit;
|
||||
cs->strnncoll = my_strnncoll_simple;
|
||||
cs->strnncollsp = my_strnncollsp_simple;
|
||||
cs->tosort = my_tosort_8bit;
|
||||
cs->strcasecmp = my_strcasecmp_8bit;
|
||||
cs->strncasecmp = my_strncasecmp_8bit;
|
||||
cs->hash_caseup = my_hash_caseup_simple;
|
||||
cs->hash_sort = my_hash_sort_simple;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static void print_cs(CHARSET_INFO *cs)
|
|||
for (i=0; i<256; i++)
|
||||
{
|
||||
ch[i].cod=i;
|
||||
ch[i].srt=cs->sort_order[i];
|
||||
ch[i].srt=cs->sort_order ? cs->sort_order[i] : i;
|
||||
ch[i].uni=cs->tab_to_uni[i];
|
||||
ch[i].low=cs->tab_to_uni[cs->to_lower[i]];
|
||||
ch[i].upp=cs->tab_to_uni[cs->to_upper[i]];
|
||||
|
@ -104,12 +104,41 @@ static void print_cs(CHARSET_INFO *cs)
|
|||
printf("</HTML>\n");
|
||||
}
|
||||
|
||||
static void print_index()
|
||||
{
|
||||
CHARSET_INFO **cs;
|
||||
int clr=0;
|
||||
|
||||
get_charset_by_name("",MYF(0)); /* To execute init_available_charsets */
|
||||
|
||||
printf("All charsets\n");
|
||||
printf("<table border=1>\n");
|
||||
printf("<tr bgcolor=EEEE99><th>ID<th>Charset<th>Collation<th>Def<th>Bin<th>Com<th>Comment\n");
|
||||
for (cs=all_charsets ; cs < all_charsets+256; cs++)
|
||||
{
|
||||
if (!cs[0])
|
||||
continue;
|
||||
printf("<tr bgcolor=#%s><td><a href=\"?%s\">%d</a><td>%s<td>%s<td>%s<td>%s<td>%s<td>%s\n",
|
||||
(clr= !clr) ? "DDDDDD" : "EEEE99",
|
||||
cs[0]->name,cs[0]->number,cs[0]->csname,
|
||||
cs[0]->name,
|
||||
(cs[0]->state & MY_CS_PRIMARY) ? "def " : " ",
|
||||
(cs[0]->state & MY_CS_BINSORT) ? "bin " : " ",
|
||||
(cs[0]->state & MY_CS_COMPILED) ? "com " : " ",
|
||||
cs[0]->comment);
|
||||
}
|
||||
printf("</table>\n");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
const char *the_set = MYSQL_CHARSET;
|
||||
const char *the_set = NULL;
|
||||
int argcnt = 1;
|
||||
CHARSET_INFO *cs;
|
||||
|
||||
if (getenv("SCRIPT_NAME"))
|
||||
{
|
||||
printf("Content-Type: text/html\r\n\r\n");
|
||||
}
|
||||
my_init();
|
||||
|
||||
if (argc > argcnt && argv[argcnt][0] == '-' && argv[argcnt][1] == '#')
|
||||
|
@ -121,6 +150,12 @@ int main(int argc, char **argv) {
|
|||
if (argc > argcnt)
|
||||
charsets_dir = argv[argcnt++];
|
||||
|
||||
if (!the_set)
|
||||
{
|
||||
print_index();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(cs= get_charset_by_name(the_set, MYF(MY_WME))))
|
||||
return 1;
|
||||
|
||||
|
|
69
mysys/hash.c
69
mysys/hash.c
|
@ -31,9 +31,14 @@
|
|||
|
||||
static uint hash_mask(uint hashnr,uint buffmax,uint maxlength);
|
||||
static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
|
||||
static uint calc_hashnr(CHARSET_INFO *cs,const byte *key,uint length);
|
||||
static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length);
|
||||
|
||||
static uint calc_hash(HASH *hash,const byte *key,uint length)
|
||||
{
|
||||
ulong nr1=1, nr2=4;
|
||||
hash->charset->hash_sort(hash->charset,key,length,&nr1,&nr2);
|
||||
return nr1;
|
||||
}
|
||||
|
||||
my_bool
|
||||
_hash_init(HASH *hash,CHARSET_INFO *charset,
|
||||
|
@ -58,10 +63,6 @@ _hash_init(HASH *hash,CHARSET_INFO *charset,
|
|||
hash->free=free_element;
|
||||
hash->flags=flags;
|
||||
hash->charset=charset;
|
||||
if (flags & HASH_CASE_INSENSITIVE)
|
||||
hash->calc_hashnr=charset->hash_caseup;
|
||||
else
|
||||
hash->calc_hashnr=calc_hashnr;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -111,54 +112,9 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax,
|
|||
{
|
||||
uint length;
|
||||
byte *key= (byte*) hash_key(hash,pos->data,&length,0);
|
||||
return hash_mask((*hash->calc_hashnr)(hash->charset,key,length),
|
||||
buffmax,maxlength);
|
||||
return hash_mask(calc_hash(hash,key,length),buffmax,maxlength);
|
||||
}
|
||||
|
||||
#ifndef NEW_HASH_FUNCTION
|
||||
|
||||
/* Calc hashvalue for a key */
|
||||
|
||||
static uint calc_hashnr(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const byte *key,uint length)
|
||||
{
|
||||
register uint nr=1, nr2=4;
|
||||
while (length--)
|
||||
{
|
||||
nr^= (((nr & 63)+nr2)*((uint) (uchar) *key++))+ (nr << 8);
|
||||
nr2+=3;
|
||||
}
|
||||
return((uint) nr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Fowler/Noll/Vo hash
|
||||
*
|
||||
* The basis of the hash algorithm was taken from an idea sent by email to the
|
||||
* IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and
|
||||
* Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com)
|
||||
* later improved on their algorithm.
|
||||
*
|
||||
* The magic is in the interesting relationship between the special prime
|
||||
* 16777619 (2^24 + 403) and 2^32 and 2^8.
|
||||
* This works well on both numbers and strings.
|
||||
*/
|
||||
|
||||
uint calc_hashnr(CHARSET_INFO *cs, const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) *(uchar*) key;
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __SUNPRO_C /* SUNPRO can't handle this */
|
||||
|
@ -168,7 +124,7 @@ unsigned int rec_hashnr(HASH *hash,const byte *record)
|
|||
{
|
||||
uint length;
|
||||
byte *key= (byte*) hash_key(hash,record,&length,0);
|
||||
return (*hash->calc_hashnr)(hash->charset,key,length);
|
||||
return calc_hash(hash,key,length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -184,8 +140,7 @@ gptr hash_search(HASH *hash,const byte *key,uint length)
|
|||
flag=1;
|
||||
if (hash->records)
|
||||
{
|
||||
idx=hash_mask((*hash->calc_hashnr)(hash->charset,key,length ? length :
|
||||
hash->key_length),
|
||||
idx=hash_mask(calc_hash(hash,key,length ? length : hash->key_length),
|
||||
hash->blength,hash->records);
|
||||
do
|
||||
{
|
||||
|
@ -256,9 +211,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
|
|||
uint rec_keylength;
|
||||
byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
|
||||
return (length && length != rec_keylength) ||
|
||||
(hash->flags & HASH_CASE_INSENSITIVE ?
|
||||
my_strncasecmp(hash->charset, rec_key,key,rec_keylength) :
|
||||
memcmp(rec_key,key,rec_keylength));
|
||||
my_strnncoll(hash->charset, rec_key, rec_keylength, key, length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -497,7 +450,7 @@ my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length)
|
|||
|
||||
/* Search after record with key */
|
||||
|
||||
idx=hash_mask((*hash->calc_hashnr)(hash->charset, old_key,(old_key_length ?
|
||||
idx=hash_mask(calc_hash(hash, old_key,(old_key_length ?
|
||||
old_key_length :
|
||||
hash->key_length)),
|
||||
blength,records);
|
||||
|
|
Binary file not shown.
|
@ -505,10 +505,8 @@ static void make_sortkey(register SORTPARAM *param,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (res->ptr() != (char*) to)
|
||||
memcpy(to,res->ptr(),length);
|
||||
bzero((char *)to+length,diff);
|
||||
my_tosort(cs, (char*) to,length);
|
||||
my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length);
|
||||
bzero((char *)to+length,diff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -2166,17 +2166,11 @@ void Item_func_set_collation::fix_length_and_dec()
|
|||
MY_CS_BINSORT,MYF(0));
|
||||
else
|
||||
set_collation= get_charset_by_name(colname,MYF(0));
|
||||
|
||||
if (!set_collation)
|
||||
{
|
||||
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), str->c_ptr());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!my_charset_same(args[0]->charset(),set_collation))
|
||||
|
||||
if (!set_collation || !my_charset_same(args[0]->charset(),set_collation))
|
||||
{
|
||||
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
|
||||
set_collation->name,args[0]->charset()->csname);
|
||||
colname,args[0]->charset()->csname);
|
||||
return;
|
||||
}
|
||||
set_charset(set_collation, COER_EXPLICIT);
|
||||
|
|
|
@ -533,6 +533,13 @@ static SYMBOL sql_functions[] = {
|
|||
{ "MAKE_SET", SYM(MAKE_SET_SYM),0,0},
|
||||
{ "MASTER_POS_WAIT", SYM(MASTER_POS_WAIT),0,0},
|
||||
{ "MAX", SYM(MAX_SYM),0,0},
|
||||
{ "MBRCONTAINS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_contains)},
|
||||
{ "MBRDISJOINT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_disjoint)},
|
||||
{ "MBREQUAL", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_equals)},
|
||||
{ "MBRINTERSECTS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_intersects)},
|
||||
{ "MBROVERLAPS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_overlaps)},
|
||||
{ "MBRTOUCHES", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_touches)},
|
||||
{ "MBRWITHIN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_within)},
|
||||
{ "MD5", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
|
||||
{ "MID", SYM(SUBSTRING),0,0}, /* unireg function */
|
||||
{ "MIN", SYM(MIN_SYM),0,0},
|
||||
|
|
|
@ -1465,7 +1465,7 @@ void set_var_init()
|
|||
|
||||
hash_init(&system_variable_hash, system_charset_info,
|
||||
array_elements(sys_variables),0,0,
|
||||
(hash_get_key) get_sys_var_length,0, HASH_CASE_INSENSITIVE);
|
||||
(hash_get_key) get_sys_var_length,0,0);
|
||||
sys_var **var, **end;
|
||||
for (var= sys_variables, end= sys_variables+array_elements(sys_variables) ;
|
||||
var < end;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
|
||||
<charsets max-id="82">
|
||||
<charsets max-id="83">
|
||||
|
||||
<description>
|
||||
This file lists all of the available character sets.
|
||||
|
@ -50,8 +50,8 @@ To make maintaining easier please:
|
|||
<charset name="dec8">
|
||||
<family>Western</family>
|
||||
<description>DEC West European</description>
|
||||
<collation name="dec_bin" id="69" order="Binary" flag="binary"/>
|
||||
<collation name="dec8" id="3" flag="primary">
|
||||
<collation name="dec8_bin" id="69" order="Binary" flag="binary"/>
|
||||
<collation name="dec8_swedish_ci" id="3" flag="primary">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
<order>French</order>
|
||||
|
@ -63,14 +63,13 @@ To make maintaining easier please:
|
|||
</collation>
|
||||
</charset>
|
||||
|
||||
<charset name="pclatin1">
|
||||
<charset name="cp850">
|
||||
<family>Western</family>
|
||||
<description>DOS West European</description>
|
||||
<alias>850</alias>
|
||||
<alias>cp850</alias>
|
||||
<alias>cspc850multilingual</alias>
|
||||
<alias>ibm850</alias>
|
||||
<collation name="pclatin1" id="4" flag="primary">
|
||||
<collation name="cp850_general_ci" id="4" flag="primary">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
<order>French</order>
|
||||
|
@ -80,7 +79,7 @@ To make maintaining easier please:
|
|||
<order>Pogtuguese</order>
|
||||
<order>Spanish</order>
|
||||
</collation>
|
||||
<collation name="pclatin1_bin" id="80" order="Binary" flag="binary"/>
|
||||
<collation name="cp850_bin" id="80" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="latin1">
|
||||
|
@ -94,7 +93,7 @@ To make maintaining easier please:
|
|||
<alias>l1</alias>
|
||||
<alias>latin1</alias>
|
||||
<collation name="latin1_german1_ci" id="5" order="German Duden"/>
|
||||
<collation name="latin1" id="8" order="Finnish, Swedish" flag="primary"/>
|
||||
<collation name="latin1_swedish_ci" id="8" order="Finnish, Swedish" flag="primary"/>
|
||||
<collation name="latin1_danish_ci" id="15" order="Danish"/>
|
||||
<collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/>
|
||||
<collation name="latin1_bin" id="47" order="Binary" flag="binary"/>
|
||||
|
@ -124,8 +123,8 @@ To make maintaining easier please:
|
|||
<family>Western</family>
|
||||
<description>HP West European</description>
|
||||
<alias>hproman8</alias>
|
||||
<collation name="hp8_bin" id="72" order="Binary" flag="binary"/>
|
||||
<collation name="hp8" id="6" flag="primary">
|
||||
<collation name="hp8_bin" id="72" order="Binary" flag="binary"/>
|
||||
<collation name="hp8_english_ci" id="6" flag="primary">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
<order>French</order>
|
||||
|
@ -142,16 +141,16 @@ To make maintaining easier please:
|
|||
<description>KOI8-R Relcom Russian</description>
|
||||
<alias>koi8-r</alias>
|
||||
<alias>cskoi8r</alias>
|
||||
<collation name="koi8r" id="7" order="Russian" flag="primary"/>
|
||||
<collation name="koi8r_bin" id="74" order="Binary" flag="binary"/>
|
||||
<collation name="koi8r_general_ci" id="7" order="Russian" flag="primary"/>
|
||||
<collation name="koi8r_bin" id="74" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="swe7">
|
||||
<family>Western</family>
|
||||
<description>7bit Swedish</description>
|
||||
<alias>iso-646-se</alias>
|
||||
<collation name="swe7" id="10" order="Swedish" flag="primary"/>
|
||||
<collation name="swe7_bin" id="82" order="Binary" flag="binary"/>
|
||||
<collation name="swe7_swedish_ci" id="10" order="Swedish" flag="primary"/>
|
||||
<collation name="swe7_bin" id="82" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="ascii">
|
||||
|
@ -162,8 +161,8 @@ To make maintaining easier please:
|
|||
<alias>csascii</alias>
|
||||
<alias>iso-ir-6</alias>
|
||||
<alias>iso646-us</alias>
|
||||
<collation name="ascii" id="11" order="English" flag="primary"/>
|
||||
<collation name="ascii_bin" id="65" order="Binary" flag="binary"/>
|
||||
<collation name="ascii_general_ci" id="11" order="English" flag="primary"/>
|
||||
<collation name="ascii_bin" id="65" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="ujis">
|
||||
|
@ -188,7 +187,7 @@ To make maintaining easier please:
|
|||
<alias>windows-1251</alias>
|
||||
<alias>ms-cyr</alias>
|
||||
<alias>ms-cyrillic</alias>
|
||||
<collation name="cp1251" id="14" flag="primary">
|
||||
<collation name="cp1251_bulgarian_ci" id="14" flag="primary">
|
||||
<order>Belarusian</order>
|
||||
<order>Bulgarian</order>
|
||||
<order>Macedonian</order>
|
||||
|
@ -197,9 +196,9 @@ To make maintaining easier please:
|
|||
<order>Mongolian</order>
|
||||
<order>Ukrainian</order>
|
||||
</collation>
|
||||
<collation name="win1251ukr" id="23" order="Depreciated"/>
|
||||
<collation name="cp1251_ukrainian_ci" id="23" order="Ukrainian"/>
|
||||
<collation name="cp1251_bin" id="50" order="Binary" flag="binary"/>
|
||||
<collation name="cp1251_ci" id="51">
|
||||
<collation name="cp1251_general_ci" id="51">
|
||||
<order>Belarusian</order>
|
||||
<order>Bulgarian</order>
|
||||
<order>Macedonian</order>
|
||||
|
@ -208,7 +207,7 @@ To make maintaining easier please:
|
|||
<order>Mongolian</order>
|
||||
<order>Ukrainian</order>
|
||||
</collation>
|
||||
<collation name="cp1251_cs" id="52">
|
||||
<collation name="cp1251_general_cs" id="52">
|
||||
<order>Belarusian</order>
|
||||
<order>Bulgarian</order>
|
||||
<order>Macedonian</order>
|
||||
|
@ -258,13 +257,13 @@ To make maintaining easier please:
|
|||
<alias>l7</alias>
|
||||
<collation name="latin7_estonian_ci" id="20">
|
||||
<order>Estonian</order>
|
||||
<flag>primary</flag>
|
||||
</collation>
|
||||
<collation name="latin7_ci" id="41">
|
||||
<collation name="latin7_general_ci" id="41">
|
||||
<order>Latvian</order>
|
||||
<order>Lithuanian</order>
|
||||
<flag>primary</flag>
|
||||
</collation>
|
||||
<collation name="latin7_cs" id="42">
|
||||
<collation name="latin7_general_cs" id="42">
|
||||
<order>Latvian</order>
|
||||
<order>Lithuanian</order>
|
||||
</collation>
|
||||
|
@ -275,8 +274,8 @@ To make maintaining easier please:
|
|||
<family>Cyrillic</family>
|
||||
<description>KOI8-U Ukrainian</description>
|
||||
<alias>koi8-u</alias>
|
||||
<collation name="koi8u" id="22" order="Ukranian" flag="primary"/>
|
||||
<collation name="koi8u_bin" id="75" order="Binary" flag="binary"/>
|
||||
<collation name="koi8u_general_ci" id="22" order="Ukranian" flag="primary"/>
|
||||
<collation name="koi8u_bin" id="75" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="gb2312">
|
||||
|
@ -307,7 +306,7 @@ To make maintaining easier please:
|
|||
<description>Windows Central European</description>
|
||||
<alias>ms-ce</alias>
|
||||
<alias>windows-1250</alias>
|
||||
<collation name="cp1250" id="26" flag="primary">
|
||||
<collation name="cp1250_general_ci" id="26" flag="primary">
|
||||
<order>Hungarian</order>
|
||||
<order>Polish</order>
|
||||
<order>Romanian</order>
|
||||
|
@ -316,7 +315,7 @@ To make maintaining easier please:
|
|||
<order>Slovenian</order>
|
||||
<order>Sorbian</order>
|
||||
</collation>
|
||||
<collation name="cp1250_czech" id="34" order="Czech"/>
|
||||
<collation name="cp1250_czech_ci" id="34" order="Czech"/>
|
||||
<collation name="cp1250_bin" id="66" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
|
@ -335,9 +334,9 @@ To make maintaining easier please:
|
|||
<description>Windows Baltic</description>
|
||||
<alias>WinBaltRim</alias>
|
||||
<alias>windows-1257</alias>
|
||||
<collation name="cp1257" id="29" order="Depreciated"/>
|
||||
<collation name="cp1257_bin" id="58" order="Binary" flag="binary"/>
|
||||
<collation name="cp1257_ci_ai" id="59" flag="primary">
|
||||
<collation name="cp1257_lithuanian_ci" id="29" order="Lithuanian"/>
|
||||
<collation name="cp1257_bin" id="58" order="Binary" flag="binary"/>
|
||||
<collation name="cp1257_ci_ai" id="59" flag="primary">
|
||||
<order>Latvian</order>
|
||||
<order>Lithuanian</order>
|
||||
</collation>
|
||||
|
@ -360,16 +359,16 @@ To make maintaining easier please:
|
|||
<alias>l5</alias>
|
||||
<alias>latin5</alias>
|
||||
<alias>turkish</alias>
|
||||
<collation name="latin5" id="30" order="Turkish" flag="primary"/>
|
||||
<collation name="latin5_bin" id="78" order="Binary" flag="binary"/>
|
||||
<collation name="latin5_turkish_ci" id="30" order="Turkish" flag="primary"/>
|
||||
<collation name="latin5_bin" id="78" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="armscii8">
|
||||
<family>South Asian</family>
|
||||
<description>ARMSCII-8 Armenian</description>
|
||||
<alias>armscii-8</alias>
|
||||
<collation name="armscii8" id="32" order="Armenian" flag="primary"/>
|
||||
<collation name="armscii_bin" id="64" order="Binary" flag="binary"/>
|
||||
<collation name="armscii8_general_ci" id="32" order="Armenian" flag="primary"/>
|
||||
<collation name="armscii_bin" id="64" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="utf8">
|
||||
|
@ -377,6 +376,7 @@ To make maintaining easier please:
|
|||
<description>UTF-8 Unicode</description>
|
||||
<alias>utf-8</alias>
|
||||
<collation name="utf8" id="33" flag="primary"/>
|
||||
<collation name="utf8_bin" id="83" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="ucs2">
|
||||
|
@ -392,8 +392,8 @@ To make maintaining easier please:
|
|||
<alias>csibm866</alias>
|
||||
<alias>ibm866</alias>
|
||||
<alias>DOSCyrillicRussian</alias>
|
||||
<collation name="cp866" id="36" order="Russian" flag="primary"/>
|
||||
<collation name="cp866_bin" id="68" order="Binary" flag="binary"/>
|
||||
<collation name="cp866_general_ci" id="36" order="Russian" flag="primary"/>
|
||||
<collation name="cp866_bin" id="68" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="keybcs2">
|
||||
|
@ -478,13 +478,13 @@ To make maintaining easier please:
|
|||
</collation>
|
||||
</charset>
|
||||
|
||||
<charset name="pclatin2">
|
||||
<charset name="cp852">
|
||||
<family>Central European</family>
|
||||
<description>DOS Central European</description>
|
||||
<alias>852</alias>
|
||||
<alias>cp852</alias>
|
||||
<alias>ibm852</alias>
|
||||
<collation name="pclatin2" id="40" flag="primary">
|
||||
<collation name="cp852_general_ci" id="40" flag="primary">
|
||||
<order>Hungarian</order>
|
||||
<order>Polish</order>
|
||||
<order>Romanian</order>
|
||||
|
@ -493,7 +493,7 @@ To make maintaining easier please:
|
|||
<order>Slovenian</order>
|
||||
<order>Sorbian</order>
|
||||
</collation>
|
||||
<collation name="pclatin2_bin" id="81" order="Binary" flag="binary"/>
|
||||
<collation name="cp852_bin" id="81" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="cp1256">
|
||||
|
@ -501,8 +501,8 @@ To make maintaining easier please:
|
|||
<description>Windows Arabic</description>
|
||||
<alias>ms-arab</alias>
|
||||
<alias>windows-1256</alias>
|
||||
<collation name="cp1256_bin" id="67" order="Binary" flag="binary"/>
|
||||
<collation name="cp1256" id="57" order="Arabic" flag="primary">
|
||||
<collation name="cp1256_bin" id="67" order="Binary" flag="binary"/>
|
||||
<collation name="cp1256_general_ci" id="57" order="Arabic" flag="primary">
|
||||
<order>Arabic</order>
|
||||
<order>Persian</order>
|
||||
<order>Pakistani</order>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="armscii8">
|
||||
<collation name="armscii8_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="ascii">
|
||||
<collation name="ascii_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="cp1250">
|
||||
<collation name="cp1250_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
@ -114,7 +114,7 @@
|
|||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="cp1250_czech"/>
|
||||
<collation name="cp1250_czech_ci"/>
|
||||
|
||||
<collation name="cp1250_bin" flag="binary"/>
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="cp1251">
|
||||
<collation name="cp1251_bulgarian_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
@ -119,7 +119,7 @@
|
|||
<collation name="cp1251_bin" flag="binary"/>
|
||||
|
||||
|
||||
<collation name="cp1251_ci">
|
||||
<collation name="cp1251_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
@ -141,7 +141,7 @@
|
|||
</collation>
|
||||
|
||||
|
||||
<collation name="cp1251_cs">
|
||||
<collation name="cp1251_general_cs">
|
||||
<!--
|
||||
# Case insensitive, accent sensitive
|
||||
# Sort order is correct for Belarusian, Bulgarian, Macedonian,
|
||||
|
@ -170,7 +170,7 @@
|
|||
</collation>
|
||||
|
||||
|
||||
<collation name="win1251ukr">
|
||||
<collation name="cp1251_ukrainian_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="cp1256">
|
||||
<collation name="cp1256_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="cp1257">
|
||||
<collation name="cp1257_lithuanian_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<charsets>
|
||||
|
||||
<charset name="pclatin1">
|
||||
<charset name="cp850">
|
||||
|
||||
<ctype>
|
||||
<map>
|
||||
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="pclatin1">
|
||||
<collation name="cp850_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
@ -114,7 +114,7 @@
|
|||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="pclatin1_bin" flag="binary"/>
|
||||
<collation name="cp850_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<charsets>
|
||||
|
||||
<charset name="pclatin2">
|
||||
<charset name="cp852">
|
||||
|
||||
<ctype>
|
||||
<map>
|
||||
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="pclatin2">
|
||||
<collation name="cp852_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
|
@ -94,7 +94,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="cp866">
|
||||
<collation name="cp866_general_ci">
|
||||
<!-- Case insensitive, accent sensitive -->
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="dec8">
|
||||
<collation name="dec8_swedish_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
@ -114,7 +114,7 @@
|
|||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="dec_bin" flag="binary"/>
|
||||
<collation name="dec8_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="hp8">
|
||||
<collation name="hp8_english_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="koi8r">
|
||||
<collation name="koi8r_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="koi8u">
|
||||
<collation name="koi8u_general_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="latin1">
|
||||
<collation name="latin1_swedish_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="latin5">
|
||||
<collation name="latin5_turkish_ci">
|
||||
<!--
|
||||
# Note: all accented characters are compared separately (this
|
||||
# is different from the default latin1 character set, where
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
</collation>
|
||||
|
||||
|
||||
<collation name="latin7_ci">
|
||||
<collation name="latin7_general_ci">
|
||||
<!-- Created for case-sensitive record search -->
|
||||
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
|
||||
<map>
|
||||
|
@ -139,7 +139,7 @@
|
|||
</collation>
|
||||
|
||||
|
||||
<collation name="latin7_cs">
|
||||
<collation name="latin7_general_cs">
|
||||
<!-- Created for case-insensitive record search -->
|
||||
<!-- Created by Andis & Rihards -->
|
||||
<map>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</unicode>
|
||||
|
||||
|
||||
<collation name="swe7">
|
||||
<collation name="swe7_swedish_ci">
|
||||
<map>
|
||||
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
||||
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
|
||||
|
|
|
@ -334,7 +334,7 @@ void init_slave_skip_errors(const char* arg)
|
|||
use_slave_mask = 1;
|
||||
for (;my_isspace(system_charset_info,*arg);++arg)
|
||||
/* empty */;
|
||||
if (!my_strncasecmp(system_charset_info,arg,"all",3))
|
||||
if (!my_strnncoll(system_charset_info,(uchar*)arg,4,(const uchar*)"all",4))
|
||||
{
|
||||
bitmap_set_all(&slave_error_mask);
|
||||
return;
|
||||
|
|
|
@ -66,7 +66,8 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
|
|||
cur_rt < ci_collection_end; ++cur_rt)
|
||||
{
|
||||
if ((cur_rt->m_name[len] == 0) &&
|
||||
(my_strncasecmp(&my_charset_latin1, cur_rt->m_name, name, len) == 0))
|
||||
(my_strnncoll(&my_charset_latin1, (const uchar*)cur_rt->m_name, len,
|
||||
(const uchar*)name, len) == 0))
|
||||
{
|
||||
return cur_rt;
|
||||
}
|
||||
|
|
|
@ -983,7 +983,7 @@ static void init_check_host(void)
|
|||
VOID(my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip),
|
||||
acl_users.elements,1));
|
||||
VOID(hash_init(&acl_check_hosts,&my_charset_latin1,acl_users.elements,0,0,
|
||||
(hash_get_key) check_get_key,0,HASH_CASE_INSENSITIVE));
|
||||
(hash_get_key) check_get_key,0,0));
|
||||
if (!allow_all_hosts)
|
||||
{
|
||||
for (uint i=0 ; i < acl_users.elements ; i++)
|
||||
|
@ -1639,8 +1639,7 @@ public:
|
|||
hash_key = (char*) alloc_root(&memex,key_length);
|
||||
strmov(strmov(strmov(hash_key,user)+1,db)+1,tname);
|
||||
(void) hash_init(&hash_columns,&my_charset_latin1,
|
||||
0,0,0, (hash_get_key) get_key_column,0,
|
||||
HASH_CASE_INSENSITIVE);
|
||||
0,0,0, (hash_get_key) get_key_column,0,0);
|
||||
}
|
||||
|
||||
GRANT_TABLE (TABLE *form, TABLE *col_privs)
|
||||
|
@ -1674,8 +1673,7 @@ public:
|
|||
cols = fix_rights_for_column(cols);
|
||||
|
||||
(void) hash_init(&hash_columns,&my_charset_latin1,
|
||||
0,0,0, (hash_get_key) get_key_column,0,
|
||||
HASH_CASE_INSENSITIVE);
|
||||
0,0,0, (hash_get_key) get_key_column,0,0);
|
||||
if (cols)
|
||||
{
|
||||
int key_len;
|
||||
|
|
|
@ -142,7 +142,7 @@ THD::THD():user_time(0), is_fatal_error(0),
|
|||
bzero((char*) &warn_root,sizeof(warn_root));
|
||||
init_alloc_root(&warn_root, 1024, 0);
|
||||
user_connect=(USER_CONN *)0;
|
||||
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
|
||||
hash_init(&user_vars, &my_charset_bin, USER_VARS_HASH_SIZE, 0, 0,
|
||||
(hash_get_key) get_var_key,
|
||||
(hash_free_key) free_user_var,0);
|
||||
|
||||
|
@ -246,7 +246,7 @@ void THD::change_user(void)
|
|||
cleanup();
|
||||
cleanup_done= 0;
|
||||
init();
|
||||
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
|
||||
hash_init(&user_vars, &my_charset_bin, USER_VARS_HASH_SIZE, 0, 0,
|
||||
(hash_get_key) get_var_key,
|
||||
(hash_free_key) free_user_var, 0);
|
||||
}
|
||||
|
|
|
@ -495,7 +495,7 @@ int yylex(void *arg, void *yythd)
|
|||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
if (use_mb(cs))
|
||||
{
|
||||
if (my_ismbhead(cs, yyGetLast()))
|
||||
if (my_mbcharlen(cs, yyGetLast()) > 1)
|
||||
{
|
||||
int l = my_ismbchar(cs,
|
||||
(const char *)lex->ptr-1,
|
||||
|
@ -508,7 +508,7 @@ int yylex(void *arg, void *yythd)
|
|||
}
|
||||
while (ident_map[c=yyGet()])
|
||||
{
|
||||
if (my_ismbhead(cs, c))
|
||||
if (my_mbcharlen(cs, c) > 1)
|
||||
{
|
||||
int l;
|
||||
if ((l = my_ismbchar(cs,
|
||||
|
@ -604,7 +604,7 @@ int yylex(void *arg, void *yythd)
|
|||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
if (use_mb(cs))
|
||||
{
|
||||
if (my_ismbhead(cs, yyGetLast()))
|
||||
if (my_mbcharlen(cs, yyGetLast()) > 1)
|
||||
{
|
||||
int l = my_ismbchar(cs,
|
||||
(const char *)lex->ptr-1,
|
||||
|
@ -618,7 +618,7 @@ int yylex(void *arg, void *yythd)
|
|||
}
|
||||
while (ident_map[c=yyGet()])
|
||||
{
|
||||
if (my_ismbhead(cs, c))
|
||||
if (my_mbcharlen(cs, c) > 1)
|
||||
{
|
||||
int l;
|
||||
if ((l = my_ismbchar(cs,
|
||||
|
@ -650,7 +650,7 @@ int yylex(void *arg, void *yythd)
|
|||
{
|
||||
while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
|
||||
{
|
||||
if (my_ismbhead(cs, c))
|
||||
if (my_mbcharlen(cs, c) > 1)
|
||||
{
|
||||
int l;
|
||||
if ((l = my_ismbchar(cs,
|
||||
|
|
|
@ -702,7 +702,7 @@ int READ_INFO::read_field()
|
|||
chr = GET;
|
||||
#ifdef USE_MB
|
||||
if (use_mb(read_charset) &&
|
||||
my_ismbhead(read_charset, chr) &&
|
||||
(my_mbcharlen(read_charset, chr) >1 )&&
|
||||
to+my_mbcharlen(read_charset, chr) <= end_of_buff)
|
||||
{
|
||||
uchar* p = (uchar*)to;
|
||||
|
@ -884,7 +884,7 @@ int READ_INFO::next_line()
|
|||
{
|
||||
int chr = GET;
|
||||
#ifdef USE_MB
|
||||
if (use_mb(read_charset) && my_ismbhead(read_charset, chr))
|
||||
if (use_mb(read_charset) && (my_mbcharlen(read_charset, chr) >1 ))
|
||||
{
|
||||
for (int i=1;
|
||||
chr != my_b_EOF && i<my_mbcharlen(read_charset, chr);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
CHARSET_INFO *system_charset_info= &my_charset_utf8;
|
||||
CHARSET_INFO *files_charset_info= &my_charset_utf8;
|
||||
CHARSET_INFO *national_charset_info= &my_charset_latin1;
|
||||
CHARSET_INFO *national_charset_info= &my_charset_utf8;
|
||||
|
||||
extern gptr sql_alloc(unsigned size);
|
||||
extern void sql_element_free(void *ptr);
|
||||
|
|
|
@ -128,8 +128,7 @@ void udf_init()
|
|||
init_sql_alloc(&mem, 1024,0);
|
||||
THD *new_thd = new THD;
|
||||
if (!new_thd ||
|
||||
hash_init(&udf_hash,system_charset_info,
|
||||
32,0,0,get_hash_key, NULL, HASH_CASE_INSENSITIVE))
|
||||
hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))
|
||||
{
|
||||
sql_print_error("Can't allocate memory for udf structures");
|
||||
hash_free(&udf_hash);
|
||||
|
|
|
@ -363,8 +363,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||
use_hash= !hash_init(&outparam->name_hash,
|
||||
system_charset_info,
|
||||
outparam->fields,0,0,
|
||||
(hash_get_key) get_field_name,0,
|
||||
HASH_CASE_INSENSITIVE);
|
||||
(hash_get_key) get_field_name,0,0);
|
||||
|
||||
for (i=0 ; i < outparam->fields; i++, strpos+=field_pack_length, field_ptr++)
|
||||
{
|
||||
|
|
|
@ -399,11 +399,6 @@ static int ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0);
|
||||
}
|
||||
|
||||
static my_bool ismbhead_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
|
||||
{
|
||||
return isbig5head(c);
|
||||
}
|
||||
|
||||
static int mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
|
||||
{
|
||||
return (isbig5head(c)? 2: 0);
|
||||
|
@ -6253,7 +6248,6 @@ CHARSET_INFO my_charset_big5 =
|
|||
my_wildcmp_mb,
|
||||
2, /* mbmaxlen */
|
||||
ismbchar_big5,
|
||||
ismbhead_big5,
|
||||
mbcharlen_big5,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -6263,10 +6257,7 @@ CHARSET_INFO my_charset_big5 =
|
|||
my_casedn_str_mb,
|
||||
my_caseup_mb,
|
||||
my_casedn_mb,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -112,24 +112,12 @@ static void my_casedn_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
{
|
||||
}
|
||||
|
||||
static void my_tosort_bin(CHARSET_INFO * cs __attribute__((unused)),
|
||||
char *str __attribute__((unused)),
|
||||
uint length __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)),
|
||||
const char *s, const char *t)
|
||||
{
|
||||
return strcmp(s,t);
|
||||
}
|
||||
|
||||
static int my_strncasecmp_bin(CHARSET_INFO * cs __attribute__((unused)),
|
||||
const char *s, const char *t, uint len)
|
||||
{
|
||||
return memcmp(s,t,len);
|
||||
}
|
||||
|
||||
static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
my_wc_t *wc,
|
||||
const unsigned char *str,
|
||||
|
@ -159,41 +147,6 @@ static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifndef NEW_HASH_FUNCTION
|
||||
|
||||
/* Calc hashvalue for a key, case indepenently */
|
||||
|
||||
static uint my_hash_caseup_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const byte *key, uint length)
|
||||
{
|
||||
register uint nr=1, nr2=4;
|
||||
|
||||
while (length--)
|
||||
{
|
||||
nr^= (((nr & 63)+nr2)*
|
||||
((uint) (uchar) *key++)) + (nr << 8);
|
||||
nr2+=3;
|
||||
}
|
||||
return((uint) nr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static uint my_hash_caseup_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) (uchar) *key;
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const uchar *key, uint len,ulong *nr1, ulong *nr2)
|
||||
{
|
||||
|
@ -304,7 +257,8 @@ static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const uchar *src,
|
||||
uint srclen __attribute__((unused)))
|
||||
{
|
||||
memcpy(dest,src,len= min(len,srclen));
|
||||
if (dest != src)
|
||||
memcpy(dest,src,len= min(len,srclen));
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -330,7 +284,6 @@ CHARSET_INFO my_charset_bin =
|
|||
my_wildcmp_bin, /* wildcmp */
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -340,10 +293,7 @@ CHARSET_INFO my_charset_bin =
|
|||
my_casedn_str_bin, /* casedn_str */
|
||||
my_caseup_bin, /* caseup */
|
||||
my_casedn_bin, /* casedn */
|
||||
my_tosort_bin, /* tosort */
|
||||
my_strcasecmp_bin, /* strcasecmp */
|
||||
my_strncasecmp_bin, /* strncasecmp */
|
||||
my_hash_caseup_bin, /* hash_caseup */
|
||||
my_hash_sort_bin, /* hash_sort */
|
||||
(char) 255, /* max_sort_char */
|
||||
my_snprintf_8bit, /* snprintf */
|
||||
|
|
|
@ -627,7 +627,6 @@ CHARSET_INFO my_charset_czech =
|
|||
my_wildcmp_8bit,
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -637,10 +636,7 @@ CHARSET_INFO my_charset_czech =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -191,11 +191,6 @@ static int ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
|||
0);
|
||||
}
|
||||
|
||||
static my_bool ismbhead_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (iseuc_kr(c));
|
||||
}
|
||||
|
||||
static int mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (iseuc_kr(c) ? 2 : 0);
|
||||
|
@ -8661,7 +8656,6 @@ CHARSET_INFO my_charset_euc_kr =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
2, /* mbmaxlen */
|
||||
ismbchar_euc_kr,
|
||||
ismbhead_euc_kr,
|
||||
mbcharlen_euc_kr,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -8671,10 +8665,7 @@ CHARSET_INFO my_charset_euc_kr =
|
|||
my_casedn_str_mb,
|
||||
my_caseup_mb,
|
||||
my_casedn_mb,
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -42,7 +42,6 @@ CHARSET_INFO compiled_charsets[] = {
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* mb_wc */
|
||||
NULL, /* wc_mb */
|
||||
|
||||
|
@ -52,8 +51,6 @@ CHARSET_INFO compiled_charsets[] = {
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
0,
|
||||
NULL,
|
||||
|
@ -64,7 +61,6 @@ CHARSET_INFO compiled_charsets[] = {
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
|
|
@ -172,11 +172,6 @@ static int ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0);
|
||||
}
|
||||
|
||||
static my_bool ismbhead_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return isgb2312head(c);
|
||||
}
|
||||
|
||||
static int mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (isgb2312head(c)? 2:0);
|
||||
|
@ -5711,7 +5706,6 @@ CHARSET_INFO my_charset_gb2312 =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
2, /* mbmaxlen */
|
||||
ismbchar_gb2312,
|
||||
ismbhead_gb2312,
|
||||
mbcharlen_gb2312,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -5721,10 +5715,7 @@ CHARSET_INFO my_charset_gb2312 =
|
|||
my_casedn_str_mb,
|
||||
my_caseup_mb,
|
||||
my_casedn_mb,
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -2619,7 +2619,7 @@ int my_strnncollsp_gbk(CHARSET_INFO * cs,
|
|||
}
|
||||
|
||||
|
||||
int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
uchar * dest, uint len,
|
||||
const uchar * src, uint srclen)
|
||||
{
|
||||
|
@ -2661,7 +2661,7 @@ int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
|
||||
#define max_sort_char ((uchar) 255)
|
||||
|
||||
extern my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *ptr,uint ptr_length,
|
||||
int escape, int w_one, int w_many,
|
||||
uint res_length, char *min_str,char *max_str,
|
||||
|
@ -2713,18 +2713,13 @@ extern my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
int ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
static int ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char* p, const char *e)
|
||||
{
|
||||
return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0);
|
||||
}
|
||||
|
||||
my_bool ismbhead_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return isgbkhead(c);
|
||||
}
|
||||
|
||||
int mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
static int mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (isgbkhead(c)? 2:0);
|
||||
}
|
||||
|
@ -9908,7 +9903,6 @@ CHARSET_INFO my_charset_gbk =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
2, /* mbmaxlen */
|
||||
ismbchar_gbk,
|
||||
ismbhead_gbk,
|
||||
mbcharlen_gbk,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -9918,10 +9912,7 @@ CHARSET_INFO my_charset_gbk =
|
|||
my_casedn_str_mb,
|
||||
my_caseup_mb,
|
||||
my_casedn_mb,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -180,7 +180,7 @@ CHARSET_INFO my_charset_latin1 =
|
|||
8,0,0, /* number */
|
||||
MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
|
||||
"latin1", /* cs name */
|
||||
"latin1", /* name */
|
||||
"latin1_swedish_ci", /* name */
|
||||
"", /* comment */
|
||||
ctype_latin1,
|
||||
to_lower_latin1,
|
||||
|
@ -197,7 +197,6 @@ CHARSET_INFO my_charset_latin1 =
|
|||
my_wildcmp_8bit, /* wildcmp */
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -207,10 +206,7 @@ CHARSET_INFO my_charset_latin1 =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
my_tosort_8bit, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
@ -454,7 +450,6 @@ CHARSET_INFO my_charset_latin1_de =
|
|||
my_wildcmp_8bit, /* wildcmp */
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -464,10 +459,7 @@ CHARSET_INFO my_charset_latin1_de =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -107,7 +107,7 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
|
|||
if (*s++ != *t++)
|
||||
return 1;
|
||||
}
|
||||
else if (my_ismbhead(cs, *t))
|
||||
else if (my_mbcharlen(cs, *t) > 1)
|
||||
return 1;
|
||||
else if (map[(uchar) *s++] != map[(uchar) *t++])
|
||||
return 1;
|
||||
|
@ -116,30 +116,6 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
|
|||
}
|
||||
|
||||
|
||||
int my_strncasecmp_mb(CHARSET_INFO * cs,
|
||||
const char *s, const char *t, uint len)
|
||||
{
|
||||
register uint32 l;
|
||||
register const char *end=s+len;
|
||||
register uchar *map=cs->to_upper;
|
||||
|
||||
while (s<end)
|
||||
{
|
||||
if ((l=my_ismbchar(cs, s,end)))
|
||||
{
|
||||
while (l--)
|
||||
if (*s++ != *t++)
|
||||
return 1;
|
||||
}
|
||||
else if (my_ismbhead(cs, *t))
|
||||
return 1;
|
||||
else if (map[(uchar) *s++] != map[(uchar) *t++])
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Compare string against string with wildcard
|
||||
** 0 if matched
|
||||
|
|
|
@ -28,13 +28,22 @@ int my_strnxfrm_simple(CHARSET_INFO * cs,
|
|||
const uchar *src, uint srclen)
|
||||
{
|
||||
uchar *map= cs->sort_order;
|
||||
const uchar *end;
|
||||
DBUG_ASSERT(len >= srclen);
|
||||
|
||||
len= min(len,srclen);
|
||||
for ( end=src+len; src < end ; )
|
||||
*dest++= map[*src++];
|
||||
return len;
|
||||
if (dest != src)
|
||||
{
|
||||
const uchar *end;
|
||||
for ( end=src+len; src < end ; )
|
||||
*dest++= map[*src++];
|
||||
return len;
|
||||
}
|
||||
else
|
||||
{
|
||||
const uchar *end;
|
||||
for ( end=dest+len; dest < end ; dest++)
|
||||
*dest= (char) map[(uchar) *dest];
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
|
||||
|
@ -98,13 +107,6 @@ void my_casedn_8bit(CHARSET_INFO * cs, char *str, uint length)
|
|||
*str= (char) map[(uchar) *str];
|
||||
}
|
||||
|
||||
void my_tosort_8bit(CHARSET_INFO *cs, char *str, uint length)
|
||||
{
|
||||
register uchar *map=cs->sort_order;
|
||||
for ( ; length>0 ; length--, str++)
|
||||
*str= (char) map[(uchar) *str];
|
||||
}
|
||||
|
||||
int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t)
|
||||
{
|
||||
register uchar *map=cs->to_upper;
|
||||
|
@ -114,14 +116,6 @@ int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t)
|
|||
}
|
||||
|
||||
|
||||
int my_strncasecmp_8bit(CHARSET_INFO * cs,
|
||||
const char *s, const char *t, uint len)
|
||||
{
|
||||
register uchar *map=cs->to_upper;
|
||||
while (len-- != 0 && map[(uchar)*s++] == map[(uchar)*t++]) ;
|
||||
return (int) len+1;
|
||||
}
|
||||
|
||||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc,
|
||||
const unsigned char *str,
|
||||
const unsigned char *end __attribute__((unused)))
|
||||
|
@ -174,41 +168,6 @@ int my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifndef NEW_HASH_FUNCTION
|
||||
|
||||
/* Calc hashvalue for a key, case indepenently */
|
||||
|
||||
uint my_hash_caseup_simple(CHARSET_INFO *cs, const byte *key, uint length)
|
||||
{
|
||||
register uint nr=1, nr2=4;
|
||||
register uchar *map=cs->to_upper;
|
||||
|
||||
while (length--)
|
||||
{
|
||||
nr^= (((nr & 63)+nr2)*
|
||||
((uint) (uchar) map[(uchar)*key++])) + (nr << 8);
|
||||
nr2+=3;
|
||||
}
|
||||
return((uint) nr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
uint my_hash_caseup_simple(CHARSET_INFO *cs, const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) (uchar) my_toupper(cs,*key);
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2)
|
||||
|
|
|
@ -189,11 +189,6 @@ static int ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
|
||||
}
|
||||
|
||||
static my_bool ismbhead_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return issjishead((uchar) c);
|
||||
}
|
||||
|
||||
static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (issjishead((uchar) c) ? 2: 0);
|
||||
|
@ -4495,7 +4490,6 @@ CHARSET_INFO my_charset_sjis =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
2, /* mbmaxlen */
|
||||
ismbchar_sjis,
|
||||
ismbhead_sjis,
|
||||
mbcharlen_sjis,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -4505,10 +4499,7 @@ CHARSET_INFO my_charset_sjis =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -718,7 +718,6 @@ CHARSET_INFO my_charset_tis620 =
|
|||
my_wildcmp_8bit, /* wildcmp */
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -728,10 +727,7 @@ CHARSET_INFO my_charset_tis620 =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -194,11 +194,6 @@ static int ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
0);
|
||||
}
|
||||
|
||||
static my_bool ismbhead_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (isujis(c) || isujis_ss2(c) || isujis_ss3(c));
|
||||
}
|
||||
|
||||
static int mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
|
||||
{
|
||||
return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 0);
|
||||
|
@ -8452,7 +8447,6 @@ CHARSET_INFO my_charset_ujis =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
3, /* mbmaxlen */
|
||||
ismbchar_ujis,
|
||||
ismbhead_ujis,
|
||||
mbcharlen_ujis,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -8462,10 +8456,7 @@ CHARSET_INFO my_charset_ujis =
|
|||
my_casedn_str_mb,
|
||||
my_caseup_mb,
|
||||
my_casedn_mb,
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
|
@ -1751,29 +1751,6 @@ static void my_caseup_utf8(CHARSET_INFO *cs, char *s, uint slen)
|
|||
}
|
||||
}
|
||||
|
||||
static uint my_hash_caseup_utf8(CHARSET_INFO *cs, const byte *s, uint slen)
|
||||
{
|
||||
my_wc_t wc;
|
||||
register uint nr=1, nr2=4;
|
||||
int res;
|
||||
const char *e=s+slen;
|
||||
|
||||
while ((s < e) && (res=my_utf8_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 )
|
||||
{
|
||||
int plane = (wc>>8) & 0xFF;
|
||||
wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc;
|
||||
nr^= (((nr & 63)+nr2)*(wc & 0xFF))+ (nr << 8);
|
||||
nr2+=3;
|
||||
nr^= (((nr & 63)+nr2)*(wc >> 8))+ (nr << 8);
|
||||
nr2+=3;
|
||||
|
||||
s+=res;
|
||||
}
|
||||
|
||||
return nr;
|
||||
}
|
||||
|
||||
|
||||
static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen, ulong *n1, ulong *n2)
|
||||
{
|
||||
my_wc_t wc;
|
||||
|
@ -1952,11 +1929,6 @@ static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e)
|
|||
return (res>1) ? res : 0;
|
||||
}
|
||||
|
||||
static my_bool my_ismbhead_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint ch)
|
||||
{
|
||||
return ( ch >= 0xc2 );
|
||||
}
|
||||
|
||||
static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c)
|
||||
{
|
||||
if (c < 0x80)
|
||||
|
@ -2000,7 +1972,6 @@ CHARSET_INFO my_charset_utf8 =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
3, /* mbmaxlen */
|
||||
my_ismbchar_utf8, /* ismbchar */
|
||||
my_ismbhead_utf8, /* ismbhead */
|
||||
my_mbcharlen_utf8, /* mbcharlen */
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
|
@ -2010,10 +1981,7 @@ CHARSET_INFO my_charset_utf8 =
|
|||
my_casedn_str_utf8,
|
||||
my_caseup_utf8,
|
||||
my_casedn_utf8,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_utf8,
|
||||
my_strncasecmp_utf8,
|
||||
my_hash_caseup_utf8,/* hash_caseup */
|
||||
my_hash_sort_utf8, /* hash_sort */
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
@ -2184,29 +2152,6 @@ static void my_caseup_ucs2(CHARSET_INFO *cs, char *s, uint slen)
|
|||
}
|
||||
}
|
||||
|
||||
static uint my_hash_caseup_ucs2(CHARSET_INFO *cs, const byte *s, uint slen)
|
||||
{
|
||||
my_wc_t wc;
|
||||
register uint nr=1, nr2=4;
|
||||
int res;
|
||||
const char *e=s+slen;
|
||||
|
||||
while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 )
|
||||
{
|
||||
int plane = (wc>>8) & 0xFF;
|
||||
wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc;
|
||||
nr^= (((nr & 63)+nr2)*(wc & 0xFF))+ (nr << 8);
|
||||
nr2+=3;
|
||||
nr^= (((nr & 63)+nr2)*(wc >> 8))+ (nr << 8);
|
||||
nr2+=3;
|
||||
|
||||
s+=res;
|
||||
}
|
||||
|
||||
return nr;
|
||||
}
|
||||
|
||||
|
||||
static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen, ulong *n1, ulong *n2)
|
||||
{
|
||||
my_wc_t wc;
|
||||
|
@ -2374,12 +2319,6 @@ static int my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return 2;
|
||||
}
|
||||
|
||||
static my_bool my_ismbhead_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
|
||||
uint ch __attribute__((unused)))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
|
||||
uint c __attribute__((unused)))
|
||||
{
|
||||
|
@ -3108,7 +3047,6 @@ CHARSET_INFO my_charset_ucs2 =
|
|||
my_wildcmp_mb, /* wildcmp */
|
||||
2, /* mbmaxlen */
|
||||
my_ismbchar_ucs2, /* ismbchar */
|
||||
my_ismbhead_ucs2, /* ismbhead */
|
||||
my_mbcharlen_ucs2, /* mbcharlen */
|
||||
my_numchars_ucs2,
|
||||
my_charpos_ucs2,
|
||||
|
@ -3118,10 +3056,7 @@ CHARSET_INFO my_charset_ucs2 =
|
|||
my_casedn_str_ucs2,
|
||||
my_caseup_ucs2,
|
||||
my_casedn_ucs2,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_ucs2,
|
||||
my_strncasecmp_ucs2,
|
||||
my_hash_caseup_ucs2,/* hash_caseup */
|
||||
my_hash_sort_ucs2, /* hash_sort */
|
||||
0,
|
||||
my_snprintf_ucs2,
|
||||
|
|
|
@ -645,7 +645,7 @@ CHARSET_INFO my_charset_win1250ch =
|
|||
34,0,0, /* number */
|
||||
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
|
||||
"cp1250", /* cs name */
|
||||
"cp1250_czech", /* name */
|
||||
"cp1250_czech_ci", /* name */
|
||||
"", /* comment */
|
||||
ctype_win1250ch,
|
||||
to_lower_win1250ch,
|
||||
|
@ -662,7 +662,6 @@ CHARSET_INFO my_charset_win1250ch =
|
|||
my_wildcmp_8bit, /* wildcmp */
|
||||
1, /* mbmaxlen */
|
||||
NULL, /* ismbchar */
|
||||
NULL, /* ismbhead */
|
||||
NULL, /* mbcharlen */
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
|
@ -672,10 +671,7 @@ CHARSET_INFO my_charset_win1250ch =
|
|||
my_casedn_str_8bit,
|
||||
my_caseup_8bit,
|
||||
my_casedn_8bit,
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
|
|
Loading…
Add table
Reference in a new issue