aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/sqlite.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/sqlite.php')
-rw-r--r--phpBB/includes/db/sqlite.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 7b23171187..95f12175c3 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -47,6 +47,8 @@ class dbal_sqlite extends dbal
{
@sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
}
+
+ sqlite_create_function($this->db_connect_id, 'binary_insert', array('dbal_sqlite', '_sql_insert'), 1);
return ($this->db_connect_id) ? true : array('message' => $error);
}
@@ -328,6 +330,31 @@ class dbal_sqlite extends dbal
}
}
+ /**
+ * Build the proper binary string used for the default
+ * @access: private
+ */
+ function _sql_insert($mode)
+ {
+ if ($mode == 1)
+ {
+ $bitfield = new bitfield();
+ $bitfield->set(0);
+ $bitfield->set(3);
+ $bitfield->set(8);
+ $bitfield->set(9);
+ $bitfield->set(11);
+ $bitfield->set(12);
+ return sqlite_udf_encode_binary($bitfield->data);
+ }
+ /*
+ else
+ {
+ return sqlite_udf_encode_binary("\0");
+ }
+ */
+ }
+
}
} // if ... define