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.
Refer to #1993166: Postgres: db_insert()->from($query) with zero rows causes error with default options.
This is a Postgres edge-case, but when the return value is not utilised, there's no reason not to make the change.
@see devel_rebuild_node_comment_statistics()
Comment | File | Size | Author |
---|---|---|---|
#1 | devel-db_insert_return_null-1993200-1.patch | 442 bytes | jweowu |
Comments
Comment #1
jweowu CreditAttribution: jweowu commentedComment #2
salvisAgreed.
Comment #3
salvis#1: devel-db_insert_return_null-1993200-1.patch queued for re-testing.
Comment #4
salvisPushed to D8 and D7 — thank you, jweowu!
Could this work for D6 with dbtng module, too?
Comment #5
jweowu CreditAttribution: jweowu commentedI've never used D6 + DBTNG myself, so while I would imagine this would be the case, I can't confirm it.
However I can see that
InsertQuery::__construct()
sets the same default return value using the same syntax in the D6 module's query.inc, andDatabase::RETURN_NULL
is defined the same way in database.inc, so I'd be surprised if this wasn't applicable.Comment #6
salvisMakes sense, thanks.
Pushed to D6 as well.