stable
Clone or download
Due to recent change of tracker report queries to EasyDB, we need to know which query is failing. Before EasyDB, the query was outputed, but now we have only "Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number" without much details. With this contribution we will get something like: ``` 023-06-15T09:37:44+02:00 [51075] [error] Error while trying to execute the following report query with 1 parameters: SELECT id, last_changeset_id, ? FROM (SELECT c.artifact_id AS id, c.id AS last_changeset_id FROM tracker_artifact AS artifact INNER JOIN tracker_changeset AS c ON (artifact.last_changeset_id = c.id) WHERE (artifact.tracker_id = ?) AND ((SELECT 1 FROM tracker_changeset_value_artifactlink AS TCVAL_00000000000009610000000000000000 INNER JOIN tracker_changeset_value AS TCV_00000000000009610000000000000000 ON (TCVAL_00000000000009610000000000000000.changeset_value_id = TCV_00000000000009610000000000000000.id) INNER JOIN tracker_artifact AS TCA_00000000000009610000000000000000 ON (TCA_00000000000009610000000000000000.last_changeset_id = TCV_00000000000009610000000000000000.changeset_id) WHERE TCVAL_00000000000009610000000000000000.artifact_id = artifact.id AND TCVAL_00000000000009610000000000000000.nature = '_is_child' LIMIT 1) = 1)) AS R GROUP BY id, last_changeset_id 2023-06-15T09:37:44+02:00 [51075] [error] Caught exception: SQLSTATE[HY093]: Invalid parameter number: #0 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(1005): PDOStatement->execute() #1 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(948): ParagonIE\EasyDB\EasyDB->safeQuery() #2 /usr/share/tuleap/plugins/tracker/include/Tracker/Report/Query/QueryDao.php(125): ParagonIE\EasyDB\EasyDB->run() ``` It will help to understand why a query is failing. The parameters are not outputted to preserve privacy. Part of story #32281: Search artifacts with/without parents via TQL Change-Id: Ieaec0ea08ae4415ad10efbfd38d7b938f9b7f408
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/include/Tracker/Report/Query/QueryDao.php | +19 | −8 | Go to diff View file |