Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2008 at 19:51 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedIn the current Core API, using a reserved word as a column name is *not* supported (anywhere). Don't do that.
Comment #2
pasqualleok, if reserved word as column name is not supported then we do not need quotes on columns..
it is sloppy coding to have quotes on one place but do not have on other places..
Comment #3
pasqualleComment #4
damien tournoud commentedWell. My remark was for 6.x.
In 7.x and beyond, columns using reserved words will be supported one day. The query builder that is being prepared in http://drupal.org/node/225450 will allow us to do that for general queries.
So you can use your energy in making sure that the schema API also properly escape column names, thus fixing the bug you spotted initially.
Comment #5
pasquallethis patch should quote columns listed as primary keys, unique keys or as indexes
Comment #6
pasqualleComment #7
pasquallelocale.install
resulted in sql error
Comment #8
Crell commentedI'm certain this no longer applies, but there's a new thread for dealing with this in D7: #315047: All schema API operations should be reserved-word safe.
I'm marking this down D6 rather than duplicate in case Gabor wants to do something with it, but for D7 let's use the other thread.
Comment #9
dpearcefl commentedIs this still an issue using current Drupal 6?
Comment #10
murzThis bug is still here on Drupal 6.22 (see bug #304421: drupal_install_schema() function must always enclose field names).
I test this bug now in Drupal 7.2 and can't reproduce this bug, all works normally. So seems it fixed in 7.x, maybe you can backport db creating process from 7.x to 6.x?
Comment #11
damien tournoud commentedThe database layer in Drupal 7 is vastly different then Drupal 6, so the solution has to be different. #5 has a patch that needs review, and should probably be extended to cover PostgreSQL and the other schema operations (alter table, add index, etc.).
Comment #12
danblack commented