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

Accounting/ReportGenerator : Error while generating the plots due to MySQL Error #7595

Closed
cserf opened this issue Apr 25, 2024 · 0 comments
Closed

Comments

@cserf
Copy link

cserf commented Apr 25, 2024

A wrong SQL query can be generated if one condition value for filtering is an empty list (e.g. AND ( ) AND in the query generated below) :

SELECT `ac_key_Belle-BNL-Certification_Job_FinalMinorStatus`.`value`, `ac_bucket_Belle-BNL-Certification_Job`.`startTime`, `ac_bucket_Belle-BNL-Certification_Job`.`bucketLength`, SUM(`ac_bucket_Belle-BNL-Certification_Job`.`ExecTime`) FROM `ac_bucket_Belle-BNL-Certification_Job`, `ac_key_Belle-BNL-Certification_Job_JobGroup`, `ac_key_Belle-BNL-Certification_Job_JobType`, `ac_key_Belle-BNL-Certification_Job_FinalMinorStatus` WHERE `ac_bucket_Belle-BNL-Certification_Job`.`startTime` >= 1713340800 AND `ac_bucket_Belle-BNL-Certification_Job`.`startTime` <= 1713945600 AND (  ) AND ( `ac_key_Belle-BNL-Certification_Job_JobType`.`value` = "RawProcessing" ) AND `ac_bucket_Belle-BNL-Certification_Job`.`FinalMinorStatus` = `ac_key_Belle-BNL-Certification_Job_FinalMinorStatus`.`id` AND `ac_bucket_Belle-BNL-Certification_Job`.`JobGroup` = `ac_key_Belle-BNL-Certification_Job_JobGroup`.`id` AND `ac_bucket_Belle-BNL-Certification_Job`.`JobType` = `ac_key_Belle-BNL-Certification_Job_JobType`.`id` GROUP BY startTime, `ac_key_Belle-BNL-Certification_Job_FinalMinorStatus`.Value, bucketlength ORDER BY startTime

The problem is due to this :
https://github.com/DIRACGrid/DIRAC/blob/integration/src/DIRAC/AccountingSystem/DB/AccountingDB.py#L1024-L1033

sqlCondList should only be generated if sqlORList is not an empty list

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

2 participants