Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix Bug in Database Module which causes WHERE compiling to fail #35

Closed
wants to merge 1 commit into from

2 participants

@evulse

Currently the DB Module uses the $db->quote_identifier(reset($column)) in the query builder when compiling the where columns. However this function should only be used on the column alias and not the column name as it can not handle quoting mysql functions and other unique sql statements.

$db->quote_column(reset($column)) works as expected. The variable that caused the issue is

array('CONCAT("column1", "column2")', 'alias')

@shadowhand
Owner

Use DB::expr when you don't want something quoted.

@shadowhand shadowhand closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2012
  1. Change quoting function used on ORM where clause when an array with a…

    Mike authored
    … mysql function is used.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  classes/Kohana/Database/Query/Builder.php
View
2  classes/Kohana/Database/Query/Builder.php
@@ -121,7 +121,7 @@ protected function _compile_conditions(Database $db, array $conditions)
if (is_array($column))
{
// Use the column name
- $column = $db->quote_identifier(reset($column));
+ $column = $db->quote_column(reset($column));
}
else
{
Something went wrong with that request. Please try again.