Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Labels:
-
Story Points:10
-
Epic Link:
-
Sprint:DB_S17_12, DB_S17_01, DB_S17_2
-
Team:Data Access and Database
Description
The following dbserv query works:
curl -d 'query=SELECT objectId, id, fsrc.exposure_id, fsrc.exposure_time_mid, exp.run, scisql_dnToAbMag(fsrc.flux_psf,exp.fluxMag0) AS g, scisql_dnToAbMagSigma(fsrc.flux_psf, fsrc.flux_psf_err, exp.fluxMag0, exp.fluxMag0Sigma) AS gErr FROM RunDeepForcedSource AS fsrc, Science_Ccd_Exposure AS exp WHERE exp.scienceCcdExposureId = fsrc.exposure_id AND fsrc.exposure_filter_id=1 AND objectId=3448068867358968 ORDER BY exposure_time_mid' http://lsst-qserv-dax01.ncsa.illinois.edu:5000/db/v0/tap/sync
while this version, identical in all but one respect, fails:
curl -d 'query=SELECT objectId, id, fsrc.exposure_id, fsrc.exposure_time_mid, exp.run, scisql_dnToAbMag(fsrc.flux_psf,exp.fluxMag0) AS g, scisql_dnToAbMagSigma(fsrc.flux_psf, fsrc.flux_psf_err, exp.fluxMag0, exp.fluxMag0Sigma) AS gErr FROM RunDeepForcedSource AS fsrc, Science_Ccd_Exposure AS exp WHERE exp.scienceCcdExposureId = fsrc.exposure_id AND fsrc.exposure_filter_id=1 AND objectId=3448068867358968 ORDER BY fsrc.exposure_time_mid' http://lsst-qserv-dax01.ncsa.illinois.edu:5000/db/v0/tap/sync
The change is from ORDER BY exposure_time_mid to ORDER BY fsrc.exposure_time_mid .
The error in the second instance is:
{"message": "(_mysql_exceptions.OperationalError) (1054, \"Unknown column 'fsrc.exposure_time_mid' in 'order clause'\")", "error": "OperationalError"}
Severity is minor, for now, because the first form works for PDAC and in this case there is no ambiguity between the joined tables. However, it should be investigated because it may be the sign of a more complex issue.
I think I disagree with John, if I'm reading it correctly the first query should still be acceptable because there is just one exposure_time_mid AND MySQL in this case should name result column exposure_time_mid too. Second query with ORDER BY fsrc.exposure_time_mid will fail (immediately and not after 1 hour later) but with more explicit error message ("ORDER BY argument should not include database or table").