mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into mysql.com:/home/bar/mysql-work/mysql-5.1.b28600
This commit is contained in:
commit
c826b4e75d
4 changed files with 20482 additions and 17 deletions
19159
mysql-test/r/ctype_ujis_ucs2.result
Normal file
19159
mysql-test/r/ctype_ujis_ucs2.result
Normal file
File diff suppressed because it is too large
Load diff
1306
mysql-test/t/ctype_ujis_ucs2.test
Normal file
1306
mysql-test/t/ctype_ujis_ucs2.test
Normal file
File diff suppressed because it is too large
Load diff
22
sql/field.cc
22
sql/field.cc
|
@ -5911,6 +5911,7 @@ void Field_datetime::sql_type(String &res) const
|
||||||
well_formed_error_pos - where not well formed data was first met
|
well_formed_error_pos - where not well formed data was first met
|
||||||
cannot_convert_error_pos - where a not-convertable character was first met
|
cannot_convert_error_pos - where a not-convertable character was first met
|
||||||
end - end of the string
|
end - end of the string
|
||||||
|
cs - character set of the string
|
||||||
|
|
||||||
NOTES
|
NOTES
|
||||||
As of version 5.0 both cases return the same error:
|
As of version 5.0 both cases return the same error:
|
||||||
|
@ -5930,7 +5931,8 @@ static bool
|
||||||
check_string_copy_error(Field_str *field,
|
check_string_copy_error(Field_str *field,
|
||||||
const char *well_formed_error_pos,
|
const char *well_formed_error_pos,
|
||||||
const char *cannot_convert_error_pos,
|
const char *cannot_convert_error_pos,
|
||||||
const char *end)
|
const char *end,
|
||||||
|
CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
const char *pos, *end_orig;
|
const char *pos, *end_orig;
|
||||||
char tmp[64], *t;
|
char tmp[64], *t;
|
||||||
|
@ -5944,8 +5946,18 @@ check_string_copy_error(Field_str *field,
|
||||||
|
|
||||||
for (t= tmp; pos < end; pos++)
|
for (t= tmp; pos < end; pos++)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
If the source string is ASCII compatible (mbminlen==1)
|
||||||
|
and the source character is in ASCII printable range (0x20..0x7F),
|
||||||
|
then display the character as is.
|
||||||
|
|
||||||
|
Otherwise, if the source string is not ASCII compatible (e.g. UCS2),
|
||||||
|
or the source character is not in the printable range,
|
||||||
|
then print the character using HEX notation.
|
||||||
|
*/
|
||||||
if (((unsigned char) *pos) >= 0x20 &&
|
if (((unsigned char) *pos) >= 0x20 &&
|
||||||
((unsigned char) *pos) <= 0x7F)
|
((unsigned char) *pos) <= 0x7F &&
|
||||||
|
cs->mbminlen == 1)
|
||||||
{
|
{
|
||||||
*t++= *pos;
|
*t++= *pos;
|
||||||
}
|
}
|
||||||
|
@ -6027,7 +6039,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||||
field_charset->pad_char);
|
field_charset->pad_char);
|
||||||
|
|
||||||
if (check_string_copy_error(this, well_formed_error_pos,
|
if (check_string_copy_error(this, well_formed_error_pos,
|
||||||
cannot_convert_error_pos, from + length))
|
cannot_convert_error_pos, from + length, cs))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6479,7 +6491,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||||
int2store(ptr, copy_length);
|
int2store(ptr, copy_length);
|
||||||
|
|
||||||
if (check_string_copy_error(this, well_formed_error_pos,
|
if (check_string_copy_error(this, well_formed_error_pos,
|
||||||
cannot_convert_error_pos, from + length))
|
cannot_convert_error_pos, from + length, cs))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
// Check if we lost something other than just trailing spaces
|
// Check if we lost something other than just trailing spaces
|
||||||
|
@ -7160,7 +7172,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||||
bmove(ptr+packlength,(char*) &tmp,sizeof(char*));
|
bmove(ptr+packlength,(char*) &tmp,sizeof(char*));
|
||||||
|
|
||||||
if (check_string_copy_error(this, well_formed_error_pos,
|
if (check_string_copy_error(this, well_formed_error_pos,
|
||||||
cannot_convert_error_pos, from + length))
|
cannot_convert_error_pos, from + length, cs))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
if (from_end_pos < from + length)
|
if (from_end_pos < from + length)
|
||||||
|
|
|
@ -264,18 +264,6 @@ my_wc_mb_jisx0201(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wc == 0x00A5)
|
|
||||||
{
|
|
||||||
*s = 0x5C;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wc == 0x203E)
|
|
||||||
{
|
|
||||||
*s = 0x7E;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return MY_CS_ILUNI;
|
return MY_CS_ILUNI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue