diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index d4e8be84c48..43f341c7b1c 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -41,7 +41,3 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename); #define reset_sigpipe(mysql) #endif -#define CLI_MYSQL_USE_RESULT cli_mysql_use_result - -MYSQL_RES * STDCALL cli_mysql_use_result(MYSQL *mysql); - diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e380ceb2d19..495647bf302 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -69,10 +69,6 @@ my_bool net_flush(NET *net); #endif - -uint mysql_port=0; -my_string mysql_unix_port=0; - #if defined(MSDOS) || defined(__WIN__) /* socket_errno is defined in my_global.h for all platforms */ #define perror(A) @@ -141,6 +137,7 @@ void mysql_once_init(void) #endif } +#ifndef EMBEDDED_LIBRARY int STDCALL mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused))) @@ -841,54 +838,6 @@ STDCALL mysql_add_slave(MYSQL* mysql, const char* host, return 0; } -/************************************************************************** - Alloc struct for use with unbuffered reads. Data is fetched by domand - when calling to mysql_fetch_row. - mysql_data_seek is a noop. - - No other queries may be specified with the same MYSQL handle. - There shouldn't be much processing per row because mysql server shouldn't - have to wait for the client (and will not wait more than 30 sec/packet). -**************************************************************************/ - -MYSQL_RES * STDCALL CLI_MYSQL_USE_RESULT(MYSQL *mysql) -{ - MYSQL_RES *result; - DBUG_ENTER("mysql_use_result"); - - mysql = mysql->last_used_con; - - if (!mysql->fields) - DBUG_RETURN(0); - if (mysql->status != MYSQL_STATUS_GET_RESULT) - { - strmov(mysql->net.sqlstate, unknown_sqlstate); - strmov(mysql->net.last_error, - ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC)); - DBUG_RETURN(0); - } - if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result)+ - sizeof(ulong)*mysql->field_count, - MYF(MY_WME | MY_ZEROFILL)))) - DBUG_RETURN(0); - result->lengths=(ulong*) (result+1); - if (!(result->row=(MYSQL_ROW) - my_malloc(sizeof(result->row[0])*(mysql->field_count+1), MYF(MY_WME)))) - { /* Ptrs: to one row */ - my_free((gptr) result,MYF(0)); - DBUG_RETURN(0); - } - result->fields= mysql->fields; - result->field_alloc= mysql->field_alloc; - result->field_count= mysql->field_count; - result->current_field=0; - result->handle= mysql; - result->current_row= 0; - mysql->fields=0; /* fields is now in result */ - mysql->status=MYSQL_STATUS_USE_RESULT; - DBUG_RETURN(result); /* Data is read to be fetched */ -} - /************************************************************************** Return next field of the query results **************************************************************************/ diff --git a/sql-common/client.c b/sql-common/client.c index b70aed2d2c2..7d82ff0d209 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -60,10 +60,6 @@ my_bool net_flush(NET *net); #define CLI_MYSQL_REAL_CONNECT mysql_real_connect #endif /*EMBEDDED_LIBRARY*/ -#ifdef MYSQL_CLIENT -static my_bool mysql_client_init=0; -#endif - #if !defined(MYSQL_SERVER) && (defined(__WIN__) || defined(_WIN32) || defined(_WIN64)) #include @@ -1441,6 +1437,7 @@ error: static void STDCALL cli_mysql_close(MYSQL *mysql); 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= { @@ -1448,7 +1445,7 @@ static MYSQL_METHODS client_methods= cli_mysql_read_query_result, cli_advanced_command, cli_mysql_store_result, - CLI_MYSQL_USE_RESULT + cli_mysql_use_result }; MYSQL * STDCALL @@ -2378,8 +2375,7 @@ static MYSQL_RES * STDCALL cli_mysql_store_result(MYSQL *mysql) have to wait for the client (and will not wait more than 30 sec/packet). **************************************************************************/ -MYSQL_RES * STDCALL -mysql_use_result(MYSQL *mysql) +static MYSQL_RES * STDCALL cli_mysql_use_result(MYSQL *mysql) { MYSQL_RES *result; DBUG_ENTER("mysql_use_result"); diff --git a/sql/client_settings.h b/sql/client_settings.h index 5a16fdd1c2f..b357e52ec9d 100644 --- a/sql/client_settings.h +++ b/sql/client_settings.h @@ -30,6 +30,5 @@ #define mysql_slave_send_query(A, B, C) 1 #define mysql_rpl_probe(mysql) 0 #undef HAVE_SMEM -#define CLI_MYSQL_USE_RESULT NULL #undef _CUSTOMCONFIG_ diff --git a/sql/sql_client.cc b/sql/sql_client.cc index 464596f0734..a6a8a6305ed 100644 --- a/sql/sql_client.cc +++ b/sql/sql_client.cc @@ -20,6 +20,7 @@ #include +#ifdef CLEAN_DUP /* Function called by my_net_init() to set some check variables */ @@ -37,6 +38,7 @@ void my_net_local_init(NET *net) #endif } } +#endif /*CLEAN_DUP*/ extern "C" { void mysql_once_init(void)