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
d81b662b
Commit
d81b662b
authored
May 01, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Asserting correct database name lettercase in
various places in the code.
parent
5b6c75ca
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
0 deletions
+31
-0
sql/events.cc
sql/events.cc
+2
-0
sql/lock.cc
sql/lock.cc
+2
-0
sql/mdl.h
sql/mdl.h
+2
-0
sql/sp.cc
sql/sp.cc
+2
-0
sql/sp_head.cc
sql/sp_head.cc
+1
-0
sql/sql_cache.cc
sql/sql_cache.cc
+2
-0
sql/table.cc
sql/table.cc
+18
-0
sql/table.h
sql/table.h
+2
-0
No files found.
sql/events.cc
View file @
d81b662b
...
@@ -596,6 +596,8 @@ Events::drop_schema_events(THD *thd, char *db)
...
@@ -596,6 +596,8 @@ Events::drop_schema_events(THD *thd, char *db)
DBUG_ENTER
(
"Events::drop_schema_events"
);
DBUG_ENTER
(
"Events::drop_schema_events"
);
DBUG_PRINT
(
"enter"
,
(
"dropping events from %s"
,
db
));
DBUG_PRINT
(
"enter"
,
(
"dropping events from %s"
,
db
));
DBUG_ASSERT
(
ok_for_lower_case_names
(
db
));
/*
/*
Sic: no check if the scheduler is disabled or system tables
Sic: no check if the scheduler is disabled or system tables
are damaged, as intended.
are damaged, as intended.
...
...
sql/lock.cc
View file @
d81b662b
...
@@ -860,6 +860,8 @@ bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
...
@@ -860,6 +860,8 @@ bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
MDL_request
schema_request
;
MDL_request
schema_request
;
MDL_request
mdl_request
;
MDL_request
mdl_request
;
DBUG_ASSERT
(
ok_for_lower_case_names
(
db
));
if
(
thd
->
locked_tables_mode
)
if
(
thd
->
locked_tables_mode
)
{
{
my_message
(
ER_LOCK_OR_ACTIVE_TRANSACTION
,
my_message
(
ER_LOCK_OR_ACTIVE_TRANSACTION
,
...
...
sql/mdl.h
View file @
d81b662b
...
@@ -37,6 +37,7 @@ class THD;
...
@@ -37,6 +37,7 @@ class THD;
class
MDL_context
;
class
MDL_context
;
class
MDL_lock
;
class
MDL_lock
;
class
MDL_ticket
;
class
MDL_ticket
;
bool
ok_for_lower_case_names
(
const
char
*
name
);
/**
/**
@def ENTER_COND(C, M, S, O)
@def ENTER_COND(C, M, S, O)
...
@@ -350,6 +351,7 @@ public:
...
@@ -350,6 +351,7 @@ public:
NAME_LEN
)
-
m_ptr
+
1
);
NAME_LEN
)
-
m_ptr
+
1
);
m_hash_value
=
my_hash_sort
(
&
my_charset_bin
,
(
uchar
*
)
m_ptr
+
1
,
m_hash_value
=
my_hash_sort
(
&
my_charset_bin
,
(
uchar
*
)
m_ptr
+
1
,
m_length
-
1
);
m_length
-
1
);
DBUG_ASSERT
(
ok_for_lower_case_names
(
db
));
}
}
void
mdl_key_init
(
const
MDL_key
*
rhs
)
void
mdl_key_init
(
const
MDL_key
*
rhs
)
{
{
...
...
sql/sp.cc
View file @
d81b662b
...
@@ -1437,6 +1437,8 @@ bool lock_db_routines(THD *thd, char *db)
...
@@ -1437,6 +1437,8 @@ bool lock_db_routines(THD *thd, char *db)
uchar
keybuf
[
MAX_KEY_LENGTH
];
uchar
keybuf
[
MAX_KEY_LENGTH
];
DBUG_ENTER
(
"lock_db_routines"
);
DBUG_ENTER
(
"lock_db_routines"
);
DBUG_ASSERT
(
ok_for_lower_case_names
(
db
));
/*
/*
mysql.proc will be re-opened during deletion, so we can ignore
mysql.proc will be re-opened during deletion, so we can ignore
errors when opening the table here. The error handler is
errors when opening the table here. The error handler is
...
...
sql/sp_head.cc
View file @
d81b662b
...
@@ -493,6 +493,7 @@ sp_name::init_qname(THD *thd)
...
@@ -493,6 +493,7 @@ sp_name::init_qname(THD *thd)
(
int
)
m_db
.
length
,
(
m_db
.
length
?
m_db
.
str
:
""
),
(
int
)
m_db
.
length
,
(
m_db
.
length
?
m_db
.
str
:
""
),
dot
,
"."
,
dot
,
"."
,
(
int
)
m_name
.
length
,
m_name
.
str
);
(
int
)
m_name
.
length
,
m_name
.
str
);
DBUG_ASSERT
(
ok_for_lower_case_names
(
m_db
.
str
));
}
}
...
...
sql/sql_cache.cc
View file @
d81b662b
...
@@ -2306,6 +2306,8 @@ void Query_cache::invalidate(THD *thd, char *db)
...
@@ -2306,6 +2306,8 @@ void Query_cache::invalidate(THD *thd, char *db)
if
(
is_disabled
())
if
(
is_disabled
())
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
DBUG_ASSERT
(
ok_for_lower_case_names
(
db
));
bool
restart
=
FALSE
;
bool
restart
=
FALSE
;
/*
/*
Lock the query cache and queue all invalidation attempts to avoid
Lock the query cache and queue all invalidation attempts to avoid
...
...
sql/table.cc
View file @
d81b662b
...
@@ -3436,6 +3436,24 @@ uint calculate_key_len(TABLE *table, uint key, const uchar *buf,
...
@@ -3436,6 +3436,24 @@ uint calculate_key_len(TABLE *table, uint key, const uchar *buf,
return
length
;
return
length
;
}
}
#ifndef DBUG_OFF
/**
Verifies that database/table name is in lowercase, when it should be
This is supposed to be used only inside DBUG_ASSERT()
*/
bool
ok_for_lower_case_names
(
const
char
*
name
)
{
if
(
!
lower_case_table_names
||
!
name
)
return
true
;
char
buf
[
SAFE_NAME_LEN
];
strmake_buf
(
buf
,
name
);
my_casedn_str
(
files_charset_info
,
buf
);
return
strcmp
(
name
,
buf
)
==
0
;
}
#endif
/*
/*
Check if database name is valid
Check if database name is valid
...
...
sql/table.h
View file @
d81b662b
...
@@ -2511,6 +2511,8 @@ static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
...
@@ -2511,6 +2511,8 @@ static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
#endif
#endif
}
}
bool
ok_for_lower_case_names
(
const
char
*
names
);
enum
get_table_share_flags
{
enum
get_table_share_flags
{
GTS_TABLE
=
1
,
GTS_TABLE
=
1
,
GTS_VIEW
=
2
,
GTS_VIEW
=
2
,
...
...
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