]> git.nbdom.net Git - nb.git/commitdiff
table.create NULL value
authorNico Boisselier <nico@dhcp-192-168-4-150.semantico.net>
Thu, 27 Oct 2016 10:37:14 +0000 (11:37 +0100)
committerNico Boisselier <nico@dhcp-192-168-4-150.semantico.net>
Thu, 27 Oct 2016 10:37:14 +0000 (11:37 +0100)
lib/php/db/types/sqlite.php

index 298e3e68a4816b36bc7b485c29a61e5c4c5d5e03..cb60c26148aba6b9d4f13e4fabc140cec415e1d9 100644 (file)
@@ -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]) : "";',