Commit 2b1aa3fc authored by unknown's avatar unknown

Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1

into teton.kitebird.com:/home/paul/mysql-4.1


libmysql/libmysql.c:
  Auto merged
parents 85938910 c00c3851
...@@ -2035,14 +2035,6 @@ int cli_stmt_execute(MYSQL_STMT *stmt) ...@@ -2035,14 +2035,6 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
uint null_count; uint null_count;
my_bool result; my_bool result;
#ifdef CHECK_EXTRA_ARGUMENTS
if (!stmt->param_buffers)
{
/* Parameters exists, but no bound buffers */
set_stmt_error(stmt, CR_NOT_ALL_PARAMS_BOUND, unknown_sqlstate);
DBUG_RETURN(1);
}
#endif
net_clear(net); /* Sets net->write_pos */ net_clear(net); /* Sets net->write_pos */
/* Reserve place for null-marker bytes */ /* Reserve place for null-marker bytes */
null_count= (stmt->param_count+7) /8; null_count= (stmt->param_count+7) /8;
...@@ -2099,6 +2091,14 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt) ...@@ -2099,6 +2091,14 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt)
set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
#ifdef CHECK_EXTRA_ARGUMENTS
if (stmt->param_count && !stmt->param_buffers)
{
/* Parameters exists, but no bound buffers */
set_stmt_error(stmt, CR_NOT_ALL_PARAMS_BOUND, unknown_sqlstate);
DBUG_RETURN(1);
}
#endif
if ((*stmt->mysql->methods->stmt_execute)(stmt)) if ((*stmt->mysql->methods->stmt_execute)(stmt))
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -336,6 +336,8 @@ THD::~THD() ...@@ -336,6 +336,8 @@ THD::~THD()
#ifndef DBUG_OFF #ifndef DBUG_OFF
dbug_sentry = THD_SENTRY_GONE; dbug_sentry = THD_SENTRY_GONE;
#endif #endif
/* Reset stmt_backup.mem_root to not double-free memory from thd.mem_root */
init_alloc_root(&stmt_backup.mem_root, 0, 0);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -582,8 +582,7 @@ class THD :public ilink, ...@@ -582,8 +582,7 @@ class THD :public ilink,
Statement_map stmt_map; Statement_map stmt_map;
/* /*
keeps THD state while it is used for active statement keeps THD state while it is used for active statement
Note, that double free_root() is safe, so we don't need to do any Note: we perform special cleanup for it in THD destructor.
special cleanup for it in THD destructor.
*/ */
Statement stmt_backup; Statement stmt_backup;
/* /*
......
...@@ -1193,7 +1193,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg) ...@@ -1193,7 +1193,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
setup_params= insert_params; // not fully qualified query setup_params= insert_params; // not fully qualified query
#else #else
setup_params_data= setup_params_data; setup_params_data= ::setup_params_data;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment