summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-12-01 12:21:29 -0800
committerunknown <jimw@mysql.com>2005-12-01 12:21:29 -0800
commit3016ec15be788523eb8f476c145f1ec2c2e39b67 (patch)
tree17e88167c65aa02a5d70497a063569a393b59a1b /client
parentf604204f527e9d31e1f119918fe7b40aa45472b2 (diff)
parenteb92d6a1e338f91447134b1ff85e5ad1c4900428 (diff)
downloadmariadb-git-3016ec15be788523eb8f476c145f1ec2c2e39b67.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-13318
into mysql.com:/home/jimw/my/mysql-5.0-clean client/mysqldump.c: Auto merged mysql-test/r/mysqldump.result: Resolve conflicts mysql-test/t/mysqldump.test: Resolve conflicts
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 54d912a2aea..454fc0df84e 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2152,6 +2152,8 @@ static void dump_table(char *table, char *db)
for (i = 0; i < mysql_num_fields(res); i++)
{
int is_blob;
+ ulong length= lengths[i];
+
if (!(field = mysql_fetch_field(res)))
{
my_snprintf(query, QUERY_LENGTH,
@@ -2178,7 +2180,6 @@ static void dump_table(char *table, char *db)
field->type == MYSQL_TYPE_TINY_BLOB)) ? 1 : 0;
if (extended_insert)
{
- ulong length = lengths[i];
if (i == 0)
dynstr_set(&extended_row,"(");
else
@@ -2268,19 +2269,19 @@ static void dump_table(char *table, char *db)
{
print_xml_tag1(md_result_file, "\t\t", "field name=",
field->name, "");
- print_quoted_xml(md_result_file, row[i], lengths[i]);
+ print_quoted_xml(md_result_file, row[i], length);
fputs("</field>\n", md_result_file);
}
- else if (opt_hex_blob && is_blob)
+ else if (opt_hex_blob && is_blob && length)
{
/* sakaik got the idea to to provide blob's in hex notation. */
- char *ptr= row[i], *end= ptr+ lengths[i];
+ char *ptr= row[i], *end= ptr + length;
fputs("0x", md_result_file);
for (; ptr < end ; ptr++)
fprintf(md_result_file, "%02X", *((uchar *)ptr));
}
else
- unescape(md_result_file, row[i], lengths[i]);
+ unescape(md_result_file, row[i], length);
}
else
{