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
43c6c2ac
Commit
43c6c2ac
authored
Mar 27, 2014
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r3468 from maria-5.5-galera.
parent
7fd382f1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
306 additions
and
0 deletions
+306
-0
mysql-test/include/galera_cluster.inc
mysql-test/include/galera_cluster.inc
+10
-0
mysql-test/include/galera_connect.inc
mysql-test/include/galera_connect.inc
+45
-0
mysql-test/include/galera_diff.inc
mysql-test/include/galera_diff.inc
+100
-0
mysql-test/include/galera_end.inc
mysql-test/include/galera_end.inc
+25
-0
mysql-test/include/galera_init.inc
mysql-test/include/galera_init.inc
+26
-0
mysql-test/include/mtr_warnings.sql
mysql-test/include/mtr_warnings.sql
+8
-0
mysql-test/lib/mtr_cases.pm
mysql-test/lib/mtr_cases.pm
+3
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+3
-0
mysql-test/suite/galera/galera_2nodes.cnf
mysql-test/suite/galera/galera_2nodes.cnf
+21
-0
mysql-test/suite/galera/my.cnf
mysql-test/suite/galera/my.cnf
+1
-0
mysql-test/suite/galera/r/basic.result
mysql-test/suite/galera/r/basic.result
+30
-0
mysql-test/suite/galera/t/basic.test
mysql-test/suite/galera/t/basic.test
+26
-0
mysql-test/suite/wsrep/README
mysql-test/suite/wsrep/README
+7
-0
mysql-test/suite/wsrep/t/trans.test
mysql-test/suite/wsrep/t/trans.test
+1
-0
No files found.
mysql-test/include/galera_cluster.inc
0 → 100644
View file @
43c6c2ac
# galera_cluster.inc
# ==================
#
# Description
# -----------
# Configure galera cluster with 2 nodes.
#
--
let
$galera_cluster_size
=
2
--
source
include
/
galera_init
.
inc
mysql-test/include/galera_connect.inc
0 → 100644
View file @
43c6c2ac
# galera_connect.inc
# ==================
#
# Description
# -----------
# Open a connection to the specified server number ($galera_server_number).
# The connection itself would be identified by $galera_connection_name.
#
# Parameters
# ----------
# $galera_connection_name
# Name of the resulting connection.
#
# $galera_server_number
# Sequence number of the node in the galera cluster.
#
# $galera_debug
# Print debug information.
#
if
(
!
$galera_connection_name
)
{
--
die
ERROR
IN
TEST
:
$galera_connection_name
must
be
set
before
sourcing
include
/
galera_connect
.
inc
}
if
(
!
$galera_server_number
)
{
--
die
ERROR
IN
TEST
:
$galera_server_number
must
be
set
before
sourcing
include
/
galera_connect
.
inc
}
--
let
$_galera_port
=
\
$NODE_MYPORT_$galera_server_number
if
(
!
$_galera_port
)
{
--
echo
Bug
in
test
case
:
'\$NODE_MYPORT_$galera_server_number'
not
initialized
.
Check
the
test
'
s
.
cfg
file
.
--
die
Not
all
NODE_MYPORT_
*
environment
variables
are
setup
correctly
.
}
if
(
$galera_debug
)
{
--
echo
connect
(
$galera_connection_name
,
127.0
.
0.1
,
root
,,
test
,
$_galera_port
,)
}
# Open a connection
--
connect
(
$galera_connection_name
,
127.0
.
0.1
,
root
,,
test
,
$_galera_port
,)
mysql-test/include/galera_diff.inc
0 → 100644
View file @
43c6c2ac
# galera_diff.inc
# ===============
#
# Description
# -----------
# Compare the output of the given statement on all the nodes of the cluster.
#
# Parameters
# ----------
# $galera_diff_statement
# Statement for which the output would be compared.
#
# $galera_diff_database
# Database against which the above statement would be executed.
# (Default : test)
#
# $galera_diff_servers
# Comma separated list of servers to executed the diff statement on. If not
# set, a list of servers will be generated based on $galera_cluster_size.
#
# $galerra_debug
# Print debug information.
#
if
(
!
$galera_diff_statement
)
{
--
die
ERROR
IN
TEST
:
$galera_diff_statement
must
be
set
before
sourcing
include
/
galera_diff
.
inc
}
--
let
$_galera_diff_database
=
$galera_diff_database
if
(
!
$_galera_diff_database
)
{
--
let
$_galera_diff_database
=
test
}
--
let
$_galera_diff_servers
=
$galera_diff_servers
if
(
!
$_galera_diff_servers
)
{
--
let
$_i
=
$galera_cluster_size
--
let
$_galera_diff_servers
=
while
(
$_i
)
{
--
let
$_galera_diff_servers
=
$_i
,
$_galera_diff_servers
--
dec
$_i
}
}
if
(
$galera_debug
)
{
--
echo
\
$galera_diff_servers
=
'$_galera_diff_servers'
}
if
(
!
$galera_debug
)
{
--
disable_query_log
}
# Generate file containing $galera_diff_statement. We don't pass the
# statement on the command line, because it would be subject to shell
# substitutions.
--
let
$write_to_file
=
GENERATE
--
let
$write_var
=
$galera_diff_statement
--
source
include
/
write_var_to_file
.
inc
--
let
$_galera_diff_statement_file
=
$write_to_file
if
(
!
$galera_debug
)
{
--
enable_query_log
}
# Compare all servers.
--
let
$_galera_diff_first
=
1
while
(
$_galera_diff_servers
)
{
# Set $_galera_diff_server_i to the first number in the list
--
let
$_galera_diff_server_i
=
`SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)`
# Remove $_galera_diff_server_i from the list
--
let
$_galera_diff_servers
=
`SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)`
# Execute statement
--
let
$_galera_diff_file
=
$MYSQLTEST_VARDIR
/
tmp
/
_galera_diff_server
-
$_galera_diff_server_i
.
tmp
--
exec
$MYSQL
--
defaults
-
group
-
suffix
=.
$_galera_diff_server_i
$_galera_diff_database
<
$_galera_diff_statement_file
>
$_galera_diff_file
# Compare
if
(
!
$_galera_diff_first
)
{
if
(
$galera_debug
)
{
--
echo
diffing
$_galera_diff_file
and
$_galera_diff_prev_file
}
--
diff_files
$_galera_diff_file
$_galera_diff_prev_file
--
remove_file
$_galera_diff_prev_file
}
--
let
$_galera_diff_prev_file
=
$_galera_diff_file
--
let
$_galera_diff_first
=
0
}
# Cleanup
--
remove_file
$_galera_diff_prev_file
--
remove_file
$_galera_diff_statement_file
mysql-test/include/galera_end.inc
0 → 100644
View file @
43c6c2ac
# galera_end.inc
# ==============
#
# Description
# -----------
# Closes the connections opened via include/galera_init.inc
#
# Parameters
# ----------
# $galera_cluster_size
# Number of nodes in the cluster.
#
--
let
$_galera_node
=
$galera_cluster_size
while
(
$_galera_node
)
{
if
(
$galera_debug
)
{
--
echo
Disconnecting
node_
$_galera_node
}
--
disconnect
node_
$_galera_node
--
dec
$_galera_node
}
mysql-test/include/galera_init.inc
0 → 100644
View file @
43c6c2ac
# galera_init.inc
# ===============
#
# Description
# -----------
# Set up a Galera cluster with $wsrep_cluster_size nodes.
#
# Parameters
# ----------
# $galera_cluster_size
# Number of nodes in the cluster.
#
--
source
include
/
have_wsrep_enabled
.
inc
--
let
$_galera_node
=
$galera_cluster_size
while
(
$_galera_node
)
{
--
let
$galera_connection_name
=
node_
$_galera_node
--
let
$galera_server_number
=
$_galera_node
--
source
include
/
galera_connect
.
inc
--
dec
$_galera_node
}
mysql-test/include/mtr_warnings.sql
View file @
43c6c2ac
...
...
@@ -226,6 +226,14 @@ INSERT INTO global_suppressions VALUES
(
"Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"
),
(
"Slave I/O: Setting master-side filtering of @@skip_replication failed with error:.*"
),
(
"Slave I/O: Setting @mariadb_slave_capability failed with error:.*"
),
/*
Galera-related warnings.
*/
(
"WSREP: Could not open saved state file for reading: .*"
),
(
"WSREP: last inactive check more than .* skipping check"
),
(
"WSREP: Gap in state sequence. Need state transfer."
),
(
"WSREP: Failed to prepare for incremental state transfer: .*"
),
(
"THE_LAST_SUPPRESSION"
)
||
...
...
mysql-test/lib/mtr_cases.pm
View file @
43c6c2ac
...
...
@@ -857,6 +857,8 @@ sub collect_one_test_case {
# Suite has no config, autodetect which one to use
if
(
$tinfo
->
{
rpl_test
})
{
$config
=
"
suite/rpl/my.cnf
";
}
elsif
(
$tinfo
->
{
galera_test
})
{
$config
=
"
suite/galera/my.cnf
";
}
else
{
$config
=
"
include/default_my.cnf
";
}
...
...
@@ -977,6 +979,7 @@ my $tags_map= {'big_test' => ['big_test', 1],
'
master-slave
'
=>
['
rpl_test
',
1
],
'
ndb_master-slave
'
=>
['
rpl_test
',
1
,
'
ndb_test
',
1
],
'
long_test
'
=>
['
long_test
',
1
],
'
galera_init
'
=>
['
galera_test
',
1
],
};
my
$tags_regex_string
=
join
('
|
',
keys
%
$tags_map
);
my
$tags_regex
=
qr:include/($tags_regex_string)\.inc:
o
;
...
...
mysql-test/mysql-test-run.pl
View file @
43c6c2ac
...
...
@@ -4824,6 +4824,9 @@ sub extract_warning_lines ($$) {
qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|
,
qr|'log-bin-use-v1-row-events' is MySQL 5.6 compatible option|
,
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|
,
# setpriority() fails under valgrind
# Galera-related warnings.
qr|WSREP:.*down context.*|
,
qr|WSREP: Failed to send state UUID:.*|
,
);
my
$matched_lines
=
[]
;
...
...
mysql-test/suite/galera/galera_2nodes.cnf
0 → 100644
View file @
43c6c2ac
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld.1]
binlog-format=row
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address='gcomm://'
[mysqld.2]
binlog-format=row
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address='gcomm://127.0.0.1:4567'
wsrep_provider_options='gmcast.listen_addr=tcp://127.0.0.1:4568'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
mysql-test/suite/galera/my.cnf
0 → 100644
View file @
43c6c2ac
!include galera_2nodes.cnf
mysql-test/suite/galera/r/basic.result
0 → 100644
View file @
43c6c2ac
USE test;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT * FROM t1;
c1
1
2
3
4
5
# On node_1
SELECT * FROM test.t1;
c1
1
2
3
4
5
# On node_2
SELECT * FROM test.t1;
c1
1
2
3
4
5
DROP TABLE t1;
# End of test
mysql-test/suite/galera/t/basic.test
0 → 100644
View file @
43c6c2ac
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
USE
test
;
CREATE
TABLE
t1
(
c1
INT
PRIMARY
KEY
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
),
(
4
),
(
5
);
SELECT
*
FROM
t1
;
--
echo
--
echo
# On node_1
--
connection
node_1
SELECT
*
FROM
test
.
t1
;
--
echo
--
echo
# On node_2
--
connection
node_2
SELECT
*
FROM
test
.
t1
;
--
let
$galera_diff_statement
=
SELECT
*
FROM
t1
--
source
include
/
galera_diff
.
inc
# Cleanup
DROP
TABLE
t1
;
--
source
include
/
galera_end
.
inc
--
echo
# End of test
mysql-test/suite/wsrep/README
0 → 100644
View file @
43c6c2ac
* 'wsrep' suite is designated for tests which do not require a multi-node
galera cluster.
* As these tests are specific to wsrep-related functionalities, they must skip
on server built without wsrep patch (vanilla). (-DWITH_WSREP=OFF)
See : include/have_wsrep.inc, include/have_wsrep_enabled.inc, not_wsrep.inc
mysql-test/suite/wsrep/t/trans.test
View file @
43c6c2ac
--
source
include
/
have_wsrep
.
inc
--
source
include
/
have_innodb
.
inc
--
echo
#
...
...
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