From 0e74e3582ccbca46ddf931e97a70bbde8abc5aa5 Mon Sep 17 00:00:00 2001 From: Nico Boisselier Date: Thu, 27 Oct 2016 11:37:14 +0100 Subject: [PATCH] table.create NULL value --- lib/php/db/types/sqlite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/php/db/types/sqlite.php b/lib/php/db/types/sqlite.php index 298e3e68..cb60c261 100644 --- a/lib/php/db/types/sqlite.php +++ b/lib/php/db/types/sqlite.php @@ -86,7 +86,7 @@ $DB_TYPES['sqlite'] = array ( 'fct' => create_function('&$r',join('',array( #'debug("zaza");', '$r["key"] = $r["pk"] == "0" ? 0 : 1;', - '$r["default"] = trim($r["dflt_value"],"\'");', + 'if (!empty($r["dflt_value"])) $r["default"] = trim($r["dflt_value"],"\'");', '$r["null"] = $r["notnull"] == "0" ? 1 : 0;', '$r["autoincrement"] = preg_match("/[\(,]\s*".$r["name"]." [^\),]+ AUTOINCREMENT/",$r["this"]->sql()) ? 1 : 0;', '$r["extra"] = preg_match("/[\(,]\s*".$r["name"]." \S+ (COLLATE[^,)]+)/",$r["this"]->sql(),$m) ? trim($m[1]) : "";', -- 2.47.3