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
19769cbf
Commit
19769cbf
authored
Jun 30, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge
client/mysqldump.c: Auto merged
parents
6a5ba8fd
11dc2506
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
client/mysqldump.c
client/mysqldump.c
+49
-1
No files found.
client/mysqldump.c
View file @
19769cbf
...
...
@@ -1252,7 +1252,54 @@ static uint get_table_structure(char *table, char *db)
if
(
strcmp
(
field
->
name
,
"View"
)
==
0
)
{
if
(
verbose
)
fprintf
(
stderr
,
"-- It's a view, skipped
\n
"
);
fprintf
(
stderr
,
"-- It's a view, create dummy table for view
\n
"
);
mysql_free_result
(
tableRes
);
/* Create a dummy table for the view. ie. a table which has the
same columns as the view should have. This table is dropped
just before the view is created. The table is used to handle the
case where a view references another view, which hasn't yet been
created(during the load of the dump). BUG#10927 */
/* Create temp table by selecting from the view */
my_snprintf
(
query_buff
,
sizeof
(
query_buff
),
"CREATE TEMPORARY TABLE %s SELECT * FROM %s WHERE 0"
,
result_table
,
result_table
);
if
(
mysql_query_with_error_report
(
sock
,
0
,
query_buff
))
{
safe_exit
(
EX_MYSQLERR
);
DBUG_RETURN
(
0
);
}
/* Get CREATE statement for the temp table */
my_snprintf
(
query_buff
,
sizeof
(
query_buff
),
"SHOW CREATE TABLE %s"
,
result_table
);
if
(
mysql_query_with_error_report
(
sock
,
0
,
query_buff
))
{
safe_exit
(
EX_MYSQLERR
);
DBUG_RETURN
(
0
);
}
tableRes
=
mysql_store_result
(
sock
);
row
=
mysql_fetch_row
(
tableRes
);
if
(
opt_drop
)
fprintf
(
sql_file
,
"DROP VIEW IF EXISTS %s;
\n
"
,
opt_quoted_table
);
/* Print CREATE statement but remove TEMPORARY */
fprintf
(
sql_file
,
"CREATE %s;
\n
"
,
row
[
1
]
+
17
);
check_io
(
sql_file
);
mysql_free_result
(
tableRes
);
/* Drop the temp table */
my_snprintf
(
buff
,
sizeof
(
buff
),
"DROP TEMPORARY TABLE %s"
,
result_table
);
if
(
mysql_query_with_error_report
(
sock
,
0
,
buff
))
{
safe_exit
(
EX_MYSQLERR
);
DBUG_RETURN
(
0
);
}
was_views
=
1
;
DBUG_RETURN
(
0
);
}
...
...
@@ -2855,6 +2902,7 @@ static my_bool get_view_structure(char *table, char* db)
}
if
(
opt_drop
)
{
fprintf
(
sql_file
,
"DROP TABLE IF EXISTS %s;
\n
"
,
opt_quoted_table
);
fprintf
(
sql_file
,
"DROP VIEW IF EXISTS %s;
\n
"
,
opt_quoted_table
);
check_io
(
sql_file
);
}
...
...
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