Commit 933ff1c3 authored by unknown's avatar unknown

Fixed a problem with dumping string values in float and double

fields (inf,nan,...); should be dumped as "NULL".

parent e6088385
...@@ -1061,7 +1061,12 @@ static void dumpTable(uint numFields, char *table) ...@@ -1061,7 +1061,12 @@ static void dumpTable(uint numFields, char *table)
dynstr_append(&extended_row,"\'"); dynstr_append(&extended_row,"\'");
} }
else 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 else
dynstr_append(&extended_row,"\'\'"); dynstr_append(&extended_row,"\'\'");
...@@ -1081,7 +1086,11 @@ static void dumpTable(uint numFields, char *table) ...@@ -1081,7 +1086,11 @@ static void dumpTable(uint numFields, char *table)
if (!IS_NUM_FIELD(field)) if (!IS_NUM_FIELD(field))
unescape(md_result_file, row[i], lengths[i]); unescape(md_result_file, row[i], lengths[i]);
else 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 else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment