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
fd352c22
Commit
fd352c22
authored
Jan 14, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs #2280, #2281 - show create table should always return a valid sql statement
parent
2efb4151
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
sql/sql_show.cc
sql/sql_show.cc
+15
-1
No files found.
sql/sql_show.cc
View file @
fd352c22
...
@@ -997,6 +997,19 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
...
@@ -997,6 +997,19 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
/* possible TODO: call find_keyword() from sql_lex.cc here */
static
bool
require_quotes
(
const
char
*
name
,
uint
length
)
{
uint
i
,
d
,
c
;
for
(
i
=
0
;
i
<
length
;
i
+=
d
)
{
c
=
((
uchar
*
)
name
)[
i
];
d
=
my_mbcharlen
(
system_charset_info
,
c
);
if
(
d
==
1
&&
!
system_charset_info
->
ident_map
[
c
])
return
1
;
}
return
0
;
}
void
void
append_identifier
(
THD
*
thd
,
String
*
packet
,
const
char
*
name
,
uint
length
)
append_identifier
(
THD
*
thd
,
String
*
packet
,
const
char
*
name
,
uint
length
)
...
@@ -1007,7 +1020,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
...
@@ -1007,7 +1020,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
else
else
qtype
=
'`'
;
qtype
=
'`'
;
if
(
thd
->
options
&
OPTION_QUOTE_SHOW_CREATE
)
if
((
thd
->
options
&
OPTION_QUOTE_SHOW_CREATE
)
||
require_quotes
(
name
,
length
))
{
{
packet
->
append
(
&
qtype
,
1
);
packet
->
append
(
&
qtype
,
1
);
packet
->
append
(
name
,
length
,
system_charset_info
);
packet
->
append
(
name
,
length
,
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