From 8aee1f6e8963e758f3db5596f9c4fdfacee717d7 Mon Sep 17 00:00:00 2001 From: "rafal@quant.(none)" <> Date: Thu, 1 Mar 2007 08:41:13 +0100 Subject: [PATCH] Fixes of compilation warnings and errors. --- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 2 +- sql/sql_insert.cc | 2 ++ sql/sql_yacc.yy | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 97f56c83b4f..7ca0d567253 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -100,7 +100,7 @@ void net_set_read_timeout(NET *net, uint timeout); #define WARN_DEPRECATED(Thd,Ver,Old,New) \ do { \ DBUG_ASSERT(strncmp(Ver, MYSQL_SERVER_VERSION, sizeof(Ver)-1) > 0); \ - if (Thd != NULL) \ + if (((gptr)Thd) != NULL) \ push_warning_printf(((THD *)Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \ ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), \ (Old), (Ver), (New)); \ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5709a12c03d..f8fbbee5644 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6957,7 +6957,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (!slave_warning_issued) //only show the warning once { slave_warning_issued = true; - WARN_DEPRECATED(0, "5.2", "for replication startup options", + WARN_DEPRECATED(NULL, "5.2", "for replication startup options", "'CHANGE MASTER'"); } break; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 613b28faf63..b44cbf46a31 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -381,7 +381,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, List_item *values; Name_resolution_context *context; Name_resolution_context_state ctx_state; +#ifndef EMBEDDED_LIBRARY char *query= thd->query; +#endif bool log_on= (thd->options & OPTION_BIN_LOG) || (!(thd->security_ctx->master_access & SUPER_ACL)); thr_lock_type lock_type = table_list->lock_type; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index efe8d85d8f5..933fa839e71 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -46,6 +46,7 @@ const LEX_STRING null_lex_str={0,0}; #define yyoverflow(A,B,C,D,E,F) {ulong val= *(F); if (my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }} +#undef WARN_DEPRECATED /* this macro is also defined in mysql_priv.h */ #define WARN_DEPRECATED(A,B) \ push_warning_printf(((THD *)yythd), MYSQL_ERROR::WARN_LEVEL_WARN, \ ER_WARN_DEPRECATED_SYNTAX, \