Scenario: fresh install with sqlite and forum_access. When creating a forum post this bug is found:

PDOException: SQLSTATE[HY000]: General error: 25 bind or column index out of range: INSERT INTO {acl_node} (nid, acl_id, grant_view, grant_update, grant_delete, priority) SELECT n.nid AS nid, 4 AS acl_id, 1 AS grant_view, 1 AS grant_update, 1 AS grant_delete, 0 AS priority FROM {taxonomy_index} n WHERE (n.tid = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 4 ) in acl_add_nodes() (line 117 of /var/www/gcms/sites/all/modules/contrib/acl/acl.module).

This seems sqlite specific. I was unable to reproduce with mysql.

On further debugging:

* The query is executed correctly in sqlite console.
* I realized that the subselect query results empty.

So it seems a bug with the pdo driver.

CommentFileSizeAuthor
#3 acl-1779478.patch1.32 KBjonhattan
#1 acl-1779478.patch1.32 KBjonhattan

Comments

jonhattan’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Here's a workaround.

Status: Needs review » Needs work

The last submitted patch, acl-1779478.patch, failed testing.

jonhattan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.32 KB

Note: I don't have a great expectative of getting this patch accepted, since the bug must be fixed upstream.

salvis’s picture

Status: Needs review » Needs work

Thank you for pursuing this to the bottom.

So, SQLite fails on INSERT FROM SELECT if the subquery returns an empty set, right?

The patch looks good but the code structure is not as straight-forward as it used to be.

Please do the following:
1. Create an issue in the SQLite queue about the underlying problem.
2. Provide patch with a separate code path for sqlite (so that the code paths for the other databases remain unchanged), add a two-line explanation plus references to the issues in the SQLite queue as well as this one, so that we can remove it easily once it's not needed anymore.

That'll have a very good chance for going in.

salvis’s picture

Issue summary: View changes
Status: Needs work » Closed (works as designed)

No follow-up, so I'm assuming that this was fixed in the SQLite driver.