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
333b91f8
Commit
333b91f8
authored
Nov 01, 2007
by
davi@endora.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge endora.local:/Users/davi/mysql/bugs/31850-5.1
into endora.local:/Users/davi/mysql/mysql-5.1-runtime
parents
8f90f66d
968af721
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
sql/sql_connect.cc
sql/sql_connect.cc
+9
-14
sql/sql_parse.cc
sql/sql_parse.cc
+3
-2
No files found.
sql/sql_connect.cc
View file @
333b91f8
...
@@ -318,16 +318,19 @@ check_user(THD *thd, enum enum_server_command command,
...
@@ -318,16 +318,19 @@ check_user(THD *thd, enum enum_server_command command,
DBUG_ENTER
(
"check_user"
);
DBUG_ENTER
(
"check_user"
);
LEX_STRING
db_str
=
{
(
char
*
)
db
,
db
?
strlen
(
db
)
:
0
};
LEX_STRING
db_str
=
{
(
char
*
)
db
,
db
?
strlen
(
db
)
:
0
};
/*
Clear thd->db as it points to something, that will be freed when
connection is closed. We don't want to accidentally free a wrong
pointer if connect failed. Also in case of 'CHANGE USER' failure,
current database will be switched to 'no database selected'.
*/
thd
->
reset_db
(
NULL
,
0
);
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#ifdef NO_EMBEDDED_ACCESS_CHECKS
thd
->
main_security_ctx
.
master_access
=
GLOBAL_ACLS
;
// Full rights
thd
->
main_security_ctx
.
master_access
=
GLOBAL_ACLS
;
// Full rights
/* Change database if necessary */
/* Change database if necessary */
if
(
db
&&
db
[
0
])
if
(
db
&&
db
[
0
])
{
{
/*
thd->db is saved in caller and needs to be freed by caller if this
function returns 0
*/
thd
->
reset_db
(
NULL
,
0
);
if
(
mysql_change_db
(
thd
,
&
db_str
,
FALSE
))
if
(
mysql_change_db
(
thd
,
&
db_str
,
FALSE
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
@@ -358,14 +361,6 @@ check_user(THD *thd, enum enum_server_command command,
...
@@ -358,14 +361,6 @@ check_user(THD *thd, enum enum_server_command command,
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
/*
Clear thd->db as it points to something, that will be freed when
connection is closed. We don't want to accidentally free a wrong pointer
if connect failed. Also in case of 'CHANGE USER' failure, current
database will be switched to 'no database selected'.
*/
thd
->
reset_db
(
NULL
,
0
);
USER_RESOURCES
ur
;
USER_RESOURCES
ur
;
int
res
=
acl_getroot
(
thd
,
&
ur
,
passwd
,
passwd_len
);
int
res
=
acl_getroot
(
thd
,
&
ur
,
passwd
,
passwd_len
);
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
...
...
sql/sql_parse.cc
View file @
333b91f8
...
@@ -911,6 +911,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
...
@@ -911,6 +911,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Clear variables that are allocated */
/* Clear variables that are allocated */
thd
->
user_connect
=
0
;
thd
->
user_connect
=
0
;
thd
->
security_ctx
->
priv_user
=
thd
->
security_ctx
->
user
;
res
=
check_user
(
thd
,
COM_CHANGE_USER
,
passwd
,
passwd_len
,
db
,
FALSE
);
res
=
check_user
(
thd
,
COM_CHANGE_USER
,
passwd
,
passwd_len
,
db
,
FALSE
);
if
(
res
)
if
(
res
)
...
@@ -928,8 +929,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
...
@@ -928,8 +929,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if
(
save_user_connect
)
if
(
save_user_connect
)
decrease_user_connections
(
save_user_connect
);
decrease_user_connections
(
save_user_connect
);
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
x_free
(
(
uchar
*
)
save_db
);
x_free
(
save_db
);
x_free
(
(
uchar
*
)
save_security_ctx
.
user
);
x_free
(
save_security_ctx
.
user
);
if
(
cs_number
)
if
(
cs_number
)
{
{
...
...
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