DB count_all() not returns an integer always
Added some syntactical improvements within DB (braces)
Fixed a bug when doing 'random' on order_by() (#5706).
Fixed a bug where adding a primary key through Forge could fail (#5731).
Fixed a bug when using DB cache on multiple databases (#5737).
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 0629a59..b949a96 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -420,17 +420,19 @@
function count_all($table = '')
{
if ($table == '')
- return '0';
+ {
+ return 0;
+ }
- $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
+ $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
if ($query == FALSE)
- {
+ {
return 0;
- }
+ }
$row = $query->row();
- return $row->NUMROWS;
+ return (int) $row->numrows;
}
// --------------------------------------------------------------------