First ... Query valid without Space between Number and Column
The following query is valid:
select first 1* from RDB$DATABASE
no Space between 1 and *
I think this should raise an Exception.
IIRC, the tokenizer considers * a token boundary (e.g. consider 1*1 or other expressions involving *), so from the perspective from the parser, it simply receives valid tokens.
While it is not the prettiest, I'm not sure if it's actually a syntax error, and even if it should raise one according to the SQL standard (I haven't had time to dig), I don't think it's worth fixing.
The following query is valid, too:
select first 35RDB$RELATION_ID from RDB$DATABASE
I don’t know if that could actually be a problem either; it just caught my eye. And i think, there should be a space in between.
That one is IMHO a bug, and I've reported it earlier I think. Let me see if I can find it.
See #7594, this comment of me there also explains why select first 1* is technically not a bug (* is a delimiter token by the SQL standard), while select first 35RDB$RELATION_ID should be considered bug as 5, and R are not a delimiter token nor a separator, so 35RDB$RELATION_ID should be considered a single token (that is then syntactically invalid).
See #7594, this comment of me there also explains why
select first 1*is technically not a bug (*is a delimiter token by the SQL standard), whileselect first 35RDB$RELATION_IDshould be considered bug as5, andRare not a delimiter token nor a separator, so35RDB$RELATION_IDshould be considered a single token (that is then syntactically invalid).
Or alternatively, they can be considered two tokens, 35 and RDB$RELATION_ID, but as those would be nondelimiter tokens, there must be a delimiter token and/or separator between them (ISO/IEC 9075-2:2023, section 5.2); the end result is the same though: it is syntactically not valid.
IIRC, this is already fixed in #8564 (according to the description).
IIRC, this is already fixed in #8564 (according to the description).
Based on the description, I'd say yes.