Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In contrast to the default insert query, InsertQuery_mysql currently creates a SQL syntax error when execute() is called without any values. See #302412: DB TNG: Taxonomy.module.
Because InsertQuery uses foreach to loop over the values, this can't happen there.
Patch adds a simple check to return NULL if no values are set.
Comment | File | Size | Author |
---|---|---|---|
#2 | insert_no_values2.patch | 3.71 KB | Berdir |
insert_mysql_no_values.patch | 620 bytes | Berdir | |
Comments
Comment #2
BerdirOk, I was wrong, all dbms need the check and every of them overwrites execute() so I have to add those lines 4 times :)
There are two checks which are executed in every execute() implementation, maybe they could be moved to an own function.
Comment #3
Crell CreditAttribution: Crell commentedThe different execute() routines are not that similar, I think, so I don't know if it's worth generalizing bits of them. Either way that's for another patch to do internal cleanup. This one looks good. Thanks!
Comment #4
BerdirThis has been commited, setting to fixed: http://drupal.org/cvs?commit=197076