NULL is an important and special value used by modern database engines like MySQL, PostgreSQL and others. Drupal's database layer is unable to pass a NULL to the database as a standard argument to the db_query() variants. This is due to the preg_replace_callback() and _db_query_callback() functions.

I was unable to find a simple or quick modification to db_query() and/or _db_query_callback() that would facilitate the use of NULL.

Comments

LAsan’s picture

Version: x.y.z » 7.x-dev

Does it still happens in current version?

Bump.

Crell’s picture

Status: Active » Postponed (maintainer needs more info)

I'm pretty sure NULLs should work now with DBTNG. If not, please provide a unit test that demonstrates that shortcoming.

(Note: There is a BC layer included right now that may get in the way of NULLs due to Postgres lameness.)

Crell’s picture

Status: Postponed (maintainer needs more info) » Fixed

I'm pretty sure we do support this now, or will once the BC layer is removed. If not, open a new issue with a unit test. :-)

Status: Fixed » Closed (fixed)

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