summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorhf@deer.(none) <>2003-09-16 16:06:25 +0500
committerhf@deer.(none) <>2003-09-16 16:06:25 +0500
commitbf017a2eb02db66afc70b8b03288f6e30d1907f2 (patch)
treee38da8c154875ca2ff180275d93d7dfa211f0f14 /sql-common
parente63e2229b600926c1792e4e7ca56112dcb1d28bb (diff)
downloadmariadb-git-bf017a2eb02db66afc70b8b03288f6e30d1907f2.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
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);