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
3503f63e
Commit
3503f63e
authored
Nov 26, 2001
by
jani@hynda.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added quoting to XML in mysqldump.
parent
38f72259
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
11 deletions
+33
-11
client/mysqldump.c
client/mysqldump.c
+33
-11
No files found.
client/mysqldump.c
View file @
3503f63e
...
...
@@ -35,7 +35,7 @@
** and adapted to mysqldump 05/11/01 by Jani Tolonen
*/
#define DUMP_VERSION "8.1
8
"
#define DUMP_VERSION "8.1
9
"
#include <my_global.h>
#include <my_sys.h>
...
...
@@ -163,6 +163,7 @@ static int init_dumping(char *);
static
int
dump_databases
(
char
**
);
static
int
dump_all_databases
();
static
char
*
quote_name
(
char
*
name
,
char
*
buff
);
static
void
print_quoted_xml
(
FILE
*
output
,
char
*
fname
,
char
*
str
,
uint
len
);
static
void
print_version
(
void
)
{
...
...
@@ -1114,8 +1115,8 @@ static void dumpTable(uint numFields, char *table)
if
(
!
IS_NUM_FIELD
(
field
))
{
if
(
opt_xml
)
fprintf
(
md_result_file
,
"
\t\t
<%s>%s</%s>
\n
"
,
field
->
name
,
row
[
i
],
field
->
name
);
print_quoted_xml
(
md_result_file
,
field
->
name
,
row
[
i
]
,
lengths
[
i
]
);
else
unescape
(
md_result_file
,
row
[
i
],
lengths
[
i
]);
}
...
...
@@ -1197,6 +1198,27 @@ static void dumpTable(uint numFields, char *table)
}
/* dumpTable */
static
void
print_quoted_xml
(
FILE
*
output
,
char
*
fname
,
char
*
str
,
uint
len
)
{
const
char
*
end
;
fprintf
(
output
,
"
\t\t
<%s>"
,
fname
);
for
(
end
=
str
+
len
;
str
!=
end
;
str
++
)
{
if
(
*
str
==
'<'
)
fputs
(
"<"
,
output
);
else
if
(
*
str
==
'>'
)
fputs
(
">"
,
output
);
else
if
(
*
str
==
'&'
)
fputs
(
"&"
,
output
);
else
if
(
*
str
==
'\"'
)
fputs
(
"""
,
output
);
else
fputc
(
*
str
,
output
);
}
fprintf
(
output
,
"<%s>
\n
"
,
fname
);
}
static
char
*
getTableName
(
int
reset
)
{
static
MYSQL_RES
*
res
=
NULL
;
...
...
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