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
ff102add
Commit
ff102add
authored
Sep 26, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix xml with view
parent
2264bb01
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
3 deletions
+84
-3
client/mysqldump.c
client/mysqldump.c
+15
-3
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+57
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+9
-0
sql/sql_base.cc
sql/sql_base.cc
+3
-0
No files found.
client/mysqldump.c
View file @
ff102add
...
...
@@ -1161,6 +1161,12 @@ static uint getTableStructure(char *table, char* db)
sprintf
(
buff
,
"show keys from %s"
,
result_table
);
if
(
mysql_query
(
sock
,
buff
))
{
if
(
mysql_errno
(
sock
)
==
ER_WRONG_OBJECT
)
{
/* it is VIEW */
fputs
(
"
\t\t
<options Comment=
\"
view
\"
/>
\n
"
,
sql_file
);
goto
continue_xml
;
}
fprintf
(
stderr
,
"%s: Can't get keys for table %s (%s)
\n
"
,
my_progname
,
result_table
,
mysql_error
(
sock
));
if
(
path
)
...
...
@@ -1268,6 +1274,7 @@ static uint getTableStructure(char *table, char* db)
}
mysql_free_result
(
tableRes
);
/* Is always safe to free */
}
continue_xml:
if
(
!
opt_xml
)
fputs
(
";
\n
"
,
sql_file
);
else
...
...
@@ -2134,9 +2141,14 @@ static const char *check_if_ignore_table(const char *table_name)
mysql_free_result
(
res
);
return
0
;
/* assume table is ok */
}
if
(
strcmp
(
row
[
1
],
(
result
=
"MRG_MyISAM"
))
&&
strcmp
(
row
[
1
],
(
result
=
"MRG_ISAM"
)))
result
=
0
;
if
(
!
(
row
[
1
]))
result
=
"VIEW"
;
else
{
if
(
strcmp
(
row
[
1
],
(
result
=
"MRG_MyISAM"
))
&&
strcmp
(
row
[
1
],
(
result
=
"MRG_ISAM"
)))
result
=
0
;
}
mysql_free_result
(
res
);
return
result
;
}
...
...
mysql-test/r/mysqldump.result
View file @
ff102add
...
...
@@ -332,3 +332,60 @@ CREATE TABLE `t1` (
2
3
drop table t1;
create table t1(a int);
create view v1 as select * from t1;
-- MySQL dump 10.7
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.0.2-alpha-valgrind-max-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t1`
--
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
--
-- Table structure for table `v1`
--
DROP TABLE IF EXISTS `v1`;
--
-- View structure for view `v1`
--
DROP VIEW IF EXISTS `v1`;
CREATE VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
drop view v1;
drop table t1;
mysql-test/t/mysqldump.test
View file @
ff102add
...
...
@@ -127,3 +127,12 @@ insert into t1 values (1),(2),(3);
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
sql
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
txt
drop
table
t1
;
#
# dump of view
#
create
table
t1
(
a
int
);
create
view
v1
as
select
*
from
t1
;
--
exec
$MYSQL_DUMP
test
drop
view
v1
;
drop
table
t1
;
sql/sql_base.cc
View file @
ff102add
...
...
@@ -913,6 +913,9 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
*/
{
char
path
[
FN_REFLEN
];
TABLE
tab
;
if
(
!
table
)
table
=
&
tab
;
strxnmov
(
path
,
FN_REFLEN
,
mysql_data_home
,
"/"
,
table_list
->
db
,
"/"
,
table_list
->
real_name
,
reg_ext
,
NullS
);
(
void
)
unpack_filename
(
path
,
path
);
...
...
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