1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
This commit is contained in:
hf@deer.(none)
2003-10-06 16:32:38 +05:00
parent 4661bd8498
commit a5f9c695df
3 changed files with 16 additions and 2 deletions

View File

@ -1088,16 +1088,17 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
PREP_STMT *stmt;
DBUG_ENTER("mysql_stmt_get_longdata");
#ifndef EMBEDDED_LIBRARY
/* The following should never happen */
if (packet_length < MYSQL_LONG_DATA_HEADER+1)
{
my_error(ER_WRONG_ARGUMENTS, MYF(0), "get_longdata");
DBUG_VOID_RETURN;
}
#endif
ulong stmt_id= uint4korr(pos);
uint param_number= uint2korr(pos+4);
pos+= MYSQL_LONG_DATA_HEADER; // Point to data
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;
}
#ifndef EMBEDDED_LIBRARY
if (param_number >= stmt->param_count)
{
/* 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");
DBUG_VOID_RETURN;
}
pos+= MYSQL_LONG_DATA_HEADER; // Point to data
#endif
Item_param *param= *(stmt->param+param_number);
#ifndef EMBEDDED_LIBRARY
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;
DBUG_VOID_RETURN;
}