Any solution for solving DB reserved word conflict?

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.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <p> <br> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup> <acronym> <pre> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.