- π§πͺBelgium dieterholvoet Brussels
I'd like to reopen this for reconsideration - assuming that the preview query is intended to be used for debugging purposes outside Drupal, eg. in an SQL client.
Drupal runs some
init_commands
at the start of the request, includingSET sql_mode = 'ANSI,TRADITIONAL'
, which makes MySQL interpret a double quote as an identifier quote. When running queries in an SQL client, theseinit_commands
don't run and the query fails. I think it makes more sense to use the default identifier quotes which are backticks. Additionally, the curly brackets around table names should be stripped. As far as I know that's a Drupalism and no query with those will run outside Drupal.