kohana / database

A Kohana module for database interactions, building queries, and prepared statements
http://kohanaframework.org/documentation
158 stars 140 forks source link

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

Closed evulse closed 10 years ago

evulse commented 12 years ago

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 commented 10 years ago

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