mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.stmt
This commit is contained in:
commit
01cb13912b
3 changed files with 16 additions and 2 deletions
|
@ -75,7 +75,10 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
client). So we have to call free_old_query here
|
||||
*/
|
||||
free_old_query(mysql);
|
||||
if (!arg)
|
||||
|
||||
thd->extra_length= arg_length;
|
||||
thd->extra_data= (char *)arg;
|
||||
if (header)
|
||||
{
|
||||
arg= header;
|
||||
arg_length= header_length;
|
||||
|
|
|
@ -430,6 +430,8 @@ public:
|
|||
unsigned long client_stmt_id;
|
||||
unsigned long client_param_count;
|
||||
struct st_mysql_bind *client_params;
|
||||
char *extra_data;
|
||||
ulong extra_length;
|
||||
#endif
|
||||
NET net; // client connection 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;
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue