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
685a932e
Commit
685a932e
authored
Jul 19, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove code in mysqltest that requires the no longer existing "manager"
Remove the four test cases that require manager
parent
601d9480
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
6 additions
and
430 deletions
+6
-430
client/mysqltest.c
client/mysqltest.c
+6
-111
mysql-test/r/rpl000018.result
mysql-test/r/rpl000018.result
+0
-14
mysql-test/r/rpl_chain_temp_table.result
mysql-test/r/rpl_chain_temp_table.result
+0
-30
mysql-test/r/rpl_failsafe.result
mysql-test/r/rpl_failsafe.result
+0
-34
mysql-test/r/rpl_heap.result
mysql-test/r/rpl_heap.result
+0
-29
mysql-test/t/rpl000018.test
mysql-test/t/rpl000018.test
+0
-29
mysql-test/t/rpl_chain_temp_table.test
mysql-test/t/rpl_chain_temp_table.test
+0
-101
mysql-test/t/rpl_failsafe.test
mysql-test/t/rpl_failsafe.test
+0
-24
mysql-test/t/rpl_heap.test
mysql-test/t/rpl_heap.test
+0
-58
No files found.
client/mysqltest.c
View file @
685a932e
...
...
@@ -82,9 +82,6 @@
#define MAX_EXPECTED_ERRORS 10
#define QUERY_SEND 1
#define QUERY_REAP 2
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546
#endif
#define MAX_SERVER_ARGS 64
...
...
@@ -96,11 +93,10 @@
#define RESULT_CONTENT_MISMATCH 1
#define RESULT_LENGTH_MISMATCH 2
enum
{
OPT_MANAGER_USER
=
256
,
OPT_MANAGER_HOST
,
OPT_MANAGER_PASSWD
,
OPT_MANAGER_PORT
,
OPT_MANAGER_WAIT_TIMEOUT
,
OPT_SKIP_SAFEMALLOC
,
OPT_SSL_SSL
,
OPT_SSL_KEY
,
OPT_SSL_CERT
,
OPT_SSL_CA
,
OPT_SSL_CAPATH
,
OPT_SSL_CIPHER
,
OPT_PS_PROTOCOL
,
OPT_SP_PROTOCOL
,
OPT_CURSOR_PROTOCOL
,
OPT_VIEW_PROTOCOL
,
OPT_SSL_VERIFY_SERVER_CERT
,
OPT_MAX_CONNECT_RETRIES
,
enum
{
OPT_SKIP_SAFEMALLOC
=
256
,
OPT_SSL_SSL
,
OPT_SSL_KEY
,
OPT_SSL_CERT
,
OPT_SSL_CA
,
OPT_SSL_CAPATH
,
OPT_SSL_CIPHER
,
OPT_PS_PROTOCOL
,
OPT_SP_PROTOCOL
,
OPT_CURSOR_PROTOCOL
,
OPT_VIEW_PROTOCOL
,
OPT_SSL_VERIFY_SERVER_CERT
,
OPT_MAX_CONNECT_RETRIES
,
OPT_MARK_PROGRESS
};
/* ************************************************************************ */
...
...
@@ -160,11 +156,6 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static
my_bool
view_protocol
=
0
,
view_protocol_enabled
=
0
;
static
my_bool
cursor_protocol
=
0
,
cursor_protocol_enabled
=
0
;
static
int
parsing_disabled
=
0
;
const
char
*
manager_user
=
"root"
,
*
manager_host
=
0
;
char
*
manager_pass
=
0
;
int
manager_port
=
MYSQL_MANAGER_PORT
;
int
manager_wait_timeout
=
3
;
MYSQL_MANAGER
*
manager
=
0
;
static
char
**
default_argv
;
static
const
char
*
load_default_groups
[]
=
{
"mysqltest"
,
"client"
,
0
};
...
...
@@ -335,7 +326,7 @@ Q_RPL_PROBE, Q_ENABLE_RPL_PARSE,
Q_DISABLE_RPL_PARSE
,
Q_EVAL_RESULT
,
Q_ENABLE_QUERY_LOG
,
Q_DISABLE_QUERY_LOG
,
Q_ENABLE_RESULT_LOG
,
Q_DISABLE_RESULT_LOG
,
Q_SERVER_START
,
Q_SERVER_STOP
,
Q_REQUIRE_MANAGER
,
Q_SERVER_START
,
Q_SERVER_STOP
,
Q_WAIT_FOR_SLAVE_TO_STOP
,
Q_ENABLE_WARNINGS
,
Q_DISABLE_WARNINGS
,
Q_ENABLE_PS_WARNINGS
,
Q_DISABLE_PS_WARNINGS
,
...
...
@@ -411,7 +402,6 @@ const char *command_names[]=
"disable_result_log"
,
"server_start"
,
"server_stop"
,
"require_manager"
,
"wait_for_slave_to_stop"
,
"enable_warnings"
,
"disable_warnings"
,
...
...
@@ -610,10 +600,7 @@ static void free_used_memory()
{
uint
i
;
DBUG_ENTER
(
"free_used_memory"
);
#ifndef EMBEDDED_LIBRARY
if
(
manager
)
mysql_manager_close
(
manager
);
#endif
close_cons
();
close_files
();
hash_free
(
&
var_hash
);
...
...
@@ -1030,57 +1017,6 @@ int do_wait_for_slave_to_stop(struct st_query *q __attribute__((unused)))
return
0
;
}
int
do_require_manager
(
struct
st_query
*
query
__attribute__
((
unused
))
)
{
if
(
!
manager
)
abort_not_supported_test
(
"manager"
);
return
0
;
}
#ifndef EMBEDDED_LIBRARY
static
int
do_server_op
(
struct
st_query
*
q
,
const
char
*
op
)
{
char
*
p
=
q
->
first_argument
;
char
com_buf
[
256
],
*
com_p
;
if
(
!
manager
)
{
die
(
"Manager is not initialized, manager commands are not possible"
);
}
com_p
=
strmov
(
com_buf
,
op
);
com_p
=
strmov
(
com_p
,
"_exec "
);
if
(
!*
p
)
die
(
"Missing server name in server_%s"
,
op
);
while
(
*
p
&&
!
my_isspace
(
charset_info
,
*
p
))
*
com_p
++=
*
p
++
;
*
com_p
++=
' '
;
com_p
=
int10_to_str
(
manager_wait_timeout
,
com_p
,
10
);
*
com_p
++=
'\n'
;
*
com_p
=
0
;
if
(
mysql_manager_command
(
manager
,
com_buf
,
(
int
)(
com_p
-
com_buf
)))
die
(
"Error in command: %s(%d)"
,
manager
->
last_error
,
manager
->
last_errno
);
while
(
!
manager
->
eof
)
{
if
(
mysql_manager_fetch_line
(
manager
,
com_buf
,
sizeof
(
com_buf
)))
die
(
"Error fetching result line: %s(%d)"
,
manager
->
last_error
,
manager
->
last_errno
);
}
q
->
last_argument
=
p
;
return
0
;
}
int
do_server_start
(
struct
st_query
*
q
)
{
return
do_server_op
(
q
,
"start"
);
}
int
do_server_stop
(
struct
st_query
*
q
)
{
return
do_server_op
(
q
,
"stop"
);
}
#endif
/*
Source and execute the given file
...
...
@@ -2473,19 +2409,6 @@ char* safe_get_param(char *str, char** arg, const char *msg)
DBUG_RETURN
(
str
);
}
#ifndef EMBEDDED_LIBRARY
void
init_manager
()
{
if
(
!
(
manager
=
mysql_manager_init
(
0
)))
die
(
"Failed in mysql_manager_init()"
);
if
(
!
mysql_manager_connect
(
manager
,
manager_host
,
manager_user
,
manager_pass
,
manager_port
))
die
(
"Could not connect to MySQL manager: %s(%d)"
,
manager
->
last_error
,
manager
->
last_errno
);
}
#endif
/*
Connect to a server doing several retries if needed.
...
...
@@ -3287,20 +3210,6 @@ static struct my_option my_long_options[] =
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"include"
,
'i'
,
"Include SQL before each test case."
,
(
gptr
*
)
&
opt_include
,
(
gptr
*
)
&
opt_include
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"manager-host"
,
OPT_MANAGER_HOST
,
"Undocumented: Used for debugging."
,
(
gptr
*
)
&
manager_host
,
(
gptr
*
)
&
manager_host
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"manager-password"
,
OPT_MANAGER_PASSWD
,
"Undocumented: Used for debugging."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"manager-port"
,
OPT_MANAGER_PORT
,
"Undocumented: Used for debugging."
,
(
gptr
*
)
&
manager_port
,
(
gptr
*
)
&
manager_port
,
0
,
GET_INT
,
REQUIRED_ARG
,
MYSQL_MANAGER_PORT
,
0
,
0
,
0
,
0
,
0
},
{
"manager-user"
,
OPT_MANAGER_USER
,
"Undocumented: Used for debugging."
,
(
gptr
*
)
&
manager_user
,
(
gptr
*
)
&
manager_user
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"manager-wait-timeout"
,
OPT_MANAGER_WAIT_TIMEOUT
,
"Undocumented: Used for debugging."
,
(
gptr
*
)
&
manager_wait_timeout
,
(
gptr
*
)
&
manager_wait_timeout
,
0
,
GET_INT
,
REQUIRED_ARG
,
3
,
0
,
0
,
0
,
0
,
0
},
{
"mark-progress"
,
OPT_MARK_PROGRESS
,
"Write linenumber and elapsed time to <testname>.progress "
,
(
gptr
*
)
&
opt_mark_progress
,
(
gptr
*
)
&
opt_mark_progress
,
0
,
...
...
@@ -3397,11 +3306,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
'r'
:
record
=
1
;
break
;
case
(
int
)
OPT_MANAGER_PASSWD
:
my_free
(
manager_pass
,
MYF
(
MY_ALLOW_ZERO_PTR
));
manager_pass
=
my_strdup
(
argument
,
MYF
(
MY_FAE
));
while
(
*
argument
)
*
argument
++=
'x'
;
/* Destroy argument */
break
;
case
'x'
:
{
char
buff
[
FN_REFLEN
];
...
...
@@ -5224,10 +5128,6 @@ int main(int argc, char **argv)
cur_file
->
file_name
=
my_strdup
(
"<stdin>"
,
MYF
(
MY_WME
));
cur_file
->
lineno
=
1
;
}
#ifndef EMBEDDED_LIBRARY
if
(
manager_host
)
init_manager
();
#endif
init_re
();
ps_protocol_enabled
=
ps_protocol
;
sp_protocol_enabled
=
sp_protocol
;
...
...
@@ -5319,11 +5219,6 @@ int main(int argc, char **argv)
case
Q_SLEEP
:
do_sleep
(
q
,
0
);
break
;
case
Q_REAL_SLEEP
:
do_sleep
(
q
,
1
);
break
;
case
Q_WAIT_FOR_SLAVE_TO_STOP
:
do_wait_for_slave_to_stop
(
q
);
break
;
case
Q_REQUIRE_MANAGER
:
do_require_manager
(
q
);
break
;
#ifndef EMBEDDED_LIBRARY
case
Q_SERVER_START
:
do_server_start
(
q
);
break
;
case
Q_SERVER_STOP
:
do_server_stop
(
q
);
break
;
#endif
case
Q_INC
:
do_modify_var
(
q
,
DO_INC
);
break
;
case
Q_DEC
:
do_modify_var
(
q
,
DO_DEC
);
break
;
case
Q_ECHO
:
do_echo
(
q
);
query_executed
=
1
;
break
;
...
...
mysql-test/r/rpl000018.result
deleted
100644 → 0
View file @
601d9480
reset master;
reset slave;
start slave;
show binary logs;
Log_name
master-bin.000001
master-bin.000002
drop table if exists t1;
create table t1(n int);
insert into t1 values (3351);
select * from t1;
n
3351
drop table t1;
mysql-test/r/rpl_chain_temp_table.result
deleted
100644 → 0
View file @
601d9480
slave stop;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
reset master;
change master to master_host='127.0.0.1',master_port=9307, master_user='root';
start slave;
create temporary table t1 (a int);
create temporary table t1 (a int);
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 2
create temporary table t1 (a int);
create temporary table t1 (a int);
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 4
stop slave;
insert into t1 values(1);
create table t2 as select * from t1;
start slave;
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 4
select * from t2;
a
1
drop table t2;
mysql-test/r/rpl_failsafe.result
deleted
100644 → 0
View file @
601d9480
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 1
show status like 'Rpl_status';
Variable_name Value
Rpl_status AUTH_MASTER
create table t1(n int);
drop table t1;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 2
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 3
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 4
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
mysql-test/r/rpl_heap.result
deleted
100644 → 0
View file @
601d9480
reset master;
drop table if exists t1;
create table t1 ENGINE=HEAP select 10 as a;
insert into t1 values(11);
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use `test`; create table t1 ENGINE=HEAP select 10 as a
master-bin.001 154 Query 1 154 use `test`; insert into t1 values(11)
reset slave;
start slave;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(2) NOT NULL default '0'
) ENGINE=HEAP
select * from t1;
a
10
11
select * from t1;
a
select * from t1 limit 10;
a
show binlog events in 'master-bin.002' from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.002 79 Query 1 79 use `test`; DELETE FROM `test`.`t1`
select * from t1;
a
drop table t1;
mysql-test/t/rpl000018.test
deleted
100644 → 0
View file @
601d9480
#
# Running test with abort-slave-event-count=1
# This will force slave to reconnect after every event
#
require_manager
;
connect
(
master
,
localhost
,
root
,,
test
,
0
,
$MASTER_MYPORT
);
connect
(
slave
,
localhost
,
root
,,
test
,
0
,
slave
.
sock
);
connection
master
;
reset
master
;
server_stop
master
;
server_start
master
;
connection
slave
;
reset
slave
;
start
slave
;
connection
master
;
show
binary
logs
;
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
n
int
);
insert
into
t1
values
(
3351
);
sync_slave_with_master
;
select
*
from
t1
;
connection
master
;
drop
table
t1
;
sync_slave_with_master
;
# End of 4.1 tests
mysql-test/t/rpl_chain_temp_table.test
deleted
100644 → 0
View file @
601d9480
# This test makes some assumptions about values of thread ids, which should be
# true if the servers have been restarted for this test. So we want to
# stop/restart servers. Note that if assumptions are wrong, the test will not
# fail; it will just fail to test the error-prone scenario.
# Using the manager is the only way to have more than one slave server.
# So you must run this test with --manager.
require_manager
;
server_stop
master
;
server_start
master
;
server_stop
slave
;
server_start
slave
;
# no need for slave_sec (no assumptions on thread ids for this server).
source
include
/
master
-
slave
.
inc
;
connect
(
slave_sec
,
localhost
,
root
,,
test
,
0
,
slave
.
sock
-
1
);
connection
master
;
save_master_pos
;
connection
slave
;
sync_with_master
;
reset
master
;
save_master_pos
;
connection
slave_sec
;
eval
change
master
to
master_host
=
'127.0.0.1'
,
master_port
=
$SLAVE_MYPORT
,
master_user
=
'root'
;
start
slave
;
sync_with_master
;
# :P now we have a chain ready-to-test.
connection
master
;
create
temporary
table
t1
(
a
int
);
save_master_pos
;
connection
slave
;
sync_with_master
;
connection
master1
;
create
temporary
table
t1
(
a
int
);
save_master_pos
;
connection
slave
;
sync_with_master
;
save_master_pos
;
# First test:
connection
slave_sec
;
# Before BUG#1686 ("If 2 master threads with same-name temp table, slave makes
# bad binlog") was fixed, sync_with_master failed
sync_with_master
;
show
status
like
'slave_open_temp_tables'
;
# 'master' and 'master1' usually have thread id 2-3 or 3-4.
# 'slave' and 'slave1' usually have thread id 2-3.
connection
slave
;
create
temporary
table
t1
(
a
int
);
connection
slave1
;
create
temporary
table
t1
(
a
int
);
# So it's likely that in the binlog of slave we get
# server_id=of_master thread_id=3 create temp...
# server_id=of_slave thread_id=3 create temp...
# which would confuse slave-sec unless slave-sec uses server id to distinguish
# between temp tables (here thread id is obviously not enough to distinguish).
save_master_pos
;
# Second test:
connection
slave_sec
;
# If we did not use the server id to distinguish between temp tables,
# sync_with_master would fail
sync_with_master
;
show
status
like
'slave_open_temp_tables'
;
# Third test (BUG#1240 "slave of slave breaks when STOP SLAVE was issud on
# parent slave and temp tables").
stop
slave
;
connection
slave
;
insert
into
t1
values
(
1
);
create
table
t2
as
select
*
from
t1
;
save_master_pos
;
connection
slave_sec
;
start
slave
;
sync_with_master
;
show
status
like
'slave_open_temp_tables'
;
select
*
from
t2
;
# clean up
connection
slave
;
drop
table
t2
;
save_master_pos
;
connection
slave_sec
;
sync_with_master
;
# On purpose, we don't delete the temporary tables explicitely.
# So temp tables remain on slave (remember they are not deleted when the slave
# SQL thread terminates). If you run this test with
# --valgrind --valgrind-options=--show-reachable=yes
# you will see if they get cleaned up at slave's shutdown (that is, if the
# memory they use is freed (it should) by mysqld before it terminates).
# If they wouldn't be cleaned up, you would see some "still reachable" blocks in
# Valgrind.
# End of 4.1 tests
mysql-test/t/rpl_failsafe.test
deleted
100644 → 0
View file @
601d9480
require_manager
;
source
include
/
master
-
slave
.
inc
;
connect
(
slave_sec
,
localhost
,
root
,,
test
,
0
,
slave
.
sock
-
1
);
connect
(
slave_ter
,
localhost
,
root
,,
test
,
0
,
slave
.
sock
-
2
);
connection
master
;
show
variables
like
'rpl_recovery_rank'
;
show
status
like
'Rpl_status'
;
create
table
t1
(
n
int
);
drop
table
t1
;
sync_slave_with_master
;
show
variables
like
'rpl_recovery_rank'
;
show
status
like
'Rpl_status'
;
connection
slave_sec
;
start
slave
;
sync_with_master
;
show
variables
like
'rpl_recovery_rank'
;
show
status
like
'Rpl_status'
;
connection
slave_ter
;
start
slave
;
sync_with_master
;
show
variables
like
'rpl_recovery_rank'
;
show
status
like
'Rpl_status'
;
# End of 4.1 tests
mysql-test/t/rpl_heap.test
deleted
100644 → 0
View file @
601d9480
# Requires statement logging
--
source
include
/
have_binlog_format_statement
.
inc
# You must run this test with --manager.
require_manager
;
# Don't know why, but using TCP/IP connections makes this test fail
# with "Lost connection to MySQL server during query" when we
# issue a query after the server restart.
# Maybe this is something awkward in mysqltest or in the manager?
# So we use sockets.
connect
(
master
,
localhost
,
root
,,
test
,
0
,
$MASTER_MYPORT
);
connect
(
slave
,
localhost
,
root
,,
test
,
0
,
slave
.
sock
);
connection
master
;
reset
master
;
drop
table
if
exists
t1
;
# we use CREATE SELECT to verify that DELETE does not get into binlog
# before CREATE SELECT
create
table
t1
engine
=
HEAP
select
10
as
a
;
insert
into
t1
values
(
11
);
save_master_pos
;
--
replace_column
2
# 5 #
--
replace_regex
/
table_id
:
[
0
-
9
]
+/
table_id
:
#/
show
binlog
events
from
79
;
connection
slave
;
reset
slave
;
start
slave
;
sync_with_master
;
show
create
table
t1
;
select
*
from
t1
;
# should be one row
server_stop
master
;
server_start
master
;
connection
master
;
select
*
from
t1
;
# to check that DELETE is not written twice
# (the LIMIT is to not use the query cache)
select
*
from
t1
limit
10
;
save_master_pos
;
--
replace_column
2
# 5 #
--
replace_regex
/
table_id
:
[
0
-
9
]
+/
table_id
:
#/
show
binlog
events
in
'master-bin.002'
from
79
;
connection
slave
;
sync_with_master
;
select
*
from
t1
;
# should be empty
# clean up
connection
master
;
drop
table
t1
;
save_master_pos
;
connection
slave
;
sync_with_master
;
# End of 4.1 tests
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