diff options
author | unknown <jani@hynda.mysql.fi> | 2001-09-03 16:09:25 +0300 |
---|---|---|
committer | unknown <jani@hynda.mysql.fi> | 2001-09-03 16:09:25 +0300 |
commit | 933ff1c3796edc50990082bb9b0df46fcb1142eb (patch) | |
tree | 86d5f53d82343ca0bb2510b7f0fd3e8e95f1daeb /client | |
parent | e6088385c582e5a5c645fe4cf5fcb64d83beb9df (diff) | |
download | mariadb-git-933ff1c3796edc50990082bb9b0df46fcb1142eb.tar.gz |
Fixed a problem with dumping string values in float and double
fields (inf,nan,...); should be dumped as "NULL".
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 13 |
1 files changed, 11 insertions, 2 deletions
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 { |