You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we copy the SQL and paste it, we see a sort order has been added to the query without wrapping it with spaces.. so we end up with in invalid SQL: "DESCLIMIT"
SELECT elements.idASelementIdFROM (SELECT elements.idASelementsId, elements_sites.idASelementsSitesId, content.idAScontentIdFROM elementselementsINNER JOIN entriesentriesONentries.id=elements.idINNER JOIN elements_siteselements_sitesONelements_sites.elementId=elements.idINNER JOIN contentcontent ON (content.elementId=elements.id) AND (content.siteId=elements_sites.siteId)LEFT JOIN structureelementsstructureelements ON (structureelements.elementId=elements.id) AND (structureelements.structureId=13)WHERE (entries.sectionId=4) AND (elements_sites.siteId=1) AND (elements.archived=FALSE) AND (elements.dateDeleted IS NULL) AND (elements.draftId IS NULL) AND (elements.revisionIdIS NULL)ORDER BYelements.dateUpdatedDESCLIMIT 1)subqueryINNER JOIN elementselementsONelements.id=subquery.elementsIdINNER JOIN elements_siteselements_sitesONelements_sites.id=subquery.elementsSitesIdINNER JOIN entriesentriesONentries.id=subquery.elementsIdINNER JOIN contentcontentONcontent.id=subquery.contentIdLEFT JOIN structureelementsstructureelements ON (structureelements.elementId=subquery.elementsId) AND (structureelements.structureId=13)ORDER BY elements.dateUpdated DESC;
Notice there is no space before 'ORDER BY' so its possibly this being added without wrapping in spaces:
"ORDER BY elements.dateUpdated DESC"
The text was updated successfully, but these errors were encountered:
It sounds like perhaps line breaks need to be replaced with spaces before the SQL string is output. Thanks for reporting this, I'll work on a fix for the next release.
On the 'Entry Queries' ie this page:
https://putyourlightson.com/articles/introducing-blitz-diagnostics#tracked-element-queries
When we copy the SQL and paste it, we see a sort order has been added to the query without wrapping it with spaces.. so we end up with in invalid SQL: "DESCLIMIT"
SELECT
elements.
idAS
elementIdFROM (SELECT
elements.
idAS
elementsId,
elements_sites.
idAS
elementsSitesId,
content.
idAS
contentIdFROM
elementsINNER JOIN
entriesON
entries.
id=
elements.
idINNER JOIN
elements_sitesON
elements_sites.
elementId=
elements.
idINNER JOIN
contentON (
content.
elementId=
elements.
id) AND (
content.
siteId=
elements_sites.
siteId)LEFT JOIN
structureelementsON (
structureelements.
elementId=
elements.
id) AND (
structureelements.
structureId=13)WHERE (
entries.
sectionId=4) AND (
elements_sites.
siteId=1) AND (
elements.
archived=FALSE) AND (
elements.
dateDeletedIS NULL) AND (
elements.
draftIdIS NULL) AND (
elements.
revisionIdIS NULL)ORDER BY
elements.
dateUpdatedDESCLIMIT 1)
subqueryINNER JOIN
elementsON
elements.
id=
subquery.
elementsIdINNER JOIN
elements_sitesON
elements_sites.
id=
subquery.
elementsSitesIdINNER JOIN
entriesON
entries.
id=
subquery.
elementsIdINNER JOIN
contentON
content.
id=
subquery.
contentIdLEFT JOIN
structureelementsON (
structureelements.
elementId=
subquery.
elementsId) AND (
structureelements.
structureId=13)ORDER BY
elements.
dateUpdatedDESC;
Notice there is no space before 'ORDER BY' so its possibly this being added without wrapping in spaces:
"ORDER BY
elements
.dateUpdated
DESC"The text was updated successfully, but these errors were encountered: