Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6424e9cc
Commit
6424e9cc
authored
Sep 19, 2005
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/bar/mysql-5.0.b10504
parents
541d3ae8
1d12ac88
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
2 deletions
+79
-2
include/mysql_com.h
include/mysql_com.h
+1
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+33
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+16
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+27
-0
sql/password.c
sql/password.c
+2
-2
No files found.
include/mysql_com.h
View file @
6424e9cc
...
@@ -409,6 +409,7 @@ my_bool check_scramble(const char *reply, const char *message,
...
@@ -409,6 +409,7 @@ my_bool check_scramble(const char *reply, const char *message,
const
unsigned
char
*
hash_stage2
);
const
unsigned
char
*
hash_stage2
);
void
get_salt_from_password
(
unsigned
char
*
res
,
const
char
*
password
);
void
get_salt_from_password
(
unsigned
char
*
res
,
const
char
*
password
);
void
make_password_from_salt
(
char
*
to
,
const
unsigned
char
*
hash_stage2
);
void
make_password_from_salt
(
char
*
to
,
const
unsigned
char
*
hash_stage2
);
void
octet2hex
(
char
*
to
,
const
unsigned
char
*
str
,
unsigned
int
len
);
/* end of password.c */
/* end of password.c */
...
...
mysql-test/r/ctype_utf8.result
View file @
6424e9cc
...
@@ -1028,6 +1028,39 @@ xxx
...
@@ -1028,6 +1028,39 @@ xxx
yyy
yyy
DROP TABLE t1;
DROP TABLE t1;
set names utf8;
set names utf8;
select hex(char(1));
hex(char(1))
01
select char(0xd1,0x8f);
char(0xd1,0x8f)
я
select char(0xff,0x8f);
char(0xff,0x8f)
Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
set sql_mode=traditional;
select char(0xff,0x8f);
char(0xff,0x8f)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
select char(195);
char(195)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C3'
select char(196);
char(196)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C4'
select char(2557);
char(2557)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FD'
set names utf8;
create table t1 (a char(1)) default character set utf8;
create table t1 (a char(1)) default character set utf8;
create table t2 (a char(1)) default character set utf8;
create table t2 (a char(1)) default character set utf8;
insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
...
...
mysql-test/t/ctype_utf8.test
View file @
6424e9cc
...
@@ -864,6 +864,22 @@ SELECT DISTINCT id FROM t1 ORDER BY id;
...
@@ -864,6 +864,22 @@ SELECT DISTINCT id FROM t1 ORDER BY id;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bugs#10504: Character set does not support traditional mode
#
set
names
utf8
;
# correct value
select
hex
(
char
(
1
));
select
char
(
0xd1
,
0x8f
);
# incorrect value: return with warning
select
char
(
0xff
,
0x8f
);
# incorrect value in strict mode: return NULL with "Error" level warning
set
sql_mode
=
traditional
;
select
char
(
0xff
,
0x8f
);
select
char
(
195
);
select
char
(
196
);
select
char
(
2557
);
#
#
# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters
# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters
#
#
...
...
sql/item_strfunc.cc
View file @
6424e9cc
...
@@ -1980,6 +1980,33 @@ b1: str->append((char)(num>>8));
...
@@ -1980,6 +1980,33 @@ b1: str->append((char)(num>>8));
}
}
str
->
set_charset
(
collation
.
collation
);
str
->
set_charset
(
collation
.
collation
);
str
->
realloc
(
str
->
length
());
// Add end 0 (for Purify)
str
->
realloc
(
str
->
length
());
// Add end 0 (for Purify)
/* Check whether we got a well-formed string */
CHARSET_INFO
*
cs
=
collation
.
collation
;
int
well_formed_error
;
uint
wlen
=
cs
->
cset
->
well_formed_len
(
cs
,
str
->
ptr
(),
str
->
ptr
()
+
str
->
length
(),
str
->
length
(),
&
well_formed_error
);
if
(
wlen
<
str
->
length
())
{
THD
*
thd
=
current_thd
;
char
hexbuf
[
7
];
enum
MYSQL_ERROR
::
enum_warning_level
level
;
uint
diff
=
str
->
length
()
-
wlen
;
set_if_smaller
(
diff
,
3
);
octet2hex
(
hexbuf
,
(
const
uchar
*
)
str
->
ptr
()
+
wlen
,
diff
);
if
(
thd
->
variables
.
sql_mode
&
(
MODE_STRICT_TRANS_TABLES
|
MODE_STRICT_ALL_TABLES
))
{
level
=
MYSQL_ERROR
::
WARN_LEVEL_ERROR
;
null_value
=
1
;
str
=
0
;
}
else
level
=
MYSQL_ERROR
::
WARN_LEVEL_WARN
;
push_warning_printf
(
thd
,
level
,
ER_INVALID_CHARACTER_STRING
,
ER
(
ER_INVALID_CHARACTER_STRING
),
cs
->
csname
,
hexbuf
);
}
return
str
;
return
str
;
}
}
...
...
sql/password.c
View file @
6424e9cc
...
@@ -318,8 +318,8 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st)
...
@@ -318,8 +318,8 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st)
str, len IN the beginning and the length of the input string
str, len IN the beginning and the length of the input string
*/
*/
static
void
void
octet2hex
(
char
*
to
,
const
u
int8
*
str
,
uint
len
)
octet2hex
(
char
*
to
,
const
u
nsigned
char
*
str
,
uint
len
)
{
{
const
uint8
*
str_end
=
str
+
len
;
const
uint8
*
str_end
=
str
+
len
;
for
(;
str
!=
str_end
;
++
str
)
for
(;
str
!=
str_end
;
++
str
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment