mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
SCRUM
prepared statements in embedded library. some fixes after testing
This commit is contained in:
@ -56,3 +56,4 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||
uint fields);
|
||||
int STDCALL cli_stmt_execute(MYSQL_STMT *stmt);
|
||||
MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt);
|
||||
int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row);
|
||||
|
@ -2965,6 +2965,14 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row)
|
||||
{
|
||||
if (packet_error == net_safe_read(mysql))
|
||||
return 1;
|
||||
|
||||
*row= (mysql->net.read_pos[0] == 254) ? NULL : (mysql->net.read_pos+1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Fetch and return row data to bound buffers, if any
|
||||
@ -2994,20 +3002,20 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt)
|
||||
}
|
||||
else /* un-buffered */
|
||||
{
|
||||
if (packet_error == net_safe_read(mysql))
|
||||
if((*mysql->methods->unbuffered_fetch)(mysql, ( char **)&row))
|
||||
{
|
||||
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
|
||||
mysql->net.sqlstate);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (mysql->net.read_pos[0] == 254)
|
||||
if (!row)
|
||||
{
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
stmt->current_row= 0;
|
||||
goto no_data;
|
||||
}
|
||||
row= mysql->net.read_pos+1;
|
||||
}
|
||||
}
|
||||
|
||||
stmt->current_row= row;
|
||||
DBUG_RETURN(stmt_fetch_row(stmt, row));
|
||||
|
||||
|
Reference in New Issue
Block a user