Problem/Motivation
Drupal 7 runs with multiple allowed database types, and moreover theses types can be extended by contrib modules.
Some queries within this module are hardcoded with MySQL.
Proposed resolution
Use DatabaseAPI instead of hardcoded SQL for queries.
Comments
Comment #2
gisleHow do I spot queries that are hardcoded for SQL?
Is there a page pointing out MYSQLisms for Drupal 7 - similar to this one (which focuses on Druapal 6).
Comment #3
dom. commentedI'm not aware of such a page for D7. But you should use the DB statement from database API everywhere (see result, insert, update and delete exemples here):
https://www.drupal.org/developing/api/database
In your module, any ligns using db_query("some sql") for insert, update and delete woud not fit any other DB then MySQL. As per said in doc:
Comment #5
gisleAgreed, but there AFAIK no such
db_query-calls in the project. As per the doc you cite I only usedb_queryfor simpleSELECTstatements.At least, when I grep for this using the following sequence of CLI commands, nothing is found.
However, I found some instances of
!=(replaced with ANSI compliant<>) and some instances ofLIMIT(replaceddb_querywithdb_query_range). As far as I am able to tell, there are no other MySQLisms in the project.Please review.
Comment #6
gisleThis is in release 7.x-1.1.