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
ed79d2ec
Commit
ed79d2ec
authored
Jan 22, 2010
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#49501 Inefficient information_schema check (system collation), addon
removed wrongly introduced strlen calls
parent
dc4e8890
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
8 deletions
+13
-8
sql/events.cc
sql/events.cc
+1
-2
sql/mysql_priv.h
sql/mysql_priv.h
+6
-0
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+3
-3
sql/sql_show.cc
sql/sql_show.cc
+1
-1
No files found.
sql/events.cc
View file @
ed79d2ec
...
@@ -871,8 +871,7 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
...
@@ -871,8 +871,7 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
if
(
thd
->
lex
->
sql_command
==
SQLCOM_SHOW_EVENTS
)
if
(
thd
->
lex
->
sql_command
==
SQLCOM_SHOW_EVENTS
)
{
{
DBUG_ASSERT
(
thd
->
lex
->
select_lex
.
db
);
DBUG_ASSERT
(
thd
->
lex
->
select_lex
.
db
);
if
(
!
is_schema_db
(
thd
->
lex
->
select_lex
.
db
,
// There is no events in I_S
if
(
!
is_schema_db
(
thd
->
lex
->
select_lex
.
db
)
&&
// There is no events in I_S
strlen
(
thd
->
lex
->
select_lex
.
db
))
&&
check_access
(
thd
,
EVENT_ACL
,
thd
->
lex
->
select_lex
.
db
,
0
,
0
,
0
,
0
))
check_access
(
thd
,
EVENT_ACL
,
thd
->
lex
->
select_lex
.
db
,
0
,
0
,
0
,
0
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
db
=
thd
->
lex
->
select_lex
.
db
;
db
=
thd
->
lex
->
select_lex
.
db
;
...
...
sql/mysql_priv.h
View file @
ed79d2ec
...
@@ -1426,6 +1426,12 @@ inline bool is_schema_db(const char *name, size_t len)
...
@@ -1426,6 +1426,12 @@ inline bool is_schema_db(const char *name, size_t len)
INFORMATION_SCHEMA_NAME
.
str
,
name
));
INFORMATION_SCHEMA_NAME
.
str
,
name
));
}
}
inline
bool
is_schema_db
(
const
char
*
name
)
{
return
!
my_strcasecmp
(
system_charset_info
,
INFORMATION_SCHEMA_NAME
.
str
,
name
);
}
/* sql_prepare.cc */
/* sql_prepare.cc */
void
mysqld_stmt_prepare
(
THD
*
thd
,
const
char
*
packet
,
uint
packet_length
);
void
mysqld_stmt_prepare
(
THD
*
thd
,
const
char
*
packet
,
uint
packet_length
);
...
...
sql/repl_failsafe.cc
View file @
ed79d2ec
...
@@ -905,7 +905,7 @@ bool load_master_data(THD* thd)
...
@@ -905,7 +905,7 @@ bool load_master_data(THD* thd)
if
(
!
rpl_filter
->
db_ok
(
db
)
||
if
(
!
rpl_filter
->
db_ok
(
db
)
||
!
rpl_filter
->
db_ok_with_wild_table
(
db
)
||
!
rpl_filter
->
db_ok_with_wild_table
(
db
)
||
!
strcmp
(
db
,
"mysql"
)
||
!
strcmp
(
db
,
"mysql"
)
||
is_schema_db
(
db
,
strlen
(
db
)
))
is_schema_db
(
db
))
{
{
*
cur_table_res
=
0
;
*
cur_table_res
=
0
;
continue
;
continue
;
...
...
sql/sql_db.cc
View file @
ed79d2ec
...
@@ -618,7 +618,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
...
@@ -618,7 +618,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
DBUG_ENTER
(
"mysql_create_db"
);
DBUG_ENTER
(
"mysql_create_db"
);
/* do not create 'information_schema' db */
/* do not create 'information_schema' db */
if
(
is_schema_db
(
db
,
strlen
(
db
)
))
if
(
is_schema_db
(
db
))
{
{
my_error
(
ER_DB_CREATE_EXISTS
,
MYF
(
0
),
db
);
my_error
(
ER_DB_CREATE_EXISTS
,
MYF
(
0
),
db
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
...
...
sql/sql_parse.cc
View file @
ed79d2ec
...
@@ -2852,7 +2852,7 @@ end_with_restore_list:
...
@@ -2852,7 +2852,7 @@ end_with_restore_list:
&
first_table
->
grant
.
privilege
,
0
,
0
,
&
first_table
->
grant
.
privilege
,
0
,
0
,
test
(
first_table
->
schema_table
))
||
test
(
first_table
->
schema_table
))
||
check_access
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
select_lex
->
db
,
&
priv
,
0
,
0
,
check_access
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
select_lex
->
db
,
&
priv
,
0
,
0
,
is_schema_db
(
select_lex
->
db
,
strlen
(
select_lex
->
db
)
))
||
is_schema_db
(
select_lex
->
db
))
||
check_merge_table_access
(
thd
,
first_table
->
db
,
check_merge_table_access
(
thd
,
first_table
->
db
,
(
TABLE_LIST
*
)
(
TABLE_LIST
*
)
create_info
.
merge_list
.
first
))
create_info
.
merge_list
.
first
))
...
@@ -3865,7 +3865,7 @@ end_with_restore_list:
...
@@ -3865,7 +3865,7 @@ end_with_restore_list:
first_table
?
0
:
1
,
0
,
first_table
?
0
:
1
,
0
,
first_table
?
(
bool
)
first_table
->
schema_table
:
first_table
?
(
bool
)
first_table
->
schema_table
:
select_lex
->
db
?
select_lex
->
db
?
is_schema_db
(
select_lex
->
db
,
strlen
(
select_lex
->
db
)
)
:
0
))
is_schema_db
(
select_lex
->
db
)
:
0
))
goto
error
;
goto
error
;
if
(
thd
->
security_ctx
->
user
)
// If not replication
if
(
thd
->
security_ctx
->
user
)
// If not replication
...
@@ -5304,7 +5304,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
...
@@ -5304,7 +5304,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
if
(
check_access
(
thd
,
SELECT_ACL
,
dst_db_name
,
if
(
check_access
(
thd
,
SELECT_ACL
,
dst_db_name
,
&
thd
->
col_access
,
FALSE
,
FALSE
,
&
thd
->
col_access
,
FALSE
,
FALSE
,
is_schema_db
(
dst_db_name
,
strlen
(
dst_db_name
)
)))
is_schema_db
(
dst_db_name
)))
return
TRUE
;
return
TRUE
;
if
(
!
thd
->
col_access
&&
check_grant_db
(
thd
,
dst_db_name
))
if
(
!
thd
->
col_access
&&
check_grant_db
(
thd
,
dst_db_name
))
...
...
sql/sql_show.cc
View file @
ed79d2ec
...
@@ -826,7 +826,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname,
...
@@ -826,7 +826,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname,
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
#endif
#endif
if
(
is_schema_db
(
dbname
,
strlen
(
dbname
)
))
if
(
is_schema_db
(
dbname
))
{
{
dbname
=
INFORMATION_SCHEMA_NAME
.
str
;
dbname
=
INFORMATION_SCHEMA_NAME
.
str
;
create
.
default_table_charset
=
system_charset_info
;
create
.
default_table_charset
=
system_charset_info
;
...
...
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