From b835a4f3b3f8fccd7ce457d4ab13344d3dcb91a9 Mon Sep 17 00:00:00 2001 From: Chris Buckley Date: Mon, 28 Jan 2013 23:35:13 +0000 Subject: Fix list_fields seek bug On the first list_fields call, the field pointer is moved to the end of the list of fields. This change ensures that the pointer is positioned at the start of the field list before grabbing the names. Signed-off-by: Chris Buckley --- system/database/drivers/mssql/mssql_result.php | 1 + system/database/drivers/mysql/mysql_result.php | 1 + system/database/drivers/mysqli/mysqli_result.php | 1 + 3 files changed, 3 insertions(+) (limited to 'system/database/drivers') diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index ea3f8e4d1..b6e5f2b17 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -74,6 +74,7 @@ class CI_DB_mssql_result extends CI_DB_result { public function list_fields() { $field_names = array(); + mssql_field_seek($this->result_id, 0); while ($field = mssql_fetch_field($this->result_id)) { $field_names[] = $field->name; diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 1ed2759b6..a2affcb58 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -89,6 +89,7 @@ class CI_DB_mysql_result extends CI_DB_result { public function list_fields() { $field_names = array(); + mysql_field_seek($this->result_id, 0); while ($field = mysql_fetch_field($this->result_id)) { $field_names[] = $field->name; diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 4105f99f6..3fe05f9c5 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -74,6 +74,7 @@ class CI_DB_mysqli_result extends CI_DB_result { public function list_fields() { $field_names = array(); + $this->result_id->field_seek(0); while ($field = $this->result_id->fetch_field()) { $field_names[] = $field->name; -- cgit v1.2.3-24-g4f1b From 07a59548c0761c5ac4562019d13913f2b82c6018 Mon Sep 17 00:00:00 2001 From: Dionysis Arvanitis Date: Tue, 19 Feb 2013 22:31:05 +0200 Subject: Set transaction enabled flag default to TRUE --- system/database/drivers/pdo/pdo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 34adf0f86..ffbafea6b 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -53,7 +53,7 @@ class CI_DB_pdo_driver extends CI_DB { * * @var bool */ - public $trans_enabled = FALSE; + public $trans_enabled = TRUE; /** * PDO Options -- cgit v1.2.3-24-g4f1b From 95da6e75c41bcef079215972efa4a0734be7e8c4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 20 Feb 2013 12:38:44 +0200 Subject: Remove CI_DB_pdo_driver:: Improving on PR #2265, the property is inherited with the same value and doesn't need to be set. --- system/database/drivers/pdo/pdo_driver.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'system/database/drivers') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index ffbafea6b..fa89661b1 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -48,13 +48,6 @@ class CI_DB_pdo_driver extends CI_DB { */ public $dbdriver = 'pdo'; - /** - * Transaction enabled flag - * - * @var bool - */ - public $trans_enabled = TRUE; - /** * PDO Options * -- cgit v1.2.3-24-g4f1b