Skip to content

Commit

Permalink
Fix issue bcit-ci#1257
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Oct 6, 2012
1 parent 956631d commit cd50592
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 259 deletions.
20 changes: 1 addition & 19 deletions system/database/DB_query_builder.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1521,24 +1521,6 @@ protected function _replace($table, $keys, $values)


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


/**
* From Tables
*
* This public function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
is_array($tables) OR $tables = array($tables);

return (count($tables) === 1) ? $tables[0] : '('.implode(', ', $tables).')';
}

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

/** /**
* Get UPDATE query string * Get UPDATE query string
* *
Expand Down Expand Up @@ -2058,7 +2040,7 @@ protected function _compile_select($select_override = FALSE)
// Write the "FROM" portion of the query // Write the "FROM" portion of the query
if (count($this->qb_from) > 0) if (count($this->qb_from) > 0)
{ {
$sql .= "\nFROM ".$this->_from_tables($this->qb_from); $sql .= "\nFROM ".implode(', ', $this->qb_from);
} }


// Write the "JOIN" portion of the query // Write the "JOIN" portion of the query
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/ibase/ibase_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -301,22 +301,6 @@ public function error()


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


/**
* From Tables
*
* This public function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/mssql/mssql_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -361,22 +361,6 @@ public function error()


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/oci8/oci8_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -542,22 +542,6 @@ public function error()


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Insert_batch statement * Insert_batch statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/odbc/odbc_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -288,22 +288,6 @@ public function error()


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Truncate statement * Truncate statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -129,22 +129,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -152,22 +152,6 @@ protected function _list_columns($table = '')


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -138,22 +138,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -164,22 +164,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -158,22 +158,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -145,22 +145,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Insert_batch statement * Insert_batch statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -155,22 +155,6 @@ protected function _list_columns($table = '')


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,22 +141,6 @@ protected function _field_data($table)


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -181,22 +181,6 @@ protected function _list_columns($table = '')


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/postgre/postgre_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -456,22 +456,6 @@ public function error()


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
16 changes: 0 additions & 16 deletions system/database/drivers/sqlsrv/sqlsrv_driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -357,22 +357,6 @@ public function error()


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


/**
* From Tables
*
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
* @param array
* @return string
*/
protected function _from_tables($tables)
{
return is_array($tables) ? implode(', ', $tables) : $tables;
}

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

/** /**
* Update statement * Update statement
* *
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelog.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Bug fixes for 3.0
- Fixed a bug (#1692) - :doc:`Database Library <database/index>` method ``display_error()`` didn't properly trace the possible error source on Windows systems. - Fixed a bug (#1692) - :doc:`Database Library <database/index>` method ``display_error()`` didn't properly trace the possible error source on Windows systems.
- Fixed a bug (#1745) - ``is_write_type()`` method in the :doc:`Database Library <database/index>` didn't return TRUE for LOAD queries. - Fixed a bug (#1745) - ``is_write_type()`` method in the :doc:`Database Library <database/index>` didn't return TRUE for LOAD queries.
- Fixed a bug (#1765) - :doc:`Database Library <database/index>` didn't properly detect connection errors for MySQLi. - Fixed a bug (#1765) - :doc:`Database Library <database/index>` didn't properly detect connection errors for MySQLi.
- Fixed a bug (#1257) - :doc:`Query Builder <database/query_builder>` used to (unnecessarily) group FROM clause contents, which breaks certain queries and is invalid for some databases.


Version 2.1.2 Version 2.1.2
============= =============
Expand Down

0 comments on commit cd50592

Please sign in to comment.