summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <rafal@quant.(none)>2007-03-01 08:41:13 +0100
committerunknown <rafal@quant.(none)>2007-03-01 08:41:13 +0100
commitb3fafa40fc839141ba525466e0c98d3db01631f8 (patch)
treefd1a5c7a7d28d7e8961c86557471b963ce8381c3
parent0ddc3250e924d5103cb8db298ba467d053f432d3 (diff)
downloadmariadb-git-b3fafa40fc839141ba525466e0c98d3db01631f8.tar.gz
Fixes of compilation warnings and errors.
sql/mysql_priv.h: Removing compiler warning "NULL used in arithmetic" sql/mysqld.cc: First argument to WARN_DEPRECATED is supposed to be a pointer (to THD structure) sql/sql_insert.cc: Removing compiler warning "unused variable". Apparently query is not used when compiling libmysqld. sql/sql_yacc.yy: Removing compiler error "Macro already defined"
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_yacc.yy1
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, \