summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-09-16 16:06:25 +0500
committerunknown <hf@deer.(none)>2003-09-16 16:06:25 +0500
commitd05807153b640bee039746cc449273e0672e43c4 (patch)
treee38da8c154875ca2ff180275d93d7dfa211f0f14 /sql-common
parent774c65c7a37b0b02912940dd3c804fb526b68afa (diff)
downloadmariadb-git-d05807153b640bee039746cc449273e0672e43c4.tar.gz
SCRUM
Prepared statements in embedded server Several changes in library code with two goals: to make mysql_prepare_stmt working in embedded server to get rid of #define mysql_interface_func mysql->methods->interface_func in user's interface include/mysql.h: modifications of interface two goals: to implement prepared statements and to get rid of #define mysql_proc (mysql->smth) in interface include/sql_common.h: read_rows function got 'virtual' libmysql/client_settings.h: interface of some functions declared in client.c moved here libmysql/libmysql.c: several functions changed with declared goals libmysqld/embedded_priv.h: libmysqld.c <--> lib_sql.cc interface moved here libmysqld/lib_sql.cc: all embedded 'virtual' functions moved here so they can be static libmysqld/libmysqld.c: embedded 'virtual' function was moved out of here sql-common/client.c: several changes with the declared goal sql/sql_class.h: place to store statement data added to THD sql/sql_prepare.cc: storing of prepare_statement result for embedded server added
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 4d1318151b3..b3ddd64e111 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1139,8 +1139,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
/* Read all rows (fields or data) from server */
-MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
- uint fields)
+MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
+ uint fields)
{
uint field;
ulong pkt_len;
@@ -1150,7 +1150,7 @@ MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
MYSQL_DATA *result;
MYSQL_ROWS **prev_ptr,*cur;
NET *net = &mysql->net;
- DBUG_ENTER("read_rows");
+ DBUG_ENTER("cli_read_rows");
if ((pkt_len= net_safe_read(mysql)) == packet_error)
DBUG_RETURN(0);
@@ -1397,14 +1397,13 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
*/
static my_bool STDCALL cli_mysql_read_query_result(MYSQL *mysql);
-static MYSQL_RES * STDCALL cli_mysql_store_result(MYSQL *mysql);
static MYSQL_RES * STDCALL cli_mysql_use_result(MYSQL *mysql);
static MYSQL_METHODS client_methods=
{
cli_mysql_read_query_result,
cli_advanced_command,
- cli_mysql_store_result,
+ cli_read_rows,
cli_mysql_use_result,
cli_fetch_lengths,
cli_list_fields,
@@ -2265,7 +2264,8 @@ get_info:
mysql->extra_info= net_field_length_ll(&pos); /* Maybe number of rec */
- if (!(fields=read_rows(mysql,(MYSQL_FIELD*)0,protocol_41(mysql) ? 7 : 5)))
+ if (!(fields=(*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,
+ protocol_41(mysql) ? 7 : 5)))
DBUG_RETURN(1);
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,
(uint) field_count,0,
@@ -2327,7 +2327,7 @@ mysql_real_query(MYSQL *mysql, const char *query, ulong length)
mysql_data_seek may be used.
**************************************************************************/
-static MYSQL_RES * STDCALL cli_mysql_store_result(MYSQL *mysql)
+MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
{
MYSQL_RES *result;
DBUG_ENTER("mysql_store_result");
@@ -2356,7 +2356,8 @@ static MYSQL_RES * STDCALL cli_mysql_store_result(MYSQL *mysql)
result->methods= mysql->methods;
result->eof=1; /* Marker for buffered */
result->lengths=(ulong*) (result+1);
- if (!(result->data=read_rows(mysql,mysql->fields,mysql->field_count)))
+ if (!(result->data=
+ (*mysql->methods->read_rows)(mysql,mysql->fields,mysql->field_count)))
{
my_free((gptr) result,MYF(0));
DBUG_RETURN(0);