Skip to content

Commit b104aa3

Browse files
committed
Merge branch 'develop' into admin/docbot
2 parents 01f6e94 + 1e08dc6 commit b104aa3

22 files changed

Lines changed: 1664 additions & 175 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dist: precise
2121
env:
2222
- DB=mysqli
2323
- DB=postgres
24+
- DB=sqlite
2425

2526
services:
2627
- memcached

php_errors.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[30-Jan-2018 23:57:36 America/Chicago] PHP Fatal error: Class 'z' not found in /Users/kilishan/WebSites/CodeIgniter4/tests/system/Validation/RulesTest.php on line 5

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
</testsuite>
1717
<testsuite name="system">
1818
<directory>./tests/system</directory>
19-
<!-- <exclude>./tests/system/Database/Live</exclude> -->
19+
<exclude>./tests/system/Database</exclude>
20+
</testsuite>
21+
<testsuite name="database">
22+
<directory>./tests/system/Database</directory>
2023
</testsuite>
2124
</testsuites>
2225

system/Database/BaseBuilder.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,21 @@ class BaseBuilder
188188
*/
189189
protected $binds = [];
190190

191+
/**
192+
* Some databases, like SQLite, do not by default
193+
* allow limiting of delete clauses.
194+
*
195+
* @var bool
196+
*/
197+
protected $canLimitDeletes = true;
198+
199+
/**
200+
* Some databases do not by default
201+
* allow limit update queries with WHERE.
202+
* @var bool
203+
*/
204+
protected $canLimitWhereUpdates = true;
205+
191206
//--------------------------------------------------------------------
192207

193208
/**
@@ -1908,6 +1923,11 @@ public function update($set = null, $where = null, int $limit = null, $test = fa
19081923

19091924
if ( ! empty($limit))
19101925
{
1926+
if (! $this->canLimitWhereUpdates)
1927+
{
1928+
throw new DatabaseException('This driver does not allow LIMITs on UPDATE queries using WHERE.');
1929+
}
1930+
19111931
$this->limit($limit);
19121932
}
19131933

@@ -2292,6 +2312,11 @@ public function delete($where = '', $limit = null, $reset_data = true, $returnSQ
22922312

22932313
if ( ! empty($this->QBLimit))
22942314
{
2315+
if (! $this->canLimitDeletes)
2316+
{
2317+
throw new DatabaseException('SQLite3 does not allow LIMITs on DELETE queries.');
2318+
}
2319+
22952320
$sql = $this->_limit($sql);
22962321
}
22972322

0 commit comments

Comments
 (0)