summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-26 13:45:45 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-26 13:45:45 +0100
commitb537c4d32d109cef2ddf541aa976c3e96736bf06 (patch)
treeadd357409f88b529e37f53317431e0fce7f08ad7 /system/database/drivers/sqlite
parent20ebf1459b6dc1449a545156b70e7cb2932fa9eb (diff)
Fix _limit()
Diffstat (limited to 'system/database/drivers/sqlite')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php2
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 96458e032..119722d2f 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -583,7 +583,7 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
protected function _limit($sql, $limit, $offset)
{
- return $sql.'LIMIT '.($offset == 0 ? '' : ', ').$limit;
+ return $sql.'LIMIT '.($offset == 0 ? '' : $offset.', ').$limit;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index 5339f6e3e..99766878b 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -104,11 +104,11 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->protect_identifiers($field)
.' '.$attributes['TYPE']
- .(isset($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
- .((isset($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
+ .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
.(isset($attributes['DEFAULT']) ? ' DEFAULT \''.$attributes['DEFAULT'].'\'' : '')
- .((isset($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
- .((isset($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field