summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-01-31 17:51:45 -0800
committerunknown <jimw@mysql.com>2005-01-31 17:51:45 -0800
commit41763b20e25bb7ee8cf071782c9e5c8848ed34ce (patch)
tree1f3b42cc91b92ab35afeff8d5cc836f45036e664 /client
parentac5e79b9a1c8064af3e21ad37866af9d787792aa (diff)
parentd8f3934148a1a92458fc0f206c6b0a804f30a001 (diff)
downloadmariadb-git-41763b20e25bb7ee8cf071782c9e5c8848ed34ce.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-7811
into mysql.com:/home/jimw/my/mysql-5.0-clean client/mysql.cc: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 046cba536be..e387bb26063 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -155,6 +155,8 @@ static char mysql_charsets_dir[FN_REFLEN+1];
static const char *xmlmeta[] = {
"&", "&amp;",
"<", "&lt;",
+ ">", "&gt;",
+ "\"", "&quot;",
0, 0
};
static const char *day_names[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
@@ -2126,13 +2128,11 @@ print_table_data_xml(MYSQL_RES *result)
(void) tee_fputs("\n <row>\n", PAGER);
for (uint i=0; i < mysql_num_fields(result); i++)
{
- tee_fprintf(PAGER, "\t<%s>", (fields[i].name ?
- (fields[i].name[0] ? fields[i].name :
- " &nbsp; ") : "NULL"));
+ tee_fprintf(PAGER, "\t<field name=\"");
+ xmlencode_print(fields[i].name, strlen(fields[i].name));
+ tee_fprintf(PAGER, "\">");
xmlencode_print(cur[i], lengths[i]);
- tee_fprintf(PAGER, "</%s>\n", (fields[i].name ?
- (fields[i].name[0] ? fields[i].name :
- " &nbsp; ") : "NULL"));
+ tee_fprintf(PAGER, "</field>\n");
}
(void) tee_fputs(" </row>\n", PAGER);
}