mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
WL#3432 (Compile the Parser with a --debug --verbose option)
Changed the automake build process : - ./configure.in - ./sql/Makefile.am to compile an instrumented parser for debug=yes or debug=full builds Changed the (primary) runtime invocation of the parser : - sql/sql_parse.cc to generate bison traces in stderr when the DBUG "parser_debug" flag is set.
This commit is contained in:
@@ -5776,6 +5776,26 @@ void mysql_init_multi_delete(LEX *lex)
|
||||
lex->query_tables_last= &lex->query_tables;
|
||||
}
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
static 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="d,parser_debug" ...
|
||||
- Running a test :
|
||||
mysql-test-run.pl --mysqld="--debug=d,parser_debug" ...
|
||||
|
||||
The result will be in the process stderr (var/log/master.err)
|
||||
*/
|
||||
extern int MYSQLdebug;
|
||||
MYSQLdebug= 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
When you modify mysql_parse(), you may need to mofify
|
||||
@@ -5785,6 +5805,9 @@ void mysql_init_multi_delete(LEX *lex)
|
||||
void mysql_parse(THD *thd, char *inBuf, uint length)
|
||||
{
|
||||
DBUG_ENTER("mysql_parse");
|
||||
|
||||
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
|
||||
|
||||
mysql_init_query(thd, (uchar*) inBuf, length);
|
||||
if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user