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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
3.71 KB

Ok, 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.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

The 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!

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

This has been commited, setting to fixed: http://drupal.org/cvs?commit=197076

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.