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


include/mysql.h:
  virtual method added
libmysql/client_settings.h:
  declaration added
libmysql/libmysql.c:
  implementation added
  mysql_fetch changed to work in both libraries
libmysqld/lib_sql.cc:
  implementation added
sql-common/client.c:
  added items in methods table
sql/client_settings.h:
  decided to remove such defines - i placed single #ifdef in client.c
This commit is contained in:
unknown
2003-09-19 14:05:28 +05:00
parent 4c63804846
commit 83e8881a5a
6 changed files with 46 additions and 16 deletions

View File

@ -195,6 +195,26 @@ MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
return emb_read_rows(stmt->mysql, 0, 0);
}
int STDCALL emb_unbuffered_fetch(MYSQL *mysql, char **row)
{
MYSQL_DATA *data= ((THD*)mysql->thd)->data;
if (!data || !data->data)
{
*row= NULL;
if (data)
{
free_rows(data);
((THD*)mysql->thd)->data= NULL;
}
}
else
{
*row= (char *)data->data->data;
data->data= data->data->next;
}
return 0;
}
MYSQL_METHODS embedded_methods=
{
emb_mysql_read_query_result,
@ -205,7 +225,8 @@ MYSQL_METHODS embedded_methods=
emb_list_fields,
emb_read_prepare_result,
emb_stmt_execute,
emb_read_binary_rows
emb_read_binary_rows,
emb_unbuffered_fetch
};
C_MODE_END
@ -561,9 +582,8 @@ bool Protocol_prep::write()
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
next_field=cur->data;
next_mysql_field= thd->mysql->fields;
cur->next= 0;
return false;
}