5858#endif
5959
6060#include <sql_common.h>
61+ #include "client_settings.h"
62+
63+ #ifdef EMBEDDED_LIBRARY
64+ #ifdef net_flush
65+ #undef net_flush
66+ #endif
67+
68+ my_bool net_flush (NET * net );
69+
70+ #endif
71+
6172
6273uint mysql_port = 0 ;
6374my_string mysql_unix_port = 0 ;
64- ulong net_buffer_length = 8192 ;
65- ulong max_allowed_packet = 1024L * 1024L * 1024L ;
66- ulong net_read_timeout = NET_READ_TIMEOUT ;
67- ulong net_write_timeout = NET_WRITE_TIMEOUT ;
6875
6976#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG \
7077 | CLIENT_LOCAL_FILES | CLIENT_TRANSACTIONS \
@@ -101,8 +108,9 @@ sig_handler pipe_sig_handler(int sig);
101108static ulong mysql_sub_escape_string (CHARSET_INFO * charset_info , char * to ,
102109 const char * from , ulong length );
103110my_bool stmt_close (MYSQL_STMT * stmt , my_bool skip_list );
104- static my_bool org_my_init_done = 0 ;
111+ my_bool org_my_init_done = 0 ;
105112
113+ #ifndef EMBEDDED_LIBRARY
106114int STDCALL mysql_server_init (int argc __attribute__((unused )),
107115 char * * argv __attribute__((unused )),
108116 char * * groups __attribute__((unused )))
@@ -119,6 +127,7 @@ void STDCALL mysql_server_end()
119127 else
120128 mysql_thread_end ();
121129}
130+ #endif /*EMBEDDED_LIBRARY*/
122131
123132my_bool STDCALL mysql_thread_init ()
124133{
@@ -140,17 +149,6 @@ void STDCALL mysql_thread_end()
140149 Let the user specify that we don't want SIGPIPE; This doesn't however work
141150 with threaded applications as we can have multiple read in progress.
142151*/
143-
144- #if !defined(__WIN__ ) && defined(SIGPIPE ) && !defined(THREAD )
145- #define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0
146- #define set_sigpipe (mysql ) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE,pipe_sig_handler)
147- #define reset_sigpipe (mysql ) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
148- #else
149- #define init_sigpipe_variables
150- #define set_sigpipe (mysql )
151- #define reset_sigpipe (mysql )
152- #endif
153-
154152static MYSQL * spawn_init (MYSQL * parent , const char * host ,
155153 unsigned int port ,
156154 const char * user ,
@@ -846,8 +844,7 @@ STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
846844 have to wait for the client (and will not wait more than 30 sec/packet).
847845**************************************************************************/
848846
849- MYSQL_RES * STDCALL
850- mysql_use_result (MYSQL * mysql )
847+ MYSQL_RES * STDCALL CLI_MYSQL_USE_RESULT (MYSQL * mysql )
851848{
852849 MYSQL_RES * result ;
853850 DBUG_ENTER ("mysql_use_result" );
@@ -1253,19 +1250,6 @@ uint STDCALL mysql_thread_safe(void)
12531250 Some support functions
12541251****************************************************************************/
12551252
1256- /*
1257- Functions called my my_net_init() to set some application specific variables
1258- */
1259-
1260- void my_net_local_init (NET * net )
1261- {
1262- net -> max_packet = (uint ) net_buffer_length ;
1263- net -> read_timeout = (uint ) net_read_timeout ;
1264- net -> write_timeout = (uint ) net_write_timeout ;
1265- net -> retry_count = 1 ;
1266- net -> max_packet_size = max (net_buffer_length , max_allowed_packet );
1267- }
1268-
12691253/*
12701254 Add escape characters to a string (blob?) to make it suitable for a insert
12711255 to should at least have place for length*2+1 chars
@@ -1999,8 +1983,9 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
19991983
20001984 mysql -> last_used_con = mysql ;
20011985 int4store (buff , stmt -> stmt_id ); /* Send stmt id to server */
2002- if (advanced_command (mysql , COM_EXECUTE , buff , MYSQL_STMT_HEADER , packet ,
2003- length , 1 ) ||
1986+ if ((* mysql -> methods -> advanced_command )(mysql , COM_EXECUTE , buff ,
1987+ MYSQL_STMT_HEADER , packet ,
1988+ length , 1 ) ||
20041989 mysql_read_query_result (mysql ))
20051990 {
20061991 set_stmt_errmsg (stmt , net -> last_error , net -> last_errno , net -> sqlstate );
@@ -2292,8 +2277,9 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
22922277 Note that we don't get any ok packet from the server in this case
22932278 This is intentional to save bandwidth.
22942279 */
2295- if (advanced_command (mysql , COM_LONG_DATA , extra_data ,
2296- MYSQL_LONG_DATA_HEADER , data , length , 1 ))
2280+ if ((* mysql -> methods -> advanced_command )(mysql , COM_LONG_DATA , extra_data ,
2281+ MYSQL_LONG_DATA_HEADER , data ,
2282+ length , 1 ))
22972283 {
22982284 set_stmt_errmsg (stmt , mysql -> net .last_error ,
22992285 mysql -> net .last_errno , mysql -> net .sqlstate );
0 commit comments