mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for #1487
This commit is contained in:
@ -75,7 +75,10 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
client). So we have to call free_old_query here
|
client). So we have to call free_old_query here
|
||||||
*/
|
*/
|
||||||
free_old_query(mysql);
|
free_old_query(mysql);
|
||||||
if (!arg)
|
|
||||||
|
thd->extra_length= arg_length;
|
||||||
|
thd->extra_data= (char *)arg;
|
||||||
|
if (header)
|
||||||
{
|
{
|
||||||
arg= header;
|
arg= header;
|
||||||
arg_length= header_length;
|
arg_length= header_length;
|
||||||
|
@ -430,6 +430,8 @@ public:
|
|||||||
unsigned long client_stmt_id;
|
unsigned long client_stmt_id;
|
||||||
unsigned long client_param_count;
|
unsigned long client_param_count;
|
||||||
struct st_mysql_bind *client_params;
|
struct st_mysql_bind *client_params;
|
||||||
|
char *extra_data;
|
||||||
|
ulong extra_length;
|
||||||
#endif
|
#endif
|
||||||
NET net; // client connection descriptor
|
NET net; // client connection descriptor
|
||||||
LEX lex; // parse tree descriptor
|
LEX lex; // parse tree descriptor
|
||||||
|
@ -1088,16 +1088,17 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
|
|||||||
PREP_STMT *stmt;
|
PREP_STMT *stmt;
|
||||||
DBUG_ENTER("mysql_stmt_get_longdata");
|
DBUG_ENTER("mysql_stmt_get_longdata");
|
||||||
|
|
||||||
|
#ifndef EMBEDDED_LIBRARY
|
||||||
/* The following should never happen */
|
/* The following should never happen */
|
||||||
if (packet_length < MYSQL_LONG_DATA_HEADER+1)
|
if (packet_length < MYSQL_LONG_DATA_HEADER+1)
|
||||||
{
|
{
|
||||||
my_error(ER_WRONG_ARGUMENTS, MYF(0), "get_longdata");
|
my_error(ER_WRONG_ARGUMENTS, MYF(0), "get_longdata");
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ulong stmt_id= uint4korr(pos);
|
ulong stmt_id= uint4korr(pos);
|
||||||
uint param_number= uint2korr(pos+4);
|
uint param_number= uint2korr(pos+4);
|
||||||
pos+= MYSQL_LONG_DATA_HEADER; // Point to data
|
|
||||||
|
|
||||||
if (!(stmt=find_prepared_statement(thd, stmt_id, "get_longdata")))
|
if (!(stmt=find_prepared_statement(thd, stmt_id, "get_longdata")))
|
||||||
{
|
{
|
||||||
@ -1109,6 +1110,7 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
|
|||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (param_number >= stmt->param_count)
|
if (param_number >= stmt->param_count)
|
||||||
{
|
{
|
||||||
/* Error will be sent in execute call */
|
/* Error will be sent in execute call */
|
||||||
@ -1117,8 +1119,15 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
|
|||||||
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), "get_longdata");
|
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), "get_longdata");
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
pos+= MYSQL_LONG_DATA_HEADER; // Point to data
|
||||||
|
#endif
|
||||||
|
|
||||||
Item_param *param= *(stmt->param+param_number);
|
Item_param *param= *(stmt->param+param_number);
|
||||||
|
#ifndef EMBEDDED_LIBRARY
|
||||||
param->set_longdata(pos, packet_length-MYSQL_LONG_DATA_HEADER-1);
|
param->set_longdata(pos, packet_length-MYSQL_LONG_DATA_HEADER-1);
|
||||||
|
#else
|
||||||
|
param->set_longdata(thd->extra_data, thd->extra_length);
|
||||||
|
#endif
|
||||||
stmt->long_data_used= 1;
|
stmt->long_data_used= 1;
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user