Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-beta3
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 May 2011 at 08:56 UTC
Updated:
13 Jun 2011 at 21:32 UTC
When using a table view and exposing a few filters and use minimum 2 of them I receive the following error:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /views/ajax
StatusText: Internal Server Error
ResponseText: PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{node} node
LEFT JOIN {taxonomy_index} taxonomy_index ON node.nid = taxonomy_index.nid
LEFT JOIN {taxonomy_term_data} taxonomy_term_data ON taxonomy_index.tid = taxonomy_term_data.tid
LEFT JOIN {field_data_apk_build_time} field_data_apk_build_time ON node.nid = field_data_apk_build_time.entity_id AND (field_data_apk_build_time.entity_type = :views_join_condition_0 AND field_data_apk_build_time.deleted = :views_join_condition_1)
WHERE (( (node.type IN (:db_condition_placeholder_0)) AND (node.title ILIKE :db_condition_placeholder_1 ESCAPE '\') AND (taxonomy_term_data.name ILIKE :db_condition_placeholder_2 ESCAPE '\') ))) subquery; Array
(
[:db_condition_placeholder_0] => apk
[:db_condition_placeholder_1] => %acf%
[:db_condition_placeholder_2] => x86
[:views_join_condition_0] => node
[:views_join_condition_1] => 0
)
in views_plugin_pager->execute_count_query() (line 140 of /var/www/localhost/htdocs/drupal/sites/all/modules/views/plugins/views_plugin_pager.inc).
I am using a custom node type with multiple fields created with Field API. My database is PgSQL.
Attached is the view as it is currently running on: http://alpinelinux.org/packages . I have also tried creating a simpler table view with only 2 fields and 2 exposed filters, but this gives the exact same error. Attached you kind find the exported view.
| Comment | File | Size | Author |
|---|---|---|---|
| views.txt | 33.2 KB | clandmeter |
Comments
Comment #1
esmerel commentedhm. I'm unable to replicate this on a mysql database with the latest dev. I wasn't able to use the export, but creating my own doesn't break this.
Comment #2
merlinofchaos commentedThere's a subquery in there. There's currently a bug in core where subqueries lose their parameters when used on multiple queries. You can work around this by disabling the pager, which isn't an ideal solution, I know.
http://drupal.org/node/1112854
Comment #3
merlinofchaos commentedHm. I am misreading. There isn't another subquery in there.
Comment #4
dawehnerI don't really get it 100%. There are 5 placeholders in the sql query and 5 queries at the end.
Comment #5
clandmeter commentedI just tried a clean setup with D7.0 Latest Views from git 7.x. But the issue still remains.
PHP version 5.3.6
PgSQL version 9.04
Comment #6
dawehnerIf it works fine on mysql this seems to be like an dbtng issue for me
@clandmeter
Do you have an idea how to reproduce this issue with a pure dbtng php code? This would help the database maintainers to reproduce the problem.
Comment #7
merlinofchaos commentedYeah, I think this is a core DBTNG bug probably.
Comment #8
merlinofchaos commented