From: Nico Boisselier Date: Thu, 27 Oct 2016 10:37:14 +0000 (+0100) Subject: table.create NULL value X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=0e74e3582ccbca46ddf931e97a70bbde8abc5aa5;p=nb.git table.create NULL value --- 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]) : "";',