]> git.joonet.de Git - adminer.git/commitdiff
Handle empty integer values in SQLite export
authorJakub Vrana <jakub@vrana.cz>
Wed, 3 Apr 2013 17:24:13 +0000 (10:24 -0700)
committerJakub Vrana <jakub@vrana.cz>
Wed, 3 Apr 2013 17:41:14 +0000 (10:41 -0700)
adminer/include/adminer.inc.php

index 0bf53f38afb20d8d5f3e912d29b006fab5b454f6..ba77b5f7182f8d2af8aaf00ad39d1c3cd3104725 100644 (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) {