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
cebfa22c
Commit
cebfa22c
authored
Nov 05, 2002
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CREATE DATABASE now tries to execute SHOW CREATE DATABASE first
parent
a90b923b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
client/mysqldump.c
client/mysqldump.c
+21
-1
No files found.
client/mysqldump.c
View file @
cebfa22c
...
...
@@ -1247,8 +1247,28 @@ static int init_dumping(char *database)
{
fprintf
(
md_result_file
,
"
\n
--
\n
-- Current Database: %s
\n
--
\n
"
,
database
);
if
(
!
opt_create_db
)
fprintf
(
md_result_file
,
"
\n
CREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;
\n
"
,
{
char
qbuf
[
128
];
MYSQL_ROW
row
;
MYSQL_RES
*
dbinfo
;
sprintf
(
qbuf
,
"SHOW CREATE DATABASE %s"
,
database
);
if
(
mysql_query
(
sock
,
qbuf
)
||
!
(
dbinfo
=
mysql_store_result
(
sock
)))
{
/* Old server version, dump generic CREATE DATABASE */
fprintf
(
md_result_file
,
"
\n
CREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;
\n
"
,
database
);
}
else
{
row
=
mysql_fetch_row
(
dbinfo
);
if
(
row
[
1
])
{
fprintf
(
md_result_file
,
"
\n
%s;
\n
"
,
row
[
1
]);
}
}
}
fprintf
(
md_result_file
,
"
\n
USE %s;
\n
"
,
database
);
}
}
...
...
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