summaryrefslogtreecommitdiff
path: root/program/lib/MDB2/Driver/Datatype/sqlite.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-12 08:13:59 +0000
committeralecpl <alec@alec.pl>2010-03-12 08:13:59 +0000
commit7244b4500e2b685cee5e9c4746a87f12acb56297 (patch)
tree7649eb06e5ae60b8de741256add44cd74443d47b /program/lib/MDB2/Driver/Datatype/sqlite.php
parentbc404ffd41c3411510a022ae5b0c9f2bfe8f5db1 (diff)
- Merge changes from MDB2's trunk
Diffstat (limited to 'program/lib/MDB2/Driver/Datatype/sqlite.php')
-rw-r--r--program/lib/MDB2/Driver/Datatype/sqlite.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/program/lib/MDB2/Driver/Datatype/sqlite.php b/program/lib/MDB2/Driver/Datatype/sqlite.php
index 4b68b8c40..3afa78a7e 100644
--- a/program/lib/MDB2/Driver/Datatype/sqlite.php
+++ b/program/lib/MDB2/Driver/Datatype/sqlite.php
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php 292715 2009-12-28 14:06:34Z quipo $
+// $Id: sqlite.php 295587 2010-02-28 17:16:38Z quipo $
//
require_once 'MDB2/Driver/Datatype/Common.php';
@@ -101,7 +101,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
*/
function getTypeDeclaration($field)
{
- $db =& $this->getDBInstance();
+ $db = $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -199,7 +199,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
*/
function _getIntegerDeclaration($name, $field)
{
- $db =& $this->getDBInstance();
+ $db = $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -216,6 +216,9 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
$notnull = empty($field['notnull']) ? '' : ' NOT NULL';
$unsigned = empty($field['unsigned']) ? '' : ' UNSIGNED';
+ if (empty($default) && empty($notnull)) {
+ $default = ' DEFAULT NULL';
+ }
$name = $db->quoteIdentifier($name, true);
return $name.' '.$this->getTypeDeclaration($field).$unsigned.$default.$notnull.$autoinc;
}
@@ -237,7 +240,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
*/
function matchPattern($pattern, $operator = null, $field = null)
{
- $db =& $this->getDBInstance();
+ $db = $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -394,7 +397,7 @@ class MDB2_Driver_Datatype_sqlite extends MDB2_Driver_Datatype_Common
$length = null;
break;
default:
- $db =& $this->getDBInstance();
+ $db = $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}