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
d108c80e
Commit
d108c80e
authored
May 27, 2010
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type mismatch. Table names are represented as LEX_STRING
objects whose length is stored in a size_t type.
parent
ad081387
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
sql/log.cc
sql/log.cc
+2
-2
sql/log.h
sql/log.h
+2
-2
sql/table.cc
sql/table.cc
+9
-7
sql/table.h
sql/table.h
+1
-1
No files found.
sql/log.cc
View file @
d108c80e
...
@@ -370,8 +370,8 @@ bool LOGGER::is_log_table_enabled(uint log_table_type)
...
@@ -370,8 +370,8 @@ bool LOGGER::is_log_table_enabled(uint log_table_type)
/* Check if a given table is opened log table */
/* Check if a given table is opened log table */
int
check_if_log_table
(
uint
db_len
,
const
char
*
db
,
uin
t
table_name_len
,
int
check_if_log_table
(
size_t
db_len
,
const
char
*
db
,
size_
t
table_name_len
,
const
char
*
table_name
,
uint
check_if_opened
)
const
char
*
table_name
,
bool
check_if_opened
)
{
{
if
(
db_len
==
5
&&
if
(
db_len
==
5
&&
!
(
lower_case_table_names
?
!
(
lower_case_table_names
?
...
...
sql/log.h
View file @
d108c80e
...
@@ -499,8 +499,8 @@ class Log_event_handler
...
@@ -499,8 +499,8 @@ class Log_event_handler
};
};
int
check_if_log_table
(
uint
db_len
,
const
char
*
db
,
uin
t
table_name_len
,
int
check_if_log_table
(
size_t
db_len
,
const
char
*
db
,
size_
t
table_name_len
,
const
char
*
table_name
,
uint
check_if_opened
);
const
char
*
table_name
,
bool
check_if_opened
);
class
Log_to_csv_event_handler
:
public
Log_event_handler
class
Log_to_csv_event_handler
:
public
Log_event_handler
{
{
...
...
sql/table.cc
View file @
d108c80e
...
@@ -2777,9 +2777,10 @@ bool check_db_name(LEX_STRING *org_name)
...
@@ -2777,9 +2777,10 @@ bool check_db_name(LEX_STRING *org_name)
*/
*/
bool
check_table_name
(
const
char
*
name
,
uin
t
length
)
bool
check_table_name
(
const
char
*
name
,
size_
t
length
)
{
{
uint
name_length
=
0
;
// name length in symbols
// name length in symbols
size_t
name_length
=
0
;
const
char
*
end
=
name
+
length
;
const
char
*
end
=
name
+
length
;
if
(
!
length
||
length
>
NAME_LEN
)
if
(
!
length
||
length
>
NAME_LEN
)
return
1
;
return
1
;
...
@@ -2809,18 +2810,19 @@ bool check_table_name(const char *name, uint length)
...
@@ -2809,18 +2810,19 @@ bool check_table_name(const char *name, uint length)
name_length
++
;
name_length
++
;
}
}
#if defined(USE_MB) && defined(USE_MB_IDENT)
#if defined(USE_MB) && defined(USE_MB_IDENT)
return
(
last_char_is_space
||
name_length
>
NAME_CHAR_LEN
)
;
return
last_char_is_space
||
(
name_length
>
NAME_CHAR_LEN
)
;
#else
#else
return
0
;
return
FALSE
;
#endif
#endif
}
}
bool
check_column_name
(
const
char
*
name
)
bool
check_column_name
(
const
char
*
name
)
{
{
uint
name_length
=
0
;
// name length in symbols
// name length in symbols
size_t
name_length
=
0
;
bool
last_char_is_space
=
TRUE
;
bool
last_char_is_space
=
TRUE
;
while
(
*
name
)
while
(
*
name
)
{
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
#if defined(USE_MB) && defined(USE_MB_IDENT)
...
@@ -2845,7 +2847,7 @@ bool check_column_name(const char *name)
...
@@ -2845,7 +2847,7 @@ bool check_column_name(const char *name)
name_length
++
;
name_length
++
;
}
}
/* Error if empty or too long column name */
/* Error if empty or too long column name */
return
last_char_is_space
||
(
uint
)
name_length
>
NAME_CHAR_LEN
;
return
last_char_is_space
||
(
name_length
>
NAME_CHAR_LEN
)
;
}
}
...
...
sql/table.h
View file @
d108c80e
...
@@ -2001,7 +2001,7 @@ void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form);
...
@@ -2001,7 +2001,7 @@ void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form);
bool
check_and_convert_db_name
(
LEX_STRING
*
db
,
bool
preserve_lettercase
);
bool
check_and_convert_db_name
(
LEX_STRING
*
db
,
bool
preserve_lettercase
);
bool
check_db_name
(
LEX_STRING
*
db
);
bool
check_db_name
(
LEX_STRING
*
db
);
bool
check_column_name
(
const
char
*
name
);
bool
check_column_name
(
const
char
*
name
);
bool
check_table_name
(
const
char
*
name
,
uin
t
length
);
bool
check_table_name
(
const
char
*
name
,
size_
t
length
);
int
rename_file_ext
(
const
char
*
from
,
const
char
*
to
,
const
char
*
ext
);
int
rename_file_ext
(
const
char
*
from
,
const
char
*
to
,
const
char
*
ext
);
char
*
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
);
char
*
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
);
bool
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
,
class
String
*
res
);
bool
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
,
class
String
*
res
);
...
...
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