diff --git a/configure.in b/configure.in index 00a13253166..b49dffcb59f 100644 --- a/configure.in +++ b/configure.in @@ -1667,7 +1667,6 @@ else CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS" fi -AM_CONDITIONAL(MYSQL_CONF_DEBUG, test "x$with_debug" != "xno") # Force static compilation to avoid linking problems/get more speed AC_ARG_WITH(mysqld-ldflags, diff --git a/sql/Makefile.am b/sql/Makefile.am index 251fbaa1c9a..ceec9757889 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -119,11 +119,7 @@ BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h EXTRA_DIST = $(BUILT_SOURCES) DISTCLEANFILES = lex_hash.h sql_yacc.output -AM_YFLAGS = -d - -if MYSQL_CONF_DEBUG -AM_YFLAGS += --debug --verbose -endif +AM_YFLAGS = -d --debug --verbose mysql_tzinfo_to_sql.cc: rm -f mysql_tzinfo_to_sql.cc diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c776fc72b16..0834af46d38 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1501,6 +1501,9 @@ void free_list(I_List *list); /* sql_yacc.cc */ extern int MYSQLparse(void *thd); +#ifndef DBUG_OFF +extern void turn_parser_debug_on(); +#endif /* frm_crypt.cc */ #ifdef HAVE_CRYPTED_FRM diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ceda7507d23..061c29e16c3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5776,27 +5776,6 @@ 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 mysql_test_parse_for_slave() in this same file. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ccf4a9d6687..1dbed6d3cdb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -68,6 +68,34 @@ inline Item *is_truth_value(Item *A, bool v1, bool v2) new Item_int((char *) (v1 ? "FALSE" : "TRUE"),!v1, 1)); } +#ifndef DBUG_OFF +#define YYDEBUG 1 +#else +#define YYDEBUG 0 +#endif + +#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="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 yydebug; + yydebug= 1; +} +#endif + %} %union { int num;