MXS-3318 Fix problem

When the tokenizer encounters a keyword, it sniffs whether the
last non-whitespace character before it happens to be a '.' and
if it is, the keyword is assumed to be the second part of a
qualified name.

Thus, before this commit

    -- blah.
    UPDATE ...

would not be parsed as KEYWORD (UPDATE) followed by stuff, but as
an ID (blah.UPDATE) followed by stuff.

With this change, newlines are no longer counted as whitespace.
This commit is contained in:
Johan Wikman
2020-12-15 16:55:34 +02:00
parent 9481abb42d
commit 2b8d5076e2

View File

@ -679,7 +679,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){
if (pParse) {
if (z != (const unsigned char *)pParse->zTail) {
const char *p = (const char*)z - 1;
while ((p != pParse->zTail) && sqlite3Isspace(*p)) {
while ((p != pParse->zTail) && sqlite3Isspace(*p) && *p != '\n') {
--p;
}