summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-06-22 20:24:10 +0200
committerunknown <msvensson@neptunus.(none)>2005-06-22 20:24:10 +0200
commitf36336daaec7440dadbb83b4f0d0c23c878f0b4f (patch)
tree68ce557651828a9cae88ef885628fa4715aaf6fc /client
parente75bdb4eccf53b741a8ac0dec2fb65fc45223447 (diff)
parente5d0e337f8cabe2824dd324888bca22fd628b350 (diff)
downloadmariadb-git-f36336daaec7440dadbb83b4f0d0c23c878f0b4f.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.0 client/mysqldump.c: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/t/mysqldump.test: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index ef58621cf59..66bc4fcb896 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -469,7 +469,10 @@ static void write_header(FILE *sql_file, char *db_name)
if (opt_xml)
{
fputs("<?xml version=\"1.0\"?>\n", sql_file);
- fputs("<mysqldump>\n", sql_file);
+ fputs("<mysqldump ", sql_file);
+ fputs("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
+ sql_file);
+ fputs(">\n", sql_file);
check_io(sql_file);
}
else if (!opt_compact)
@@ -1076,6 +1079,40 @@ static void print_xml_tag1(FILE * xml_file, const char* sbeg,
/*
+ Print xml tag with for a field that is null
+
+ SYNOPSIS
+ print_xml_null_tag()
+ xml_file - output file
+ sbeg - line beginning
+ stag_atr - tag and attribute
+ sval - value of attribute
+ send - line ending
+
+ DESCRIPTION
+ Print tag with one attribute to the xml_file. Format is:
+ <stag_atr="sval" xsi:nil="true"/>
+ NOTE
+ sval MUST be a NULL terminated string.
+ sval string will be qouted before output.
+*/
+
+static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
+ const char* stag_atr, const char* sval,
+ const char* send)
+{
+ fputs(sbeg, xml_file);
+ fputs("<", xml_file);
+ fputs(stag_atr, xml_file);
+ fputs("\"", xml_file);
+ print_quoted_xml(xml_file, sval, strlen(sval));
+ fputs("\" xsi:nil=\"true\" />", xml_file);
+ fputs(send, xml_file);
+ check_io(xml_file);
+}
+
+
+/*
Print xml tag with many attributes.
SYNOPSIS
@@ -1935,7 +1972,14 @@ static void dump_table(uint numFields, char *table)
}
}
else
- fputs("NULL", md_result_file);
+ {
+ /* The field value is NULL */
+ if (!opt_xml)
+ fputs("NULL", md_result_file);
+ else
+ print_xml_null_tag(md_result_file, "\t\t", "field name=",
+ field->name, "\n");
+ }
check_io(md_result_file);
}
}