Handle empty integer values in SQLite export

This commit is contained in:
Jakub Vrana 2013-04-03 10:24:13 -07:00
parent b14a2a5330
commit cb57afd0e5

View file

@ -726,7 +726,10 @@ DROP PROCEDURE adminer_alter;
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
}
foreach ($row as $key => $val) {
$row[$key] = ($val !== null ? (ereg('int|float|double|decimal|bit', $fields[$keys[$key]]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
$row[$key] = ($val !== null
? (ereg('int|float|double|decimal|bit', $fields[$keys[$key]]["type"]) && $val != '' ? $val : q($val)) //! columns looking like functions
: "NULL"
);
}
$s = ($max_packet ? "\n" : " ") . "(" . implode(",\t", $row) . ")";
if (!$buffer) {