Bug Report #4264

Problem quoting columns.

Added by Jan Kowalski 8 months ago. Updated 8 months ago.

Status:Closed Start date:09/18/2011
Priority:Normal Due date:
Assignee:Isaiah DeRose-Wilson % Done:

0%

Category:-
Target version:Kohana v3.x - v3.2.1
Resolution:invalid Points:1

Description

KO 3.2 doesn't quote columns.

1 $query = db::insert()->table($this->__table)->columns(array_keys($data))->values(array_values($data));

When in columns is column called key I've got syntax error because key is a part of SQL language, It should be quoted...
1 SELECT `column1`, `column2`, `key` FROM 


Related issues

related to Database - Bug Report #4269: Document how to configure database quoting identifier New 09/19/2011
duplicates Database - Bug Report #4129: Quote table names in builder Kohana v3.x - v3.1.5 Closed 07/25/2011

History

Updated by Isaiah DeRose-Wilson 8 months ago

  • Status changed from New to Closed
  • Assignee set to Isaiah DeRose-Wilson
  • Priority changed from Low to Normal
  • Resolution changed from fixed to invalid

It sounds like you are using the PDO driver and forgot to set an identifier in your config. PDO doesn't use anything to quote columns by default. Check your config file and make sure you've specified an `identifier` value in it if you want your columns quoted.

Updated by Isaiah DeRose-Wilson 8 months ago

  • Project changed from Kohana v3.x to Database
  • Category deleted (Modules:Database)

Also available in: Atom PDF