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
242ed711
Commit
242ed711
authored
Aug 03, 2006
by
tsmith@maint1.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
5.0 -> 5.1 manual merge, part 1 of 3 (or more?)
parents
554b1f01
56e1d961
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
3 deletions
+58
-3
client/mysqldump.c
client/mysqldump.c
+14
-3
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+44
-0
No files found.
client/mysqldump.c
View file @
242ed711
...
...
@@ -2910,7 +2910,7 @@ static int init_dumping(char *database)
/*
length of table name * 2 (if name contains quotes), 2 quotes and 0
*/
char
quoted_database_buf
[
64
*
2
+
3
];
char
quoted_database_buf
[
NAME_LEN
*
2
+
3
];
char
*
qdatabase
=
quote_name
(
database
,
quoted_database_buf
,
opt_quoted
);
if
(
opt_comments
)
{
...
...
@@ -3067,7 +3067,18 @@ static my_bool dump_all_views_in_db(char *database)
DB_error
(
sock
,
"when selecting the database"
);
return
1
;
}
if
(
opt_databases
||
opt_alldbs
)
{
char
quoted_database_buf
[
NAME_LEN
*
2
+
3
];
char
*
qdatabase
=
quote_name
(
database
,
quoted_database_buf
,
opt_quoted
);
if
(
opt_comments
)
{
fprintf
(
md_result_file
,
"
\n
--
\n
-- Current Database: %s
\n
--
\n
"
,
qdatabase
);
check_io
(
md_result_file
);
}
fprintf
(
md_result_file
,
"
\n
USE %s;
\n
"
,
qdatabase
);
check_io
(
md_result_file
);
}
if
(
opt_xml
)
print_xml_tag1
(
md_result_file
,
""
,
"database name="
,
database
,
"
\n
"
);
if
(
lock_tables
)
...
...
@@ -3526,7 +3537,7 @@ static char *primary_key_fields(const char *table_name)
MYSQL_RES
*
res
=
NULL
;
MYSQL_ROW
row
;
/* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */
char
show_keys_buff
[
15
+
64
*
2
+
3
];
char
show_keys_buff
[
15
+
NAME_LEN
*
2
+
3
];
uint
result_length
=
0
;
char
*
result
=
0
;
...
...
mysql-test/t/mysqldump.test
View file @
242ed711
...
...
@@ -1235,6 +1235,50 @@ create database mysqldump_views;
use
mysqldump_views
;
create
view
nasishnasifu
as
select
mysqldump_tables
.
basetable
.
id
from
mysqldump_tables
.
basetable
;
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
compact
--
databases
mysqldump_tables
mysqldump_views
;
drop
view
nasishnasifu
;
drop
database
mysqldump_views
;
drop
table
mysqldump_tables
.
basetable
;
drop
database
mysqldump_tables
;
# Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
create
database
mysqldump_dba
;
use
mysqldump_dba
;
create
table
t1
(
f1
int
,
f2
int
);
insert
into
t1
values
(
1
,
1
);
create
view
v1
as
select
f1
,
f2
from
t1
;
create
database
mysqldump_dbb
;
use
mysqldump_dbb
;
create
table
t1
(
f1
int
,
f2
int
);
insert
into
t1
values
(
2
,
2
);
create
view
v1
as
select
f1
,
f2
from
t1
;
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
add
-
drop
-
database
--
databases
mysqldump_dba
mysqldump_dbb
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20221_backup
;
drop
view
v1
;
drop
table
t1
;
drop
database
mysqldump_dbb
;
use
mysqldump_dba
;
drop
view
v1
;
drop
table
t1
;
drop
database
mysqldump_dba
;
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20221_backup
;
select
*
from
mysqldump_dba
.
v1
;
select
*
from
mysqldump_dbb
.
v1
;
use
mysqldump_dba
;
drop
view
v1
;
drop
table
t1
;
drop
database
mysqldump_dba
;
use
mysqldump_dbb
;
drop
view
v1
;
drop
table
t1
;
drop
database
mysqldump_dbb
;
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
databases
mysqldump_tables
mysqldump_views
;
drop
view
nasishnasifu
;
...
...
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