Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
DECODE has different meaning in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECODE_SYM, we'll have separate DECODE_MARIADB_SYM and DECODE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECODE_MARIADB_SYM, and translate it to DECODE_ORACLE_SYM in Oracle compatibility mode:
if (m_thd->variables.sql_mode & MODE_ORACLE) |
{
|
switch (symbol->tok) { |
...
|
case DECODE_MARIADB_SYM: return DECODE_ORACLE_SYM; |
...
|
}
|
}
|
Attachments
Issue Links
- blocks
-
MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
- Closed
- relates to
-
MDEV-17652 Add sql_mode specific tokens for some keywords
- Closed
-
MDEV-17660 sql_mode=ORACLE: Some keywords do not work as label names: history, system, versioning, without
- Closed
-
MDEV-17664 Add sql_mode specific tokens for ':' and '%'
- Closed