Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
This code block presents only in sql_yacc.yy and does not present in sql_yacc_ora.yy:
#ifndef DBUG_OFF
|
void turn_parser_debug_on() |
{
|
/* |
MYSQLdebug is in sql/sql_yacc.cc, in bison generated code.
|
Turning this option on is **VERY** verbose, and should be
|
used when investigating a syntax error problem only.
|
|
The syntax to run with bison traces is as follows :
|
- Starting a server manually :
|
mysqld --debug-dbug="d,parser_debug" ...
|
- Running a test :
|
mysql-test-run.pl --mysqld="--debug-dbug=d,parser_debug" ...
|
|
The result will be in the process stderr (var/log/master.err)
|
*/
|
|
extern int yydebug; |
yydebug= 1;
|
}
|
#endif |
The above function is used in mysql_parse() in sql_parse.cc, like this:
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on();); |
Note, currently this code enables parser debug output in the code generated from sql_yacc.yy, but does not enable debug output in sql_yacc_ora.yy.
Let's unify this code and put the following block in both sql_yacc.yy and sql_yacc_ora.yy:
#ifndef DBUG_OFF
#define __CONCAT_UNDERSCORED(x,y) x ## _ ## y
#define _CONCAT_UNDERSCORED(x,y) __CONCAT_UNDERSCORED(x,y)
void _CONCAT_UNDERSCORED(turn_parser_debug_on,yyparse)()
#endif
So:
- sql_yacc.yy provides the function turn_parser_debug_on_MYSQLparse()
- sql_yacc_ora.yy provides the function turn_parser_debug_on_ORAparse()
- The code in sql_yacc.yy and sql_yacc_ora.yy look exactly the same.
The corresponding code in sql_parse.cc will change to:
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on_MYSQLparse();); |
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on_ORAparse();); |
Attachments
Issue Links
- blocks
-
MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
- Closed