You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2018/12/05 12:12:00 UTC
[GitHub] morningman commented on issue #381: Support 'NO_BACKSLASH_ESCAPES'
sql_mode
morningman commented on issue #381: Support 'NO_BACKSLASH_ESCAPES' sql_mode
URL: https://github.com/apache/incubator-doris/issues/381#issuecomment-444464498
The 'NO_BACKSLASH_ESCAPES' sql_mode we supported before does not have same meaning as MySQL's sql_mode with same name.
In MySQL, 'NO_BACKSLASH_ESCAPES' means to ignore the backslash at the very beginning of lexical parsing phase. But what we implemented in Doris, is to ignore backslash just in accepted quoted string.
In MySQL, if sql_mode is set to 'NO_BACKSLASH_ESCAPES', the following stmt will not be accepted:
`select * from tbl where k1 'ab\'c'`;
But in Doris, this stmt is accepted with sql_mode set to 'NO_BACKSLASH_ESCAPES'.
Because in Doris, jflex is used as lexical parser, which does not support ignoring backslash when parsing the origin string. So first, jflex will accept the string `'ab\'c'` as `ab'c`. And than it makes a further analysis to this string, determine whether to keep the backslash or not. (`ab'c` or `ab\'c`).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org