Commit 465d21a3 authored by Magnus Blåudd's avatar Magnus Blåudd

Bug#45326 Linker failure for libmysqld with VC++ 2008

 - Rename the  functions in mysqld that conflict with the one in the
   external interface defined by mysql.h
parent 79650ae6
...@@ -1408,14 +1408,14 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table); ...@@ -1408,14 +1408,14 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table);
/* sql_prepare.cc */ /* sql_prepare.cc */
void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length); void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length);
void mysql_stmt_execute(THD *thd, char *packet, uint packet_length); void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length);
void mysql_stmt_close(THD *thd, char *packet); void mysqld_stmt_close(THD *thd, char *packet);
void mysql_sql_stmt_prepare(THD *thd); void mysql_sql_stmt_prepare(THD *thd);
void mysql_sql_stmt_execute(THD *thd); void mysql_sql_stmt_execute(THD *thd);
void mysql_sql_stmt_close(THD *thd); void mysql_sql_stmt_close(THD *thd);
void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length); void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length);
void mysql_stmt_reset(THD *thd, char *packet); void mysqld_stmt_reset(THD *thd, char *packet);
void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length); void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
void reinit_stmt_before_use(THD *thd, LEX *lex); void reinit_stmt_before_use(THD *thd, LEX *lex);
......
...@@ -1168,12 +1168,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1168,12 +1168,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
} }
case COM_STMT_EXECUTE: case COM_STMT_EXECUTE:
{ {
mysql_stmt_execute(thd, packet, packet_length); mysqld_stmt_execute(thd, packet, packet_length);
break; break;
} }
case COM_STMT_FETCH: case COM_STMT_FETCH:
{ {
mysql_stmt_fetch(thd, packet, packet_length); mysqld_stmt_fetch(thd, packet, packet_length);
break; break;
} }
case COM_STMT_SEND_LONG_DATA: case COM_STMT_SEND_LONG_DATA:
...@@ -1183,17 +1183,17 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1183,17 +1183,17 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
} }
case COM_STMT_PREPARE: case COM_STMT_PREPARE:
{ {
mysql_stmt_prepare(thd, packet, packet_length); mysqld_stmt_prepare(thd, packet, packet_length);
break; break;
} }
case COM_STMT_CLOSE: case COM_STMT_CLOSE:
{ {
mysql_stmt_close(thd, packet); mysqld_stmt_close(thd, packet);
break; break;
} }
case COM_STMT_RESET: case COM_STMT_RESET:
{ {
mysql_stmt_reset(thd, packet); mysqld_stmt_reset(thd, packet);
break; break;
} }
case COM_QUERY: case COM_QUERY:
...@@ -5708,7 +5708,7 @@ mysql_new_select(LEX *lex, bool move_down) ...@@ -5708,7 +5708,7 @@ mysql_new_select(LEX *lex, bool move_down)
/* /*
Don't evaluate this subquery during statement prepare even if Don't evaluate this subquery during statement prepare even if
it's a constant one. The flag is switched off in the end of it's a constant one. The flag is switched off in the end of
mysql_stmt_prepare. mysqld_stmt_prepare.
*/ */
if (thd->stmt_arena->is_stmt_prepare()) if (thd->stmt_arena->is_stmt_prepare())
select_lex->uncacheable|= UNCACHEABLE_PREPARE; select_lex->uncacheable|= UNCACHEABLE_PREPARE;
......
...@@ -716,9 +716,9 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, ...@@ -716,9 +716,9 @@ static void setup_one_conversion_function(THD *thd, Item_param *param,
prepared statement, parameter markers are replaced with variable names. prepared statement, parameter markers are replaced with variable names.
Example: Example:
@verbatim @verbatim
mysql_stmt_prepare("UPDATE t1 SET a=a*1.25 WHERE a=?") mysqld_stmt_prepare("UPDATE t1 SET a=a*1.25 WHERE a=?")
--> general logs gets [Prepare] UPDATE t1 SET a*1.25 WHERE a=?" --> general logs gets [Prepare] UPDATE t1 SET a*1.25 WHERE a=?"
mysql_stmt_execute(stmt); mysqld_stmt_execute(stmt);
--> general and binary logs get --> general and binary logs get
[Execute] UPDATE t1 SET a*1.25 WHERE a=1" [Execute] UPDATE t1 SET a*1.25 WHERE a=1"
@endverbatim @endverbatim
...@@ -2056,11 +2056,11 @@ static bool init_param_array(Prepared_statement *stmt) ...@@ -2056,11 +2056,11 @@ static bool init_param_array(Prepared_statement *stmt)
to the client, otherwise an error message is set in THD. to the client, otherwise an error message is set in THD.
*/ */
void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
{ {
Prepared_statement *stmt; Prepared_statement *stmt;
bool error; bool error;
DBUG_ENTER("mysql_stmt_prepare"); DBUG_ENTER("mysqld_stmt_prepare");
DBUG_PRINT("prep_query", ("%s", packet)); DBUG_PRINT("prep_query", ("%s", packet));
...@@ -2423,7 +2423,7 @@ static void reset_stmt_params(Prepared_statement *stmt) ...@@ -2423,7 +2423,7 @@ static void reset_stmt_params(Prepared_statement *stmt)
client, otherwise an error message is set in THD. client, otherwise an error message is set in THD.
*/ */
void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length) void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
{ {
uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround
ulong stmt_id= uint4korr(packet); ulong stmt_id= uint4korr(packet);
...@@ -2433,7 +2433,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length) ...@@ -2433,7 +2433,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
uchar *packet_end= packet + packet_length; uchar *packet_end= packet + packet_length;
Prepared_statement *stmt; Prepared_statement *stmt;
bool open_cursor; bool open_cursor;
DBUG_ENTER("mysql_stmt_execute"); DBUG_ENTER("mysqld_stmt_execute");
packet+= 9; /* stmt_id + 5 bytes of flags */ packet+= 9; /* stmt_id + 5 bytes of flags */
...@@ -2444,7 +2444,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length) ...@@ -2444,7 +2444,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
{ {
char llbuf[22]; char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf), my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_execute"); llstr(stmt_id, llbuf), "mysqld_stmt_execute");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -2522,7 +2522,7 @@ void mysql_sql_stmt_execute(THD *thd) ...@@ -2522,7 +2522,7 @@ void mysql_sql_stmt_execute(THD *thd)
@param packet_length Length of packet @param packet_length Length of packet
*/ */
void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length)
{ {
/* assume there is always place for 8-16 bytes */ /* assume there is always place for 8-16 bytes */
ulong stmt_id= uint4korr(packet); ulong stmt_id= uint4korr(packet);
...@@ -2530,7 +2530,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) ...@@ -2530,7 +2530,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
Prepared_statement *stmt; Prepared_statement *stmt;
Statement stmt_backup; Statement stmt_backup;
Server_side_cursor *cursor; Server_side_cursor *cursor;
DBUG_ENTER("mysql_stmt_fetch"); DBUG_ENTER("mysqld_stmt_fetch");
/* First of all clear possible warnings from the previous command */ /* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd); mysql_reset_thd_for_next_command(thd);
...@@ -2539,7 +2539,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) ...@@ -2539,7 +2539,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
{ {
char llbuf[22]; char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf), my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_fetch"); llstr(stmt_id, llbuf), "mysqld_stmt_fetch");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -2580,9 +2580,9 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) ...@@ -2580,9 +2580,9 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
This function resets statement to the state it was right after prepare. This function resets statement to the state it was right after prepare.
It can be used to: It can be used to:
- clear an error happened during mysql_stmt_send_long_data - clear an error happened during mysqld_stmt_send_long_data
- cancel long data stream for all placeholders without - cancel long data stream for all placeholders without
having to call mysql_stmt_execute. having to call mysqld_stmt_execute.
- close an open cursor - close an open cursor
Sends 'OK' packet in case of success (statement was reset) Sends 'OK' packet in case of success (statement was reset)
or 'ERROR' packet (unrecoverable error/statement not found/etc). or 'ERROR' packet (unrecoverable error/statement not found/etc).
...@@ -2591,12 +2591,12 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) ...@@ -2591,12 +2591,12 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
@param packet Packet with stmt id @param packet Packet with stmt id
*/ */
void mysql_stmt_reset(THD *thd, char *packet) void mysqld_stmt_reset(THD *thd, char *packet)
{ {
/* There is always space for 4 bytes in buffer */ /* There is always space for 4 bytes in buffer */
ulong stmt_id= uint4korr(packet); ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt; Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_reset"); DBUG_ENTER("mysqld_stmt_reset");
/* First of all clear possible warnings from the previous command */ /* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd); mysql_reset_thd_for_next_command(thd);
...@@ -2606,7 +2606,7 @@ void mysql_stmt_reset(THD *thd, char *packet) ...@@ -2606,7 +2606,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
{ {
char llbuf[22]; char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf), my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_reset"); llstr(stmt_id, llbuf), "mysqld_stmt_reset");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -2614,7 +2614,7 @@ void mysql_stmt_reset(THD *thd, char *packet) ...@@ -2614,7 +2614,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
/* /*
Clear parameters from data which could be set by Clear parameters from data which could be set by
mysql_stmt_send_long_data() call. mysqld_stmt_send_long_data() call.
*/ */
reset_stmt_params(stmt); reset_stmt_params(stmt);
...@@ -2635,12 +2635,12 @@ void mysql_stmt_reset(THD *thd, char *packet) ...@@ -2635,12 +2635,12 @@ void mysql_stmt_reset(THD *thd, char *packet)
we don't send any reply to this command. we don't send any reply to this command.
*/ */
void mysql_stmt_close(THD *thd, char *packet) void mysqld_stmt_close(THD *thd, char *packet)
{ {
/* There is always space for 4 bytes in packet buffer */ /* There is always space for 4 bytes in packet buffer */
ulong stmt_id= uint4korr(packet); ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt; Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_close"); DBUG_ENTER("mysqld_stmt_close");
thd->main_da.disable_status(); thd->main_da.disable_status();
...@@ -2739,7 +2739,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) ...@@ -2739,7 +2739,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
stmt->state= Query_arena::ERROR; stmt->state= Query_arena::ERROR;
stmt->last_errno= ER_WRONG_ARGUMENTS; stmt->last_errno= ER_WRONG_ARGUMENTS;
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS),
"mysql_stmt_send_long_data"); "mysqld_stmt_send_long_data");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#endif #endif
...@@ -3163,7 +3163,7 @@ Prepared_statement::set_parameters(String *expanded_query, ...@@ -3163,7 +3163,7 @@ Prepared_statement::set_parameters(String *expanded_query,
if (res) if (res)
{ {
my_error(ER_WRONG_ARGUMENTS, MYF(0), my_error(ER_WRONG_ARGUMENTS, MYF(0),
is_sql_ps ? "EXECUTE" : "mysql_stmt_execute"); is_sql_ps ? "EXECUTE" : "mysqld_stmt_execute");
reset_stmt_params(this); reset_stmt_params(this);
} }
return res; return res;
...@@ -3618,11 +3618,11 @@ error: ...@@ -3618,11 +3618,11 @@ error:
} }
/** Common part of DEALLOCATE PREPARE and mysql_stmt_close. */ /** Common part of DEALLOCATE PREPARE and mysqld_stmt_close. */
void Prepared_statement::deallocate() void Prepared_statement::deallocate()
{ {
/* We account deallocate in the same manner as mysql_stmt_close */ /* We account deallocate in the same manner as mysqld_stmt_close */
status_var_increment(thd->status_var.com_stmt_close); status_var_increment(thd->status_var.com_stmt_close);
/* Statement map calls delete stmt on erase */ /* Statement map calls delete stmt on erase */
thd->stmt_map.erase(this); thd->stmt_map.erase(this);
......
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