Running Drupal 7.8 on IIS7 with a SQL Server backend via the SQL Server module.

When clicking on the "Task Console" or "Outstanding Tasks" links in the default navigation sidebar, I receive the following error:

PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {maestro_queue} a INNER JOIN {maestro_template_data} b ON a.template_data_id = b.id LEFT OUTER JOIN {maestro_production_assignments} c ON a.id = c.task_id INNER JOIN {maestro_process} d ON a.process_id = d.id LEFT OUTER JOIN {users} e ON c.assign_id = e.uid WHERE ( ([a].[is_interactive] = :db_condition_placeholder_4) AND( ([a].[archived] = :db_condition_placeholder_5) OR ([a].[archived] IS NULL ) )AND( ([a].[status] >= :db_condition_placeholder_6) )AND ([c].[assign_type] = :db_condition_placeholder_7) )) subquery; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => 1 ) in MaestroEngineVersion1->getQueue() (line 998 of C:\inetpub\wwwroot\digitalcoast\sites\all\modules\maestro\maestro_engine_version1.class.php).

Comments

_randy’s picture

This is interesting -- I had to install a fresh D7.8 with the latest sqlsrv module to reproduce this error.
My older installation of D7 with sqlsrv prior to the July release data works just fine with Maestro.

To complicate matters, it would appear that the query is just fine, its the parameter list/number scheme is not right, thus throwing the query error you see.

The Maestro query (in your case) contains 4 parameters shown properly in the array that is fed in to the query object:
Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => 1 )

They are listed there as db_condition_placeholder_X where X goes from 0-3.

The query has 4 placeholders, however their numbering goes from 4-7.
That is something that is clearly broken in sql server but as far as I can tell, doesn't have a fix in Maestro that I can think of. Will do some more digging and perhaps this will result in a change to Maestro.

_randy’s picture

Sounds like this is something that is happening elsewhere as well: http://drupal.org/node/1286792

Looks like its a combination of sql server driver and d7.8 or just d7.8 has a bug.

sneyerst’s picture

Status: Active » Needs review

Seems like there was also an issue posted in the Oracle driver issue queue. A patch has been created there, that solves the parameter placeholder name problem.

You can find the patch http://drupal.org/node/1153174#comment-5090136.

_randy’s picture

Status: Needs review » Closed (won't fix)

Issue is with the sql server driver, not Maestro.
If this does happen to be something related to Maestro, then we can re-open this item.