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
3ea2b498
Commit
3ea2b498
authored
Jan 14, 2011
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Plain Diff
Merging fix of Bug#13618 from mysql-5.1.
parents
3ddfad4a
aeda5996
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
16 deletions
+49
-16
client/mysqldump.c
client/mysqldump.c
+11
-2
mysql-test/r/client_xml.result
mysql-test/r/client_xml.result
+3
-3
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+26
-11
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+9
-0
No files found.
client/mysqldump.c
View file @
3ea2b498
...
@@ -2237,6 +2237,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
...
@@ -2237,6 +2237,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
const
char
*
insert_option
;
const
char
*
insert_option
;
char
name_buff
[
NAME_LEN
+
3
],
table_buff
[
NAME_LEN
*
2
+
3
];
char
name_buff
[
NAME_LEN
+
3
],
table_buff
[
NAME_LEN
*
2
+
3
];
char
table_buff2
[
NAME_LEN
*
2
+
3
],
query_buff
[
QUERY_LENGTH
];
char
table_buff2
[
NAME_LEN
*
2
+
3
],
query_buff
[
QUERY_LENGTH
];
const
char
*
show_fields_stmt
=
"SELECT `COLUMN_NAME` AS `Field`, "
"`COLUMN_TYPE` AS `Type`, "
"`IS_NULLABLE` AS `Null`, "
"`COLUMN_KEY` AS `Key`, "
"`COLUMN_DEFAULT` AS `Default`, "
"`EXTRA` AS `Extra`, "
"`COLUMN_COMMENT` AS `Comment` "
"FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE "
"TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'"
;
FILE
*
sql_file
=
md_result_file
;
FILE
*
sql_file
=
md_result_file
;
int
len
;
int
len
;
MYSQL_RES
*
result
;
MYSQL_RES
*
result
;
...
@@ -2504,8 +2513,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
...
@@ -2504,8 +2513,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg
(
"%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)
\n
"
,
verbose_msg
(
"%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)
\n
"
,
my_progname
,
mysql_error
(
mysql
));
my_progname
,
mysql_error
(
mysql
));
my_snprintf
(
query_buff
,
sizeof
(
query_buff
),
"show fields from %s"
,
my_snprintf
(
query_buff
,
sizeof
(
query_buff
),
show_fields_stmt
,
db
,
table
);
result_table
);
if
(
mysql_query_with_error_report
(
mysql
,
&
result
,
query_buff
))
if
(
mysql_query_with_error_report
(
mysql
,
&
result
,
query_buff
))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
mysql-test/r/client_xml.result
View file @
3ea2b498
...
@@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
...
@@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<database name="test">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
<field Field="a<b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a<b" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
<field Field="a>b" Type="text" Null="YES" Key="" Extra="" />
<field Field="a>b" Type="text" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_data name="t1">
<table_data name="t1">
<row>
<row>
...
...
mysql-test/r/mysqldump.result
View file @
3ea2b498
...
@@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2);
...
@@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<database name="test">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra=""
Comment=""
/>
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" Index_comment="" />
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" Index_comment="" />
</table_structure>
</table_structure>
<table_data name="t1">
<table_data name="t1">
...
@@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
...
@@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<database name="test">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
<field Field="b" Type="text" Null="YES" Key="" Extra="" />
<field Field="b" Type="text" Null="YES" Key="" Extra=""
Comment=""
/>
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" />
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_data name="t1">
<table_data name="t1">
<row>
<row>
...
@@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
...
@@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<database name="test">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a"b"" Type="char(2)" Null="YES" Key="" Extra="" />
<field Field="a"b"" Type="char(2)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_data name="t1">
<table_data name="t1">
<row>
<row>
...
@@ -1612,10 +1612,10 @@ CREATE TABLE `t2` (
...
@@ -1612,10 +1612,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<database name="mysqldump_test_db">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_structure name="t2">
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
</database>
</database>
</mysqldump>
</mysqldump>
...
@@ -1623,10 +1623,10 @@ CREATE TABLE `t2` (
...
@@ -1623,10 +1623,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<database name="mysqldump_test_db">
<table_structure name="t1">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_structure name="t2">
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
</database>
</database>
</mysqldump>
</mysqldump>
...
@@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
...
@@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<database name="test">
<table_structure name="t1">
<table_structure name="t1">
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" />
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra=""
Comment=""
/>
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" />
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra=""
Comment=""
/>
</table_structure>
</table_structure>
<table_data name="t1">
<table_data name="t1">
<row>
<row>
...
@@ -4576,5 +4576,20 @@ LENGTH(a)
...
@@ -4576,5 +4576,20 @@ LENGTH(a)
800
800
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
#
# Bug #13618 : mysqldump --xml ommit comment on table field
#
CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="comment_table">
<field Field="i" Type="int(11)" Null="YES" Key="" Extra="" Comment="FIELD COMMENT" />
</table_structure>
<table_data name="comment_table">
</table_data>
</database>
</mysqldump>
DROP TABLE `comment_table`;
#
# End of 5.1 tests
# End of 5.1 tests
#
#
mysql-test/t/mysqldump.test
View file @
3ea2b498
...
@@ -2169,6 +2169,15 @@ SELECT LENGTH(a) FROM t2;
...
@@ -2169,6 +2169,15 @@ SELECT LENGTH(a) FROM t2;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
###########################################################################
###########################################################################
--
echo
#
--
echo
# Bug #13618 : mysqldump --xml ommit comment on table field
--
echo
#
CREATE
TABLE
`comment_table`
(
i
INT
COMMENT
'FIELD COMMENT'
)
COMMENT
=
'TABLE COMMENT'
;
--
exec
$MYSQL_DUMP
--
compact
--
skip
-
create
--
xml
test
DROP
TABLE
`comment_table`
;
--
echo
#
--
echo
#
--
echo
# End of 5.1 tests
--
echo
# End of 5.1 tests
--
echo
#
--
echo
#
...
...
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