What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

See this query which works as is, but if you edit it to delete either embedded new line (or both) the query fails with:

Incorrect syntax near '0'.
share|improve this question

1 Answer 1

up vote 7 down vote accepted

Data Explorer currently does some pretty light (but terribly messy) mangling of your query on the backend for the purposes of extracting query parameters and removing purely cosmetic newlines.

Ignoring everything else that's wrong with the responsible code (which I've made another note to revisit in the near future), part of the routine is extracting quoted content and then re-substituting it back in....mistakenly in forward order, which makes it susceptible to token misidentification (i.e. Token1 being swapped in for Token10, leaving the trailing 0).

Iterating backwards would have been the smart thing to do there, so now that's what happens.

share|improve this answer
3  
Tests? TESTS? This isn't the Stack Exchange I know and love –  Michael Mrozek Apr 2 '12 at 6:23
2  
I doubt anyone at Stack Exchange would write code quite as ugly as that query parser is...so I need something to verify against when I refactor. ;) –  Tim Stone Apr 2 '12 at 6:25
3  
You've not seen my code, which is why we'll never be open-source :) Nice fix you made here. –  Jarrod Dixon Apr 2 '12 at 18:45
    
Hahah, @Jarrod :) And thanks - Should probably look into better token values too, just in case...but there's an extremely low chance anyone will accidentally provide breaking input before I get a chance to try and rework that parser code, so it can wait for now. –  Tim Stone Apr 3 '12 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .