From 85d705b651cf9057f2d687294044f173880675c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Mar 2006 10:09:52 -0800 Subject: [PATCH 1/2] Porting fix that allows others to include compiled code with different parsers. Makes you wonder what I am up to, doesn't? configure.in: Adjusts bison to not create symbols that clash. sql/sql_analyse.cc: Adding define to make sure sql_yacc.h gets included. sql/sql_lex.cc: Fixing it so that sql_yacc.h is included sql/sql_lex.h: Fixing include rules sql/sql_parse.cc: Adding flag to compile sql_yacc.yy --- configure.in | 2 +- sql/sql_analyse.cc | 2 ++ sql/sql_lex.cc | 1 + sql/sql_lex.h | 4 ++++ sql/sql_parse.cc | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4e630de13d2..4ff90bb39bb 100644 --- a/configure.in +++ b/configure.in @@ -236,7 +236,7 @@ AC_PROG_INSTALL test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' # Not critical since the generated file is distributed -AC_PROG_YACC +AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL']) AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) AC_CHECK_PROG(DVIS, tex, manual.dvi) diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 0e4198a5114..af9246c673a 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -27,6 +27,8 @@ #pragma implementation // gcc: Class implementation #endif +#define MYSQL_LEX 1 + #include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 49b0c70ff03..110c82f6926 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -17,6 +17,7 @@ /* A lexical scanner on a temporary buffer with a yacc interface */ +#define MYSQL_LEX 1 #include "mysql_priv.h" #include "item_create.h" #include diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8db059ae2fa..8bacc60d48d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -37,8 +37,12 @@ class sp_pcontext; #define LEX_YYSTYPE void * #else #include "lex_symbol.h" +#if MYSQL_LEX #include "sql_yacc.h" #define LEX_YYSTYPE YYSTYPE * +#else +#define LEX_YYSTYPE void * +#endif #endif /* diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 527a6a67811..ea559c70734 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define MYSQL_LEX 1 #include "mysql_priv.h" #include "sql_repl.h" #include "repl_failsafe.h" From 2fbd17779feb849bbbd7b30ac439196634a1d7e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Mar 2006 13:17:19 -0600 Subject: [PATCH 2/2] mysqltest.test: Fix typos. mysql-test/t/mysqltest.test: Fix typos. --- mysql-test/t/mysqltest.test | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index a93aa24e812..3968eb519e1 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -27,7 +27,7 @@ # ---------------------------------------------------------------------------- # $mysql_errno contains the return code of the last command -# send to the server. +# sent to the server. # ---------------------------------------------------------------------------- # get $mysql_errno before the first statement # $mysql_errno should be -1 @@ -50,7 +50,7 @@ select otto from (select 1 as otto) as t1; # ---------------------------------------------------------------------------- # Negative case(statement): -# The dervied table t1 does not contain a column named 'friedrich' . +# The derived table t1 does not contain a column named 'friedrich' . # --> ERROR 42S22: Unknown column 'friedrich' in 'field list and # --> 1054: Unknown column 'friedrich' in 'field list' # ---------------------------------------------------------------------------- @@ -68,7 +68,7 @@ select friedrich from (select 1 as otto) as t1; # The following unmasked unsuccessful statement must give # 1. mysqltest gives a 'failed' # 2. does not produce a r/.reject file !!! -# PLEASE uncomment it and check it's effect +# PLEASE uncomment it and check its effect #select friedrich from (select 1 as otto) as t1; @@ -114,7 +114,7 @@ select friedrich from (select 1 as otto) as t1; # test cases for $mysql_errno # # $mysql_errno is a builtin variable of mysqltest and contains the return code -# of the last command send to the server. +# of the last command sent to the server. # # The following test cases often initialize $mysql_errno to 1064 by # a command with wrong syntax. @@ -217,7 +217,7 @@ garbage ; execute stmt; eval select $mysql_errno as "after_successful_execute" ; -# failing execute (table dropped) +# failing execute (table has been dropped) drop table t1; --error 1064 garbage ; @@ -249,8 +249,8 @@ eval select $mysql_errno as "after_failing_deallocate" ; # ---------------------------------------------------------------------------- # test cases for "--disable_abort_on_error" # -# "--disable_abort_on_error" switches the abort of mysqltest -# after "unmasked" failing statements off. +# "--disable_abort_on_error" switches off the abort of mysqltest +# after "unmasked" failing statements. # # The default is "--enable_abort_on_error". # @@ -258,13 +258,13 @@ eval select $mysql_errno as "after_failing_deallocate" ; # --error and --error # in the line before the failing statement. # -# There are some additional test case for $mysql_errno +# There are some additional test cases for $mysql_errno # because "--disable_abort_on_error" enables a new situation. # Example: "unmasked" statement fails + analysis of $mysql_errno # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Switch the abort on error off and check the effect on $mysql_errno +# Switch off the abort on error and check the effect on $mysql_errno # ---------------------------------------------------------------------------- --error 1064 garbage ; @@ -345,7 +345,7 @@ select 3 from t1 ; # ---------------------------------------------------------------------------- # Test detect end of line "junk" -# Most likely causes by a missing delimiter +# Most likely caused by a missing delimiter # ---------------------------------------------------------------------------- # Too many parameters to function @@ -1043,7 +1043,7 @@ let $message= . Here comes a very very long message that --source include/show_msg80.inc # -# Test --enable_parsning / disable_parsning +# Test --enable_parsing / disable_parsing # --disable_query_log --disable_parsing @@ -1070,9 +1070,9 @@ select "this will be executed"; # # Test that mysqltest fails when there are no queries executed -# but a result file exist +# but a result file exists # NOTE! This will never happen as long as it's not allowed to have -# test files that does not produce any output +# test files that produce no output #--exec echo "something" > $MYSQLTEST_VARDIR/tmp/result_file.result #--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql #--error 1