From 933ff1c3796edc50990082bb9b0df46fcb1142eb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Sep 2001 16:09:25 +0300 Subject: Fixed a problem with dumping string values in float and double fields (inf,nan,...); should be dumped as "NULL". --- client/mysqldump.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/mysqldump.c b/client/mysqldump.c index 9038c88e085..92c419ad566 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1061,7 +1061,12 @@ static void dumpTable(uint numFields, char *table) dynstr_append(&extended_row,"\'"); } else - dynstr_append(&extended_row,row[i]); + { + /* change any strings ("inf","nan",..) into NULL */ + char *ptr = row[i]; + dynstr_append(&extended_row, + (!isalpha(*ptr)) ? ptr : "NULL"); + } } else dynstr_append(&extended_row,"\'\'"); @@ -1081,7 +1086,11 @@ static void dumpTable(uint numFields, char *table) if (!IS_NUM_FIELD(field)) unescape(md_result_file, row[i], lengths[i]); else - fputs(row[i],md_result_file); + { + /* change any strings ("inf","nan",..) into NULL */ + char *ptr = row[i]; + fputs((!isalpha(*ptr)) ? ptr : "NULL", md_result_file); + } } else { -- cgit v1.2.1