Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2fb4a502
Commit
2fb4a502
authored
Dec 09, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.0-clean
parents
eed23437
a5286aa9
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
63 additions
and
1 deletion
+63
-1
VC++Files/libmysqltest/mytest.c
VC++Files/libmysqltest/mytest.c
+1
-0
VC++Files/mysqlmanager/mysqlmanagerview.cpp
VC++Files/mysqlmanager/mysqlmanagerview.cpp
+5
-0
VC++Files/test1/mysql_thr.c
VC++Files/test1/mysql_thr.c
+1
-0
VC++Files/winmysqladmin/main.cpp
VC++Files/winmysqladmin/main.cpp
+2
-0
client/mysql.cc
client/mysql.cc
+2
-0
client/mysqladmin.cc
client/mysqladmin.cc
+1
-0
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+1
-0
client/mysqlcheck.c
client/mysqlcheck.c
+1
-0
client/mysqlimport.c
client/mysqlimport.c
+1
-0
client/mysqlshow.c
client/mysqlshow.c
+1
-0
client/mysqltest.c
client/mysqltest.c
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+4
-0
libmysqld/examples/builder-sample/emb_samples.cpp
libmysqld/examples/builder-sample/emb_samples.cpp
+1
-0
ndb/test/ndbapi/flex_bench_mysql.cpp
ndb/test/ndbapi/flex_bench_mysql.cpp
+2
-0
ndb/tools/restore/consumer_restorem.cpp
ndb/tools/restore/consumer_restorem.cpp
+1
-0
sql-common/client.c
sql-common/client.c
+18
-1
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+1
-0
sql/slave.cc
sql/slave.cc
+1
-0
tests/client_test.c
tests/client_test.c
+7
-0
tests/connect_test.c
tests/connect_test.c
+1
-0
tests/deadlock_test.c
tests/deadlock_test.c
+1
-0
tests/insert_test.c
tests/insert_test.c
+1
-0
tests/list_test.c
tests/list_test.c
+1
-0
tests/select_test.c
tests/select_test.c
+1
-0
tests/showdb_test.c
tests/showdb_test.c
+1
-0
tests/ssl_test.c
tests/ssl_test.c
+1
-0
tests/thread_test.c
tests/thread_test.c
+1
-0
tools/mysqlmanager.c
tools/mysqlmanager.c
+3
-0
No files found.
VC++Files/libmysqltest/mytest.c
View file @
2fb4a502
...
...
@@ -91,6 +91,7 @@ main( int argc, char * argv[] )
mysql_real_connect
(
myData
,
NULL
,
NULL
,
NULL
,
NULL
,
MYSQL_PORT
,
NULL
,
0
)
)
{
myData
->
reconnect
=
1
;
if
(
mysql_select_db
(
myData
,
szDB
)
<
0
)
{
printf
(
"Can't select the %s database !
\n
"
,
szDB
)
;
mysql_close
(
myData
)
;
...
...
VC++Files/mysqlmanager/mysqlmanagerview.cpp
View file @
2fb4a502
...
...
@@ -551,6 +551,7 @@ void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
PostMessage
(
WM_COMMAND
,
IDM_TOOLS_SERVER_PROPERTIES
);
return
;
}
mysql
.
reconnect
=
1
;
if
(
!
(
result
=
mysql_list_processes
(
&
mysql
)))
{
return
;
...
...
@@ -576,6 +577,7 @@ void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
);
return
;
}
mysql
.
reconnect
=
1
;
if
(
!
(
result
=
mysql_list_dbs
(
&
mysql
,
0
)))
{
}
...
...
@@ -603,6 +605,7 @@ void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
);
return
;
}
mysql
.
reconnect
=
1
;
CResourceDatabase
*
pRes
=
(
CResourceDatabase
*
)
pResource
;
CString
strDB
=
pResource
->
GetDisplayName
();
strDB
.
TrimRight
();
...
...
@@ -641,6 +644,7 @@ void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
);
return
;
}
mysql
.
reconnect
=
1
;
HTREEITEM
hParent
=
m_pTree
->
GetParentItem
(
hItem
);
memset
(
&
item
,
0
,
sizeof
(
TV_ITEM
)
);
item
.
hItem
=
hParent
;
...
...
@@ -714,6 +718,7 @@ void CMySqlManagerView::OnRefresh()
{
return
;
}
mysql
.
reconnect
=
1
;
memset
(
&
item
,
0
,
sizeof
(
TV_ITEM
)
);
item
.
hItem
=
hParent
;
item
.
mask
=
TVIF_TEXT
|
TVIF_HANDLE
|
TVIF_CHILDREN
|
TVIF_PARAM
;
...
...
VC++Files/test1/mysql_thr.c
View file @
2fb4a502
...
...
@@ -167,6 +167,7 @@ pthread_handler_decl(test_thread,arg)
perror
(
""
);
goto
end
;
}
mysql
.
reconnect
=
1
;
if
(
mysql_query
(
&
mysql
,
"select 1"
)
<
0
)
{
fprintf
(
stderr
,
"Query failed (%s)
\n
"
,
mysql_error
(
&
mysql
));
...
...
VC++Files/winmysqladmin/main.cpp
View file @
2fb4a502
...
...
@@ -1337,6 +1337,7 @@ void __fastcall TForm1::IsMySQLInit(void)
}
}
MySQL
->
reconnect
=
1
;
}
...
...
@@ -1348,6 +1349,7 @@ void __fastcall TForm1::IsMySQLInit(void)
MySQL
=
mysql_init
(
MySQL
);
if
(
mysql_real_connect
(
MySQL
,
host
,
user
,
password
,
0
,
0
,
NULL
,
0
))
IsConnect
=
true
;
MySQL
->
reconnect
=
1
;
}
}
}
...
...
client/mysql.cc
View file @
2fb4a502
...
...
@@ -2792,6 +2792,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
connected
=
1
;
#ifndef EMBEDDED_LIBRARY
mysql
.
reconnect
=
info_flag
?
1
:
0
;
// We want to know if this happens
#else
mysql
.
reconnect
=
1
;
#endif
#ifdef HAVE_READLINE
build_completion_hash
(
rehash
,
1
);
...
...
client/mysqladmin.cc
View file @
2fb4a502
...
...
@@ -425,6 +425,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
if
(
mysql_real_connect
(
mysql
,
host
,
user
,
opt_password
,
NullS
,
tcp_port
,
unix_port
,
0
))
{
mysql
->
reconnect
=
1
;
if
(
info
)
{
fputs
(
"
\n
"
,
stderr
);
...
...
client/mysqlbinlog.cc
View file @
2fb4a502
...
...
@@ -753,6 +753,7 @@ static MYSQL* safe_connect()
mysql_options
(
local_mysql
,
MYSQL_OPT_PROTOCOL
,
(
char
*
)
&
opt_protocol
);
if
(
!
mysql_real_connect
(
local_mysql
,
host
,
user
,
pass
,
0
,
port
,
sock
,
0
))
die
(
"failed on connect: %s"
,
mysql_error
(
local_mysql
));
local_mysql
->
reconnect
=
1
;
return
local_mysql
;
}
...
...
client/mysqlcheck.c
View file @
2fb4a502
...
...
@@ -628,6 +628,7 @@ static int dbConnect(char *host, char *user, char *passwd)
DBerror
(
&
mysql_connection
,
"when trying to connect"
);
return
1
;
}
mysql_connection
.
reconnect
=
1
;
return
0
;
}
/* dbConnect */
...
...
client/mysqlimport.c
View file @
2fb4a502
...
...
@@ -388,6 +388,7 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
ignore_errors
=
0
;
/* NO RETURN FROM db_error */
db_error
(
&
mysql_connection
);
}
mysql_connection
.
reconnect
=
0
;
if
(
verbose
)
fprintf
(
stdout
,
"Selecting database %s
\n
"
,
database
);
if
(
mysql_select_db
(
sock
,
database
))
...
...
client/mysqlshow.c
View file @
2fb4a502
...
...
@@ -125,6 +125,7 @@ int main(int argc, char **argv)
fprintf
(
stderr
,
"%s: %s
\n
"
,
my_progname
,
mysql_error
(
&
mysql
));
exit
(
1
);
}
mysql
.
reconnect
=
1
;
switch
(
argc
)
{
...
...
client/mysqltest.c
View file @
2fb4a502
...
...
@@ -1627,6 +1627,7 @@ int safe_connect(MYSQL* con, const char* host, const char* user,
}
sleep
(
CON_RETRY_SLEEP
);
}
con
->
reconnect
=
1
;
/* TODO: change this to 0 in future versions */
return
con_error
;
}
...
...
libmysql/libmysql.c
View file @
2fb4a502
...
...
@@ -317,6 +317,7 @@ my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
DBUG_ENTER
(
"mysql_master_send_query"
);
if
(
!
master
->
net
.
vio
&&
!
mysql_real_connect
(
master
,
0
,
0
,
0
,
0
,
0
,
0
,
0
))
DBUG_RETURN
(
1
);
master
->
reconnect
=
1
;
mysql
->
last_used_con
=
master
;
DBUG_RETURN
(
simple_command
(
master
,
COM_QUERY
,
q
,
length
,
1
));
}
...
...
@@ -351,6 +352,7 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
if
(
!
slave_to_use
->
net
.
vio
&&
!
mysql_real_connect
(
slave_to_use
,
0
,
0
,
0
,
0
,
0
,
0
,
0
))
DBUG_RETURN
(
1
);
slave_to_use
->
reconnect
=
1
;
DBUG_RETURN
(
simple_command
(
slave_to_use
,
COM_QUERY
,
q
,
length
,
1
));
}
...
...
@@ -448,6 +450,7 @@ static my_bool get_slaves_from_master(MYSQL* mysql)
expand_error
(
mysql
,
CR_PROBE_MASTER_CONNECT
);
DBUG_RETURN
(
1
);
}
mysql
->
reconnect
=
1
;
if
(
mysql_query
(
mysql
,
"SHOW SLAVE HOSTS"
)
||
!
(
res
=
mysql_store_result
(
mysql
)))
...
...
@@ -615,6 +618,7 @@ mysql_connect(MYSQL *mysql,const char *host,
if
(
mysql
->
free_me
)
my_free
((
gptr
)
mysql
,
MYF
(
0
));
}
mysql
->
reconnect
=
1
;
DBUG_RETURN
(
res
);
}
}
...
...
libmysqld/examples/builder-sample/emb_samples.cpp
View file @
2fb4a502
...
...
@@ -109,6 +109,7 @@ bool __fastcall TForm1::connect_server()
ret_value
=
true
;
is_server_started
=
true
;
}
MySQL
->
reconnect
=
1
;
return
ret_value
;
}
//---------------------------------------------------------------------------
...
...
ndb/test/ndbapi/flex_bench_mysql.cpp
View file @
2fb4a502
...
...
@@ -397,6 +397,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
ndbout
<<
"Connect failed"
<<
endl
;
returnValue
=
NDBT_FAILED
;
}
mysql
.
reconnect
=
1
;
}
if
(
returnValue
==
NDBT_OK
){
mysql_set_server_option
(
&
mysql
,
MYSQL_OPTION_MULTI_STATEMENTS_ON
);
...
...
@@ -712,6 +713,7 @@ static void* flexBenchThread(void* pArg)
ndbout
<<
"failed"
<<
endl
;
NdbThread_Exit
(
0
)
;
}
mysql
.
reconnect
=
1
;
ndbout
<<
"ok"
<<
endl
;
int
r
;
...
...
ndb/tools/restore/consumer_restorem.cpp
View file @
2fb4a502
...
...
@@ -80,6 +80,7 @@ BackupRestore::init()
ndbout_c
(
"Connect failed: %s"
,
mysql_error
(
&
mysql
));
returnValue
=
false
;
}
mysql
.
reconnect
=
1
;
ndbout
<<
"Connected to MySQL!!!"
<<
endl
;
}
...
...
sql-common/client.c
View file @
2fb4a502
...
...
@@ -1587,8 +1587,24 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
port
=
mysql
->
options
.
port
;
if
(
!
unix_socket
)
unix_socket
=
mysql
->
options
.
unix_socket
;
/*
By default we don't reconnect because it could silently corrupt data (after
reconnection you potentially lose table locks, user variables, session
variables (transactions but they are specifically dealt with in
mysql_reconnect()).
This is a change: < 5.0.3 mysql->reconnect was set to 1 by default.
How this change impacts existing apps:
- existing apps which relyed on the default will see a behaviour change;
they will have to set reconnect=1 after mysql_real_connect().
- existing apps which explicitely asked for reconnection (the only way they
could do it was by setting mysql.reconnect to 1 after mysql_real_connect())
will not see a behaviour change.
- existing apps which explicitely asked for no reconnection
(mysql.reconnect=0) will not see a behaviour change.
*/
mysql
->
reconnect
=
0
;
mysql
->
reconnect
=
1
;
/* Reconnect as default */
mysql
->
server_status
=
SERVER_STATUS_AUTOCOMMIT
;
/*
...
...
@@ -2161,6 +2177,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
strmov
(
mysql
->
net
.
sqlstate
,
tmp_mysql
.
net
.
sqlstate
);
DBUG_RETURN
(
1
);
}
tmp_mysql
.
reconnect
=
1
;
tmp_mysql
.
free_me
=
mysql
->
free_me
;
/* Don't free options as these are now used in tmp_mysql */
bzero
((
char
*
)
&
mysql
->
options
,
sizeof
(
mysql
->
options
));
...
...
sql/repl_failsafe.cc
View file @
2fb4a502
...
...
@@ -709,6 +709,7 @@ int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
if
(
!
mysql_real_connect
(
mysql
,
mi
->
host
,
mi
->
user
,
mi
->
password
,
0
,
mi
->
port
,
0
,
0
))
DBUG_RETURN
(
1
);
mysql
->
reconnect
=
1
;
DBUG_RETURN
(
0
);
}
...
...
sql/slave.cc
View file @
2fb4a502
...
...
@@ -4394,6 +4394,7 @@ replication resumed in log '%s' at position %s", mi->user,
thd
->
set_active_vio
(
mysql
->
net
.
vio
);
#endif
}
mysql
->
reconnect
=
1
;
DBUG_PRINT
(
"exit"
,(
"slave_was_killed: %d"
,
slave_was_killed
));
DBUG_RETURN
(
slave_was_killed
);
}
...
...
tests/client_test.c
View file @
2fb4a502
...
...
@@ -243,6 +243,7 @@ static void client_connect()
fprintf
(
stdout
,
"
\n
Check the connection options using --help or -?
\n
"
);
exit
(
1
);
}
mysql
->
reconnect
=
1
;
if
(
!
opt_silent
)
fprintf
(
stdout
,
" OK"
);
...
...
@@ -1057,6 +1058,7 @@ static my_bool thread_query(char *query)
error
=
1
;
goto
end
;
}
l_mysql
->
reconnect
=
1
;
if
(
mysql_query
(
l_mysql
,
(
char
*
)
query
))
{
fprintf
(
stderr
,
"Query failed (%s)
\n
"
,
mysql_error
(
l_mysql
));
...
...
@@ -4481,6 +4483,7 @@ static void test_stmt_close()
myerror
(
"connection failed"
);
exit
(
1
);
}
lmysql
->
reconnect
=
1
;
if
(
!
opt_silent
)
fprintf
(
stdout
,
" OK"
);
...
...
@@ -5372,6 +5375,7 @@ DROP TABLE IF EXISTS test_multi_tab";
fprintf
(
stdout
,
"
\n
connection failed(%s)"
,
mysql_error
(
mysql_local
));
exit
(
1
);
}
mysql_local
->
reconnect
=
1
;
rc
=
mysql_query
(
mysql_local
,
query
);
myquery
(
rc
);
...
...
@@ -5480,6 +5484,7 @@ static void test_prepare_multi_statements()
fprintf
(
stderr
,
"
\n
connection failed(%s)"
,
mysql_error
(
mysql_local
));
exit
(
1
);
}
mysql_local
->
reconnect
=
1
;
strmov
(
query
,
"select 1; select 'another value'"
);
stmt
=
mysql_simple_prepare
(
mysql_local
,
query
);
check_stmt_r
(
stmt
);
...
...
@@ -7012,6 +7017,7 @@ static void test_prepare_grant()
mysql_close
(
lmysql
);
exit
(
1
);
}
lmysql
->
reconnect
=
1
;
if
(
!
opt_silent
)
fprintf
(
stdout
,
" OK"
);
...
...
@@ -7457,6 +7463,7 @@ static void test_drop_temp()
mysql_close
(
lmysql
);
exit
(
1
);
}
lmysql
->
reconnect
=
1
;
if
(
!
opt_silent
)
fprintf
(
stdout
,
" OK"
);
...
...
tests/connect_test.c
View file @
2fb4a502
...
...
@@ -46,6 +46,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
sock
->
reconnect
=
1
;
if
(
mysql_select_db
(
sock
,
"test"
))
{
...
...
tests/deadlock_test.c
View file @
2fb4a502
...
...
@@ -227,6 +227,7 @@ int main()
!
mysql_real_connect
(
&
sel
,
host
,
user
,
pass
,
db
,
0
,
0
,
0
)
||
!
mysql_real_connect
(
&
del_ins
,
host
,
user
,
pass
,
db
,
0
,
0
,
0
))
die
(
"Error in mysql_real_connect(): %s"
,
mysql_error
(
&
lock
));
lock
.
reconnect
=
sel
.
reconnect
=
del_ins
.
reconnect
=
1
;
permute
(
order
,
num_queries
);
printf
(
"count = %d
\n
"
,
count
);
...
...
tests/insert_test.c
View file @
2fb4a502
...
...
@@ -40,6 +40,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
mysql
.
reconnect
=
1
;
num
=
atoi
(
argv
[
2
]);
count
=
0
;
...
...
tests/list_test.c
View file @
2fb4a502
...
...
@@ -43,6 +43,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
mysql
.
reconnect
=
1
;
if
(
mysql_select_db
(
sock
,
argv
[
1
])
<
0
)
{
...
...
tests/select_test.c
View file @
2fb4a502
...
...
@@ -44,6 +44,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
mysql
.
reconnect
=
1
;
count
=
0
;
num
=
atoi
(
argv
[
2
]);
...
...
tests/showdb_test.c
View file @
2fb4a502
...
...
@@ -45,6 +45,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
mysql
.
reconnect
=
1
;
count
=
0
;
num
=
atoi
(
argv
[
2
]);
...
...
tests/ssl_test.c
View file @
2fb4a502
...
...
@@ -51,6 +51,7 @@ int main(int argc, char **argv)
perror
(
""
);
exit
(
1
);
}
mysql
.
reconnect
=
1
;
count
=
0
;
num
=
atoi
(
argv
[
2
]);
while
(
count
<
num
)
...
...
tests/thread_test.c
View file @
2fb4a502
...
...
@@ -55,6 +55,7 @@ unsigned __stdcall test_thread(void *arg __attribute__((unused)))
perror
(
""
);
goto
end
;
}
mysql
.
reconnect
=
1
;
if
(
verbose
)
{
putchar
(
'*'
);
fflush
(
stdout
);
}
for
(
count
=
0
;
count
<
number_of_tests
;
count
++
)
{
...
...
tools/mysqlmanager.c
View file @
2fb4a502
...
...
@@ -877,7 +877,10 @@ static void manager_exec_connect(struct manager_exec* e)
{
if
(
mysql_real_connect
(
&
e
->
mysql
,
e
->
con_host
,
e
->
con_user
,
e
->
con_pass
,
0
,
e
->
con_port
,
e
->
con_sock
,
0
))
{
e
->
mysql
.
reconnect
=
1
;
return
;
}
sleep
(
1
);
}
e
->
error
=
"Could not connect to MySQL server withing the number of tries"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment