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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
161d4eea
Commit
161d4eea
authored
Nov 24, 2010
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
af6ceb25
1c37eaaa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
7 deletions
+56
-7
mysql-test/r/connect.result
mysql-test/r/connect.result
+11
-0
mysql-test/t/connect.test
mysql-test/t/connect.test
+28
-0
sql/sql_connect.cc
sql/sql_connect.cc
+13
-0
strings/CHARSET_INFO.txt
strings/CHARSET_INFO.txt
+4
-7
No files found.
mysql-test/r/connect.result
View file @
161d4eea
...
...
@@ -215,6 +215,17 @@ SET GLOBAL event_scheduler = OFF;
# -- End of Bug#35074.
#
# -- Bug#49752: 2469.126.2 unintentionally breaks authentication
# against MySQL 5.1 server
#
GRANT ALL ON test.* TO 'Azundris12345678'@'localhost' IDENTIFIED BY 'test123';
FLUSH PRIVILEGES;
DROP USER 'Azundris12345678'@'localhost';
FLUSH PRIVILEGES;
#
# -- End of Bug#49752
#
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/t/connect.test
View file @
161d4eea
...
...
@@ -293,6 +293,34 @@ SET GLOBAL event_scheduler = OFF;
--
echo
# -- End of Bug#35074.
--
echo
###########################################################################
--
echo
#
--
echo
# -- Bug#49752: 2469.126.2 unintentionally breaks authentication
--
echo
# against MySQL 5.1 server
--
echo
#
GRANT
ALL
ON
test
.*
TO
'Azundris12345678'
@
'localhost'
IDENTIFIED
BY
'test123'
;
FLUSH
PRIVILEGES
;
--
replace_result
$MASTER_MYSOCK
MASTER_SOCKET
$MASTER_MYPORT
MASTER_PORT
connect
(
con1
,
localhost
,
Azundris123456789
,
test123
,
test
);
disconnect
con1
;
connection
default
;
DROP
USER
'Azundris12345678'
@
'localhost'
;
FLUSH
PRIVILEGES
;
--
echo
#
--
echo
# -- End of Bug#49752
--
echo
#
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
...
...
sql/sql_connect.cc
View file @
161d4eea
...
...
@@ -899,6 +899,19 @@ static int check_connection(THD *thd)
user_len
-=
2
;
}
/*
Clip username to allowed length in characters (not bytes). This is
mostly for backward compatibility.
*/
{
CHARSET_INFO
*
cs
=
system_charset_info
;
int
err
;
user_len
=
(
uint
)
cs
->
cset
->
well_formed_len
(
cs
,
user
,
user
+
user_len
,
USERNAME_CHAR_LENGTH
,
&
err
);
user
[
user_len
]
=
'\0'
;
}
if
(
thd
->
main_security_ctx
.
user
)
x_free
(
thd
->
main_security_ctx
.
user
);
if
(
!
(
thd
->
main_security_ctx
.
user
=
my_strdup
(
user
,
MYF
(
MY_WME
))))
...
...
strings/CHARSET_INFO.txt
View file @
161d4eea
...
...
@@ -208,14 +208,11 @@ charpos() - calculates the offset of the given position in the string.
Used in SQL functions LEFT(), RIGHT(), SUBSTRING(),
INSERT()
well_formed_length()
- finds the length of correctly formed multi-byte beginning.
Used in INSERTs to cut a beginning of the given string
which is
a) "well formed" according to the given character set.
well_formed_len()
- returns length of a given multi-byte string in bytes
Used in INSERTs to shorten the given string so it
a) is "well formed" according to the given character set
b) can fit into the given data type
Terminates the string in the good position, taking in account
multi-byte character boundaries.
lengthsp() - returns the length of the given string without trailing spaces.
...
...
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