Output infinity as 1e999 in the ".dump" command of the command-line shell.

FossilOrigin-Name: ee431d55eba618cfba414c3946b3162bc205a70dd4e43d74a7623be332b94c92
This commit is contained in:
drh
2018-06-13 17:19:20 +00:00
parent 4449437b56
commit 2f1f8801ed
4 changed files with 27 additions and 11 deletions
+9 -1
View File
@@ -485,7 +485,15 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){
}
case SQLITE_FLOAT: {
double r = sqlite3_column_double(pStmt,i);
output_formatted(p, "%!.20g", r);
sqlite3_uint64 ur;
memcpy(&ur,&r,sizeof(r));
if( ur==0x7ff0000000000000LL ){
p->xCallback("1e999", p->pArg);
}else if( ur==0xfff0000000000000LL ){
p->xCallback("-1e999", p->pArg);
}else{
output_formatted(p, "%!.20g", r);
}
break;
}
case SQLITE_NULL: {