mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Resolving conflicts
BitKeeper/etc/logging_ok: auto-union client/mysqltest.c: Auto merged sql-common/client.c: Auto merged sql/protocol.cc: Auto merged sql/sql_client.cc: Auto merged include/mysql.h: Merging (prolly it's the mistake) libmysqld/libmysqld.c: This code seems to be unnecessary
This commit is contained in:
@ -14,12 +14,13 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
extern uint mysql_port;
|
||||
extern my_string mysql_unix_port;
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
|
||||
CLIENT_LOCAL_FILES | CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
|
||||
|
||||
|
||||
sig_handler pipe_sig_handler(int sig __attribute__((unused)));
|
||||
my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list);
|
||||
void read_user_name(char *name);
|
||||
@ -39,3 +40,4 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename);
|
||||
#define set_sigpipe(mysql)
|
||||
#define reset_sigpipe(mysql)
|
||||
#endif
|
||||
|
||||
|
@ -58,11 +58,12 @@
|
||||
#endif
|
||||
|
||||
#include <sql_common.h>
|
||||
#include "client_settings.h"
|
||||
|
||||
ulong net_buffer_length=8192;
|
||||
ulong max_allowed_packet= 1024L*1024L*1024L;
|
||||
ulong net_read_timeout= NET_READ_TIMEOUT;
|
||||
ulong net_write_timeout= NET_WRITE_TIMEOUT;
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
#undef net_flush
|
||||
my_bool net_flush(NET *net);
|
||||
#endif
|
||||
|
||||
#if defined(MSDOS) || defined(__WIN__)
|
||||
/* socket_errno is defined in my_global.h for all platforms */
|
||||
@ -85,19 +86,6 @@ static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to,
|
||||
const char *from, ulong length);
|
||||
my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list);
|
||||
|
||||
/*
|
||||
Initialize the MySQL library
|
||||
|
||||
SYNOPSIS
|
||||
mysql_once_init()
|
||||
|
||||
NOTES
|
||||
Can't be static on NetWare
|
||||
This function is called by mysql_init() and indirectly called
|
||||
by mysql_real_query(), so one should never have to call this from an
|
||||
outside program.
|
||||
*/
|
||||
|
||||
static my_bool mysql_client_init= 0;
|
||||
static my_bool org_my_init_done= 0;
|
||||
|
||||
@ -145,7 +133,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)))
|
||||
@ -162,6 +150,7 @@ void STDCALL mysql_server_end()
|
||||
else
|
||||
mysql_thread_end();
|
||||
}
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
|
||||
my_bool STDCALL mysql_thread_init()
|
||||
{
|
||||
@ -183,17 +172,6 @@ void STDCALL mysql_thread_end()
|
||||
Let the user specify that we don't want SIGPIPE; This doesn't however work
|
||||
with threaded applications as we can have multiple read in progress.
|
||||
*/
|
||||
|
||||
#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD)
|
||||
#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0
|
||||
#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE,pipe_sig_handler)
|
||||
#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
|
||||
#else
|
||||
#define init_sigpipe_variables
|
||||
#define set_sigpipe(mysql)
|
||||
#define reset_sigpipe(mysql)
|
||||
#endif
|
||||
|
||||
static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
@ -856,7 +834,6 @@ STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Return next field of the query results
|
||||
**************************************************************************/
|
||||
@ -1248,19 +1225,6 @@ uint STDCALL mysql_thread_safe(void)
|
||||
Some support functions
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
Functions called my my_net_init() to set some application specific variables
|
||||
*/
|
||||
|
||||
void my_net_local_init(NET *net)
|
||||
{
|
||||
net->max_packet= (uint) net_buffer_length;
|
||||
net->read_timeout= (uint) net_read_timeout;
|
||||
net->write_timeout=(uint) net_write_timeout;
|
||||
net->retry_count= 1;
|
||||
net->max_packet_size= max(net_buffer_length, max_allowed_packet);
|
||||
}
|
||||
|
||||
/*
|
||||
Add escape characters to a string (blob?) to make it suitable for a insert
|
||||
to should at least have place for length*2+1 chars
|
||||
@ -1762,39 +1726,6 @@ static void store_param_type(NET *net, uint type)
|
||||
net->write_pos+=2;
|
||||
}
|
||||
|
||||
/*
|
||||
Store the length of parameter data
|
||||
(Same function as in sql/net_pkg.cc)
|
||||
*/
|
||||
|
||||
char *
|
||||
net_store_length(char *pkg, ulong length)
|
||||
{
|
||||
uchar *packet=(uchar*) pkg;
|
||||
if (length < 251)
|
||||
{
|
||||
*packet=(uchar) length;
|
||||
return (char*) packet+1;
|
||||
}
|
||||
/* 251 is reserved for NULL */
|
||||
if (length < 65536L)
|
||||
{
|
||||
*packet++=252;
|
||||
int2store(packet,(uint) length);
|
||||
return (char*) packet+2;
|
||||
}
|
||||
if (length < 16777216L)
|
||||
{
|
||||
*packet++=253;
|
||||
int3store(packet,(ulong) length);
|
||||
return (char*) packet+3;
|
||||
}
|
||||
*packet++=254;
|
||||
int8store(packet, (ulonglong) length);
|
||||
return (char*) packet+9;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Functions to store parameter data from a prepared statement.
|
||||
|
||||
@ -1994,8 +1925,9 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
|
||||
|
||||
mysql->last_used_con= mysql;
|
||||
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
|
||||
if (advanced_command(mysql, COM_EXECUTE, buff, MYSQL_STMT_HEADER, packet,
|
||||
length, 1) ||
|
||||
if ((*mysql->methods->advanced_command)(mysql, COM_EXECUTE, buff,
|
||||
MYSQL_STMT_HEADER, packet,
|
||||
length, 1) ||
|
||||
mysql_read_query_result(mysql))
|
||||
{
|
||||
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
|
||||
@ -2287,8 +2219,9 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
Note that we don't get any ok packet from the server in this case
|
||||
This is intentional to save bandwidth.
|
||||
*/
|
||||
if (advanced_command(mysql, COM_LONG_DATA, extra_data,
|
||||
MYSQL_LONG_DATA_HEADER, data, length, 1))
|
||||
if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, extra_data,
|
||||
MYSQL_LONG_DATA_HEADER, data,
|
||||
length, 1))
|
||||
{
|
||||
set_stmt_errmsg(stmt, mysql->net.last_error,
|
||||
mysql->net.last_errno, mysql->net.sqlstate);
|
||||
|
Reference in New Issue
Block a user