summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-10-15 22:40:36 +0300
committerunknown <monty@mashka.mysql.fi>2003-10-15 22:40:36 +0300
commitddbc8428546da197a031d24cfcafd1a545467e9b (patch)
treedcc59a0d59657900722d4e51c1daeceec81df437 /sql/sql_prepare.cc
parent086ec556f87701cad20a75031d7fb1ab3cd3b350 (diff)
downloadmariadb-git-ddbc8428546da197a031d24cfcafd1a545467e9b.tar.gz
Portability fixes for windows
After merge fixes include/my_base.h: Fix comment syntax libmysql/client_settings.h: Portability fixes for windows libmysql/libmysql.c: Portability fixes for windows libmysql/libmysql.def: Portability fixes for windows mysql-test/r/variables.result: Fix result after merge sql-common/client.c: Portability fixes for windows sql/ha_berkeley.cc: Use defines instead of constants sql/item_strfunc.cc: Portability fixes for windows sql/mysql_priv.h: Use defines instead of defines sql/mysqld.cc: After merge fix sql/opt_range.h: After merge fix sql/set_var.h: Portability fixes for windows sql/sql_class.cc: Defines instead of constants sql/sql_help.cc: after merge fixes More OOM error checking sql/sql_prepare.cc: After merge fixes sql/sql_table.cc: Portability fixes for windows
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index dd8d5613880..522879c863a 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -888,12 +888,15 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
{
MEM_ROOT thd_root= thd->mem_root;
PREP_STMT stmt;
+ SELECT_LEX *sl;
DBUG_ENTER("mysql_stmt_prepare");
bzero((char*) &stmt, sizeof(stmt));
stmt.stmt_id= ++thd->current_stmt_id;
- init_sql_alloc(&stmt.mem_root, 8192, 8192);
+ init_sql_alloc(&stmt.mem_root,
+ thd->variables.query_alloc_block_size,
+ thd->variables.query_prealloc_size);
stmt.thd= thd;
stmt.thd->mem_root= stmt.mem_root;
@@ -908,7 +911,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
// save WHERE clause pointers to avoid damaging they by optimisation
- for (SELECT_LEX *sl= thd->lex.all_selects_list;
+ for (sl= thd->lex.all_selects_list;
sl;
sl= sl->next_select_in_list())
{
@@ -943,8 +946,9 @@ err:
void mysql_stmt_execute(THD *thd, char *packet)
{
- ulong stmt_id= uint4korr(packet);
- PREP_STMT *stmt;
+ ulong stmt_id= uint4korr(packet);
+ PREP_STMT *stmt;
+ SELECT_LEX *sl;
DBUG_ENTER("mysql_stmt_execute");
if (!(stmt=find_prepared_statement(thd, stmt_id, "execute")))
@@ -963,11 +967,13 @@ void mysql_stmt_execute(THD *thd, char *packet)
LEX thd_lex= thd->lex;
thd->lex= stmt->lex;
- for (SELECT_LEX *sl= stmt->lex.all_selects_list;
+ for (sl= stmt->lex.all_selects_list;
sl;
sl= sl->next_select_in_list())
{
- // copy WHERE clause pointers to avoid damaging they by optimisation
+ /*
+ Copy WHERE clause pointers to avoid damaging they by optimisation
+ */
if (sl->prep_where)
sl->where= sl->prep_where->copy_andor_structure(thd);
DBUG_ASSERT(sl->join == 0);