[development] Any solution for solving DB reserved word conflict?

Edison Wong hswong3i at edin.no-ip.com
Sun Feb 17 08:13:52 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi Folk,

I would like to ask for some support and suggestion for a 6-year-old 
issue: DB reserved word conflict within Drupal core 
(http://drupal.org/node/371).

Support multiple databases within core should be one of the possible 
solution for expand market sharing. BTW, the conflict with DB specific 
reserved words is an always pain for abstraction layer designer and 
developer, and so affect the daily work of contribute developers. Drupal 
has also faced this problem since June 30, 2002.

As Drupal 7.x is now open for public development, this issues is 
activated once again. Based on research and compare with other OSS web 
application, there is some possible solutions:

~   1. Avoid the use of ALL reserved words within core. This is our 
traditional approach since 2002; on the other hand, Moodle 1.7+ also 
apply this solution, which support totally 4 databases: MySQL, 
PostgreSQL, Oracle and MSSQL 
(http://docs.moodle.org/en/XMLDB_reserved_words).
~   2. Escape ALL potential reserved words with escape characters. 
Gallery2 is using this solution, and is able to support totally 6 
databases: MySQL, PostgreSQL, Oracle, DB2, MSSQL and SQLite 
(http://www.garfieldtech.com/blog/database-abstraction#comment-446).

Some hybrid suggestions are also proposed, but most of them can't solve 
this problem perfectly. E.g. Handling the escape of reserved word within 
each database drivers implementation (slow, complicated, and always 
miss), only handle the conflict of table name (can't solve the problem), 
using non-pair-up token as escape character (potentially buggy and not 
the optimal solution), etc.

Both Moodle and Gallery2 are using ADOdb for DB abstraction, but finally 
solve the reserved word conflict problem in totally different direction. 
We can find that what DB abstraction can do for this issues is very 
limited, and usually require for the help from standardizing core query 
syntax, and be careful in our daily development.

This issue can't be solved by normal simple patch, and usually need the 
help from most core developers. We may need to find out the best 
solution which we are all agreed to follow it.

If you are interested in solving this 6-year-old issue, please refer to 
http://drupal.org/node/371 for more technical detail. Thanks a lot.

Regard

- --
Edison Wong
hswong3i at gmail.com
http://edin.no-ip.com/html/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFHt+zABPIQaq+ZRd8RAtQQAJ9/cT7ewpFdWwG4ckStooiz/MlcBwCfS/rW
5g8txeXaitkSqkSN62wTpjg=
=vZiU
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hswong3i.vcf
Type: text/x-vcard
Size: 187 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20080217/27c82573/attachment.vcf 


More information about the development mailing list