Navigation Menu

Skip to content

Commit

Permalink
Changed default CI_DB_result::_data_seek() return value to FALSE and …
Browse files Browse the repository at this point in the history
…removed the method from drivers that don't support it
  • Loading branch information
narfbg committed Apr 12, 2012
1 parent 918be79 commit 8f3566f
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 83 deletions.
2 changes: 1 addition & 1 deletion system/database/DB_result.php
Expand Up @@ -384,7 +384,7 @@ public function num_fields() { return 0; }
public function list_fields() { return array(); }
public function field_data() { return array(); }
public function free_result() { $this->result_id = FALSE; }
protected function _data_seek() { return TRUE; }
protected function _data_seek() { return FALSE; }
protected function _fetch_assoc() { return array(); }
protected function _fetch_object() { return array(); }

Expand Down
2 changes: 1 addition & 1 deletion system/database/drivers/cubrid/cubrid_result.php
Expand Up @@ -163,7 +163,7 @@ public function free_result()
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
17 changes: 0 additions & 17 deletions system/database/drivers/interbase/interbase_result.php
Expand Up @@ -130,23 +130,6 @@ public function free_result()

// --------------------------------------------------------------------

/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
*/
protected function _data_seek($n = 0)
{
// Interbase driver doesn't implement a suitable function
return FALSE;
}

// --------------------------------------------------------------------

/**
* Result - associative array
*
Expand Down
4 changes: 2 additions & 2 deletions system/database/drivers/mssql/mssql_result.php
Expand Up @@ -126,11 +126,11 @@ public function free_result()
/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
2 changes: 1 addition & 1 deletion system/database/drivers/mysql/mysql_result.php
Expand Up @@ -128,7 +128,7 @@ public function free_result()
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions system/database/drivers/mysqli/mysqli_result.php
Expand Up @@ -125,11 +125,11 @@ public function free_result()
/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
4 changes: 0 additions & 4 deletions system/database/drivers/oci8/oci8_result.php
Expand Up @@ -244,8 +244,6 @@ public function result_array()
$this->row_data[$row_index++] = $row;
}

// Un-comment the following line, in case it becomes needed
// $this->_data_seek();
return $this->result_array = $this->row_data;
}

Expand Down Expand Up @@ -299,8 +297,6 @@ public function result_object()
$this->result_object[$row_index++] = $row;
}

// Un-comment the following line, in case it becomes needed
// $this->_data_seek();
return $this->result_object;
}

Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/odbc/odbc_result.php
Expand Up @@ -139,22 +139,6 @@ public function free_result()

// --------------------------------------------------------------------

/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return bool
*/
protected function _data_seek($n = 0)
{
return FALSE;
}

// --------------------------------------------------------------------

/**
* Result - associative array
*
Expand Down
17 changes: 0 additions & 17 deletions system/database/drivers/pdo/pdo_result.php
Expand Up @@ -92,7 +92,6 @@ public function result_assoc()
$res_handler = 'result_'.$type;

$this->$res_handler = array();
$this->_data_seek(0);

while ($row = $this->$res_method())
{
Expand Down Expand Up @@ -227,22 +226,6 @@ public function free_result()

// --------------------------------------------------------------------

/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return bool
*/
protected function _data_seek($n = 0)
{
return FALSE;
}

// --------------------------------------------------------------------

/**
* Result - associative array
*
Expand Down
2 changes: 1 addition & 1 deletion system/database/drivers/postgre/postgre_result.php
Expand Up @@ -128,7 +128,7 @@ public function free_result()
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
2 changes: 1 addition & 1 deletion system/database/drivers/sqlite/sqlite_result.php
Expand Up @@ -112,7 +112,7 @@ public function field_data()
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return array
* @return bool
*/
protected function _data_seek($n = 0)
{
Expand Down
4 changes: 0 additions & 4 deletions system/database/drivers/sqlite3/sqlite3_result.php
Expand Up @@ -198,8 +198,6 @@ public function result_array()
$this->row_data[$row_index++] = $row;
}

// Un-comment the following line, in case it becomes needed
// $this->_data_seek();
return $this->result_array = $this->row_data;
}

Expand Down Expand Up @@ -266,8 +264,6 @@ public function result_object()
$this->num_rows = count($this->result_object);
}

// Un-comment the following line, in case it becomes needed
// $this->_data_seek();
return $this->result_object;
}

Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/sqlsrv/sqlsrv_result.php
Expand Up @@ -123,22 +123,6 @@ public function free_result()

// --------------------------------------------------------------------

/**
* Data Seek
*
* Moves the internal pointer to the desired offset. We call
* this internally before fetching results to make sure the
* result set starts at zero
*
* @return void
*/
protected function _data_seek($n = 0)
{
// Not implemented
}

// --------------------------------------------------------------------

/**
* Result - associative array
*
Expand Down

0 comments on commit 8f3566f

Please sign in to comment.