1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
prepared statements in embedded library


include/mysql_com.h:
  to make net_flush() working in expressions
libmysqld/lib_sql.cc:
  some bugs fixed
libmysqld/libmysqld.c:
  we already have the define in client_settings.h
sql/protocol.cc:
  net_store_data should work that way in Protocol_prep (embedded server)
sql/protocol.h:
  definition for net_store_data
sql/sql_prepare.cc:
  now it works in embedded library
This commit is contained in:
unknown
2003-09-18 12:25:00 +05:00
parent d1e3e9f38f
commit 4535f6897f
6 changed files with 15 additions and 9 deletions

View File

@ -80,6 +80,12 @@ 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)
{
arg= header;
arg_length= header_length;
}
result= dispatch_command(command, thd, (char *) arg, arg_length + 1);
if (!skip_check)
@ -136,6 +142,7 @@ static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt->fields= mysql->fields;
stmt->mem_root= mysql->field_alloc;
mysql->fields= NULL;
}
return 0;
@ -550,7 +557,7 @@ bool Protocol_prep::write()
return true;
}
cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS));
memcpy(cur->data, packet->ptr(), packet->length());
memcpy(cur->data, packet->ptr()+1, packet->length()-1);
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
@ -674,7 +681,7 @@ bool setup_params_data(st_prep_stmt *stmt)
setup_param_functions(param, client_param->buffer_type);
if (!param->long_data_supplied)
{
if (client_param->is_null)
if (*client_param->is_null)
param->maybe_null= param->null_value= 1;
else
{
@ -712,7 +719,7 @@ bool setup_params_data_withlog(st_prep_stmt *stmt)
else
{
if (client_param->is_null)
if (*client_param->is_null)
{
param->maybe_null= param->null_value= 1;
res= &null_string;