mirror of
https://github.com/MariaDB/server.git
synced 2025-07-24 19:42:23 +03:00
After merge fixes
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
extern const char *unknown_sqlstate;
|
extern const char *unknown_sqlstate;
|
||||||
|
extern const char *not_error_sqlstate;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -33,7 +33,6 @@ bin_SCRIPTS = @server_scripts@ \
|
|||||||
mysql_explain_log \
|
mysql_explain_log \
|
||||||
mysql_tableinfo \
|
mysql_tableinfo \
|
||||||
mysqld_multi \
|
mysqld_multi \
|
||||||
fill_help_tables \
|
|
||||||
mysql_create_system_tables
|
mysql_create_system_tables
|
||||||
|
|
||||||
EXTRA_SCRIPTS = make_binary_distribution.sh \
|
EXTRA_SCRIPTS = make_binary_distribution.sh \
|
||||||
@ -140,5 +139,7 @@ SUFFIXES = .sh
|
|||||||
# Don't update the files from bitkeeper
|
# Don't update the files from bitkeeper
|
||||||
%::SCCS/s.%
|
%::SCCS/s.%
|
||||||
|
|
||||||
all: make_win_src_distribution make_binary_distribution
|
all: fill_help_tables.sql make_win_src_distribution make_binary_distribution
|
||||||
|
|
||||||
|
fill_help_tables.sql: fill_help_tables ../Docs/manual.texi
|
||||||
|
./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql
|
||||||
|
@ -99,7 +99,8 @@
|
|||||||
#include "client_settings.h"
|
#include "client_settings.h"
|
||||||
#include <sql_common.h>
|
#include <sql_common.h>
|
||||||
|
|
||||||
const char *unknown_sqlstate= "000000";
|
const char *unknown_sqlstate= "HY0000";
|
||||||
|
const char *not_error_sqlstate= "00000";
|
||||||
|
|
||||||
#ifdef MYSQL_CLIENT
|
#ifdef MYSQL_CLIENT
|
||||||
extern my_bool stmt_close(MYSQL_STMT *stmt,my_bool skip_list);
|
extern my_bool stmt_close(MYSQL_STMT *stmt,my_bool skip_list);
|
||||||
@ -339,10 +340,10 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
The name of event and file-mapping events create agree next rule:
|
The name of event and file-mapping events create agree next rule:
|
||||||
shared_memory_base_name+unique_part
|
shared_memory_base_name+unique_part
|
||||||
Where:
|
Where:
|
||||||
shared_memory_base_name is unique value for each server
|
shared_memory_base_name is unique value for each server
|
||||||
unique_part is uniquel value for each object (events and file-mapping)
|
unique_part is uniquel value for each object (events and file-mapping)
|
||||||
*/
|
*/
|
||||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS);
|
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS);
|
||||||
strmov(suffix_pos, "CONNECT_REQUEST");
|
strmov(suffix_pos, "CONNECT_REQUEST");
|
||||||
@ -369,36 +370,34 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
|
|||||||
error_allow = CR_SHARED_MEMORY_CONNECT_MAP_ERROR;
|
error_allow = CR_SHARED_MEMORY_CONNECT_MAP_ERROR;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Send to server request of connection
|
/* Send to server request of connection */
|
||||||
*/
|
|
||||||
if (!SetEvent(event_connect_request))
|
if (!SetEvent(event_connect_request))
|
||||||
{
|
{
|
||||||
error_allow = CR_SHARED_MEMORY_CONNECT_SET_ERROR;
|
error_allow = CR_SHARED_MEMORY_CONNECT_SET_ERROR;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Wait of answer from server
|
/* Wait of answer from server */
|
||||||
*/
|
|
||||||
if (WaitForSingleObject(event_connect_answer,connect_timeout*1000) !=
|
if (WaitForSingleObject(event_connect_answer,connect_timeout*1000) !=
|
||||||
WAIT_OBJECT_0)
|
WAIT_OBJECT_0)
|
||||||
{
|
{
|
||||||
error_allow = CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR;
|
error_allow = CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Get number of connection
|
/* Get number of connection */
|
||||||
*/
|
|
||||||
connect_number = uint4korr(handle_connect_map);/*WAX2*/
|
connect_number = uint4korr(handle_connect_map);/*WAX2*/
|
||||||
p= int2str(connect_number, connect_number_char, 10);
|
p= int2str(connect_number, connect_number_char, 10);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The name of event and file-mapping events create agree next rule:
|
The name of event and file-mapping events create agree next rule:
|
||||||
shared_memory_base_name+unique_part+number_of_connection
|
shared_memory_base_name+unique_part+number_of_connection
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
shared_memory_base_name is uniquel value for each server
|
shared_memory_base_name is uniquel value for each server
|
||||||
unique_part is uniquel value for each object (events and file-mapping)
|
unique_part is uniquel value for each object (events and file-mapping)
|
||||||
number_of_connection is number of connection between server and client
|
number_of_connection is number of connection between server and client
|
||||||
*/
|
*/
|
||||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
|
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
|
||||||
"_",NullS);
|
"_",NullS);
|
||||||
@ -506,7 +505,7 @@ net_safe_read(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
NET *net= &mysql->net;
|
NET *net= &mysql->net;
|
||||||
ulong len=0;
|
ulong len=0;
|
||||||
init_sigpipe_variables
|
init_sigpipe_variables;
|
||||||
|
|
||||||
/* Don't give sigpipe errors if the client doesn't want them */
|
/* Don't give sigpipe errors if the client doesn't want them */
|
||||||
set_sigpipe(mysql);
|
set_sigpipe(mysql);
|
||||||
@ -571,7 +570,7 @@ advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
{
|
{
|
||||||
NET *net= &mysql->net;
|
NET *net= &mysql->net;
|
||||||
my_bool result= 1;
|
my_bool result= 1;
|
||||||
init_sigpipe_variables
|
init_sigpipe_variables;
|
||||||
|
|
||||||
/* Don't give sigpipe errors if the client doesn't want them */
|
/* Don't give sigpipe errors if the client doesn't want them */
|
||||||
set_sigpipe(mysql);
|
set_sigpipe(mysql);
|
||||||
@ -589,8 +588,8 @@ advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
}
|
}
|
||||||
|
|
||||||
net->last_error[0]=0;
|
net->last_error[0]=0;
|
||||||
net->last_errno=0;
|
net->last_errno= 0;
|
||||||
strmov(net->sqlstate, unknown_sqlstate);
|
strmov(net->sqlstate, not_error_sqlstate);
|
||||||
mysql->net.report_error=0;
|
mysql->net.report_error=0;
|
||||||
mysql->info=0;
|
mysql->info=0;
|
||||||
mysql->affected_rows= ~(my_ulonglong) 0;
|
mysql->affected_rows= ~(my_ulonglong) 0;
|
||||||
@ -624,7 +623,7 @@ advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
if (!skip_check)
|
if (!skip_check)
|
||||||
result= ((mysql->packet_length=net_safe_read(mysql)) == packet_error ?
|
result= ((mysql->packet_length=net_safe_read(mysql)) == packet_error ?
|
||||||
1 : 0);
|
1 : 0);
|
||||||
end:
|
end:
|
||||||
reset_sigpipe(mysql);
|
reset_sigpipe(mysql);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -665,7 +664,7 @@ void end_server(MYSQL *mysql)
|
|||||||
DBUG_ENTER("end_server");
|
DBUG_ENTER("end_server");
|
||||||
if (mysql->net.vio != 0)
|
if (mysql->net.vio != 0)
|
||||||
{
|
{
|
||||||
init_sigpipe_variables
|
init_sigpipe_variables;
|
||||||
DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
|
DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
|
||||||
set_sigpipe(mysql);
|
set_sigpipe(mysql);
|
||||||
vio_delete(mysql->net.vio);
|
vio_delete(mysql->net.vio);
|
||||||
@ -1457,7 +1456,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||||||
#ifdef HAVE_SYS_UN_H
|
#ifdef HAVE_SYS_UN_H
|
||||||
struct sockaddr_un UNIXaddr;
|
struct sockaddr_un UNIXaddr;
|
||||||
#endif
|
#endif
|
||||||
init_sigpipe_variables
|
init_sigpipe_variables;
|
||||||
DBUG_ENTER("mysql_real_connect");
|
DBUG_ENTER("mysql_real_connect");
|
||||||
LINT_INIT(host_info);
|
LINT_INIT(host_info);
|
||||||
|
|
||||||
@ -1561,7 +1560,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||||||
net->vio = vio_new(sock, VIO_TYPE_SOCKET, TRUE);
|
net->vio = vio_new(sock, VIO_TYPE_SOCKET, TRUE);
|
||||||
bzero((char*) &UNIXaddr,sizeof(UNIXaddr));
|
bzero((char*) &UNIXaddr,sizeof(UNIXaddr));
|
||||||
UNIXaddr.sun_family = AF_UNIX;
|
UNIXaddr.sun_family = AF_UNIX;
|
||||||
strmov(UNIXaddr.sun_path, unix_socket);
|
strmake(UNIXaddr.sun_path, unix_socket, sizeof(UNIXaddr.sun_path)-1);
|
||||||
if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr),
|
if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr),
|
||||||
mysql->options.connect_timeout))
|
mysql->options.connect_timeout))
|
||||||
{
|
{
|
||||||
@ -2090,15 +2089,16 @@ static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql)
|
|||||||
#endif /*MYSQL_CLIENT*/
|
#endif /*MYSQL_CLIENT*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my_bool mysql_reconnect(MYSQL *mysql)
|
my_bool mysql_reconnect(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
MYSQL tmp_mysql;
|
MYSQL tmp_mysql;
|
||||||
DBUG_ENTER("mysql_reconnect");
|
DBUG_ENTER("mysql_reconnect");
|
||||||
|
|
||||||
if (!mysql->reconnect
|
if (!mysql->reconnect ||
|
||||||
|| (mysql->server_status & SERVER_STATUS_IN_TRANS) || !mysql->host_info)
|
(mysql->server_status & SERVER_STATUS_IN_TRANS) || !mysql->host_info)
|
||||||
{
|
{
|
||||||
/* Allow reconnect next time */
|
/* Allow reconnect next time */
|
||||||
mysql->server_status&= ~SERVER_STATUS_IN_TRANS;
|
mysql->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||||
strmov(mysql->net.sqlstate, unknown_sqlstate);
|
strmov(mysql->net.sqlstate, unknown_sqlstate);
|
||||||
mysql->net.last_errno=CR_SERVER_GONE_ERROR;
|
mysql->net.last_errno=CR_SERVER_GONE_ERROR;
|
||||||
|
Reference in New Issue
Block a user