Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 Sep 2007 at 06:22 UTC
Updated:
2 Nov 2007 at 04:13 UTC
Very simple SQL syntax cleanup: replace all value as placeholder, in order to keep code as cross database compatible.
| Comment | File | Size | Author |
|---|---|---|---|
| block_query_cleanup-0.1.patch | 3.41 KB | hswong3i |
Comments
Comment #1
hswong3i commentedminor question: should we change the handling of the following lines? seems we are now inserting a imploded integer values as string, and use '%s' for its handling. shouldn't we first implode a %d placeholder within SQL (inline), and further more using an array of integer values (plus something else) for substitution?
Comment #2
chx commentedI know you disregard my evaluation so I won't bother won't fixing this issue but still: these patches are bloat.
Comment #3
mooffie commented>
> Very simple SQL syntax cleanup: replace all value as placeholder,
> in order to keep code as cross database compatible.
hswong3i,
I know you're investing lots of work on the DB stuff (thanks!), but please tell me, what isn't portable in the code as it is right now? What's wrong with "SELECT ... WHERE a = 1 OR b = 'token' " ? Perhaps if you explained yourself you wouldn't encounter fierce opposition.
Comment #4
hswong3i commented@mooffie: first of all, a very simple idea: we did this abstraction by using
%d|%f|%s|%b, and it is proved as meaningful for cross database compatible (before we ship to PHP5.x PDO). i guess we should work out a good example within out core implementation, and so for our contribute developers.more over, writing our query in correct syntax can greatly help about other database driver development (http://drupal.org/node/114774#db-query-standard). even though Oracle and DB2 driver may not become official supported within D6 life cycle (according to the dead-lock of CLOB handling: http://drupal.org/node/147947. since not much MySQL developers can understand how important of this, as MySQL provide TEXT (BTW, max. 4GB only, but Oracle CLOB can support for max. 128TB ;p)), keep this kindly consideration in mind should always be welcome.
P.S. i don't really think this as a critical issue: there are still a lot of other difficulties we need to overcome, before successfully implement our database abstraction layer with consideration for other databases (http://drupal.org/node/172541). we can simply left this issue behind in D6, but seems also no point to ignore it if we are able to handle them on time?
Comment #5
hswong3i commentedSounds not necessary based on my latest research result, if we are able to enclose all table/column/constraint name with [] syntax. That should belongs to D7, so we don't need to fix this issue right now :)