mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
type_binary.result, type_binary.test:
new file mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh: Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding. Many files: Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes. Adding true BINARY/VARBINARY: new pad_char structure member. ctype-bin.c: Adding true BINARY/VARBINARY: new pad_char structure member. New strnxfrm, with two trailing length bytes. field.cc: Adding true BINARY/VARBINARY.
This commit is contained in:
@ -86,6 +86,14 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
|
||||
}
|
||||
|
||||
|
||||
uint my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *ptr __attribute__((unused)),
|
||||
uint length)
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Compare two strings. Result is sign(first_argument - second_argument)
|
||||
|
||||
@ -365,14 +373,29 @@ static int my_wildcmp_bin(CHARSET_INFO *cs,
|
||||
}
|
||||
|
||||
|
||||
uint my_strnxfrmlen_bin(CHARSET_INFO *cs __attribute__((unused)), uint len)
|
||||
{
|
||||
return len + 2;
|
||||
}
|
||||
|
||||
|
||||
static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
uchar * dest, uint dstlen,
|
||||
const uchar *src, uint srclen)
|
||||
{
|
||||
if (dest != src)
|
||||
memcpy(dest, src, min(dstlen,srclen));
|
||||
if (dstlen > srclen)
|
||||
|
||||
if (dstlen >= srclen + 2)
|
||||
{
|
||||
if (dstlen > srclen + 2)
|
||||
bfill(dest + srclen, dstlen - srclen - 2, 0);
|
||||
dest[dstlen-2]= srclen >> 8;
|
||||
dest[dstlen-1]= srclen & 0xFF;
|
||||
}
|
||||
else if (dstlen > srclen)
|
||||
bfill(dest + srclen, dstlen - srclen, 0);
|
||||
|
||||
return dstlen;
|
||||
}
|
||||
|
||||
@ -473,7 +496,7 @@ static MY_COLLATION_HANDLER my_collation_binary_handler =
|
||||
my_strnncoll_binary,
|
||||
my_strnncollsp_binary,
|
||||
my_strnxfrm_bin,
|
||||
my_strnxfrmlen_simple,
|
||||
my_strnxfrmlen_bin,
|
||||
my_like_range_simple,
|
||||
my_wildcmp_bin,
|
||||
my_strcasecmp_bin,
|
||||
@ -491,7 +514,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
|
||||
my_numchars_8bit,
|
||||
my_charpos_8bit,
|
||||
my_well_formed_len_8bit,
|
||||
my_lengthsp_8bit,
|
||||
my_lengthsp_binary,
|
||||
my_numcells_8bit,
|
||||
my_mb_wc_bin,
|
||||
my_wc_mb_bin,
|
||||
@ -516,7 +539,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
|
||||
CHARSET_INFO my_charset_bin =
|
||||
{
|
||||
63,0,0, /* number */
|
||||
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */
|
||||
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY|MY_CS_STRNXFRM,/* state */
|
||||
"binary", /* cs name */
|
||||
"binary", /* name */
|
||||
"", /* comment */
|
||||
@ -539,6 +562,7 @@ CHARSET_INFO my_charset_bin =
|
||||
1, /* mbmaxlen */
|
||||
0, /* min_sort_char */
|
||||
255, /* max_sort_char */
|
||||
0, /* pad char */
|
||||
0, /* escape_with_backslash_is_dangerous */
|
||||
&my_charset_handler,
|
||||
&my_collation_binary_handler
|
||||
|
Reference in New Issue
Block a user