Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jms-job-queue:clean-up sql error #219

Open
noemiquezada opened this issue Aug 9, 2018 · 1 comment
Open

jms-job-queue:clean-up sql error #219

noemiquezada opened this issue Aug 9, 2018 · 1 comment

Comments

@noemiquezada
Copy link

noemiquezada commented Aug 9, 2018

I am running Symfony 2.8 / PHP 7.0 using SQL Server
When you execute the php app/console jms-job-queue:clean-up command it generates the following exception

[Doctrine\DBAL\DBALException] An exception occurred while executing 'WITH dctrn_cte AS (SELECT TOP 1 1 FROM jms_job_dependencies WHERE dest_job_id = ?) SELECT * FROM (SELECT *, ROW_NUMBE R() OVER (ORDER BY (SELECT 0)) AS doctrine_rownum FROM dctrn_cte) AS doctrine_tbl WHERE doctrine_rownum BETWEEN 1 AND 1 ORDER BY doctrine_rownum ASC' with p arams ["3"]:

SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]No column name was specified for column 1 of 'dctrn_cte'.

I traced through it and it seems that the first line of cleanUpExpiredJobs generates a partial query which generates the above query startingt with 'WITH dctrn_cte...'.

$incomingDepsSql = $con->getDatabasePlatform()->modifyLimitQuery("SELECT 1 FROM jms_job_dependencies WHERE dest_job_id = :id", 1);

When it tries to generate a result it generates the exception because the query is not correct.
$result = $con->executeQuery($incomingDepsSql, array('id' => $job->getId()));

@noemiquezada
Copy link
Author

I updated the following query on Line 85 of CleanUpCommand.php from SELECT 1 FROM to SELECT * FROM and that seemed to resolve the issue.

$incomingDepsSql = $con->getDatabasePlatform()->modifyLimitQuery("SELECT * FROM jms_job_dependencies WHERE dest_job_id = :id", 1);

The query that was generated for looked like 'WITH dctrn_cte AS (SELECT TOP 1 1 FROM jms_job_dependencies... and after the change it looked like 'WITH dctrn_cte AS (SELECT TOP 1 * FROM jms_job_dependencies...

Hopefully this will help anyone else facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant