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
f533b2b4
Commit
f533b2b4
authored
Aug 25, 2015
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5-galera' into 10.0-galera
parents
c6a0cbda
472d6632
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
191 additions
and
32 deletions
+191
-32
mysql-test/include/check-warnings.test
mysql-test/include/check-warnings.test
+4
-0
mysql-test/suite/galera/r/partition.result
mysql-test/suite/galera/r/partition.result
+36
-0
mysql-test/suite/galera/t/partition.test
mysql-test/suite/galera/t/partition.test
+113
-0
mysql-test/suite/wsrep/suite.pm
mysql-test/suite/wsrep/suite.pm
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+2
-2
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+17
-14
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+17
-14
No files found.
mysql-test/include/check-warnings.test
View file @
f533b2b4
...
...
@@ -11,6 +11,10 @@
# Don't write these queries to binlog
set
SQL_LOG_BIN
=
0
;
# Do not replicate updates to other galera nodes
--
error
0
,
1193
set
WSREP_ON
=
0
;
# Turn off any debug crashes, allow the variable to be
# non existent in release builds
--
error
0
,
1193
...
...
mysql-test/suite/galera/r/partition.result
View file @
f533b2b4
...
...
@@ -101,4 +101,40 @@ t1 CREATE TABLE `t1` (
(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
DROP TABLE t1, p1;
#
# MDEV-5146: Bulk loads into partitioned table not working
#
# Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
# entries.
SET GLOBAL wsrep_load_data_splitting = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
SELECT COUNT(*) = 20002 FROM t1;
COUNT(*) = 20002
1
wsrep_last_committed_diff
1
DROP TABLE t1;
# Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
SET GLOBAL wsrep_load_data_splitting = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
SELECT COUNT(*) = 101 FROM t1;
COUNT(*) = 101
1
wsrep_last_committed_diff
1
DROP TABLE t1;
# Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
# entries.
SET GLOBAL wsrep_load_data_splitting = OFF;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
SELECT COUNT(*) = 20002 FROM t1;
COUNT(*) = 20002
1
wsrep_last_committed_diff
1
DROP TABLE t1;
SET GLOBAL wsrep_load_data_splitting = 1;;
# End of test
mysql-test/suite/galera/t/partition.test
View file @
f533b2b4
...
...
@@ -90,5 +90,118 @@ SHOW CREATE TABLE t1;
# Cleanup
DROP
TABLE
t1
,
p1
;
--
echo
#
--
echo
# MDEV-5146: Bulk loads into partitioned table not working
--
echo
#
# Create 2 files with 20002 & 101 entries in each.
--
perl
open
(
FILE
,
">"
,
"
$ENV
{
'MYSQLTEST_VARDIR'
}
/tmp/mdev-5146-1.dat"
)
or
die
;
foreach
my
$i
(
1.
.
20002
)
{
print
FILE
"
$i
\n
"
;
}
open
(
FILE
,
">"
,
"
$ENV
{
'MYSQLTEST_VARDIR'
}
/tmp/mdev-5146-2.dat"
)
or
die
;
foreach
my
$i
(
1.
.
101
)
{
print
FILE
"
$i
\n
"
;
}
EOF
--
connection
node_1
--
let
$wsrep_load_data_splitting_orig
=
`SELECT @@wsrep_load_data_splitting`
--
echo
# Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
--
echo
# entries.
SET
GLOBAL
wsrep_load_data_splitting
=
ON
;
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
)
ENGINE
=
INNODB
PARTITION
BY
HASH
(
pk
)
PARTITIONS
2
;
# Record wsrep_last_committed as it was before LOAD DATA
--
let
$wsrep_last_committed_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
disable_query_log
--
eval
LOAD
DATA
INFILE
'$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat'
INTO
TABLE
t1
;
--
enable_query_log
--
let
$wsrep_last_committed_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
connection
node_2
SELECT
COUNT
(
*
)
=
20002
FROM
t1
;
# LOAD-ing 20002 rows causes 3 commits to be registered
--
disable_query_log
--
eval
SELECT
$wsrep_last_committed_after
=
$wsrep_last_committed_before
+
3
AS
wsrep_last_committed_diff
;
--
enable_query_log
DROP
TABLE
t1
;
--
echo
# Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
--
connection
node_1
SET
GLOBAL
wsrep_load_data_splitting
=
ON
;
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
)
ENGINE
=
INNODB
PARTITION
BY
HASH
(
pk
)
PARTITIONS
2
;
# Record wsrep_last_committed as it was before LOAD DATA
--
let
$wsrep_last_committed_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
disable_query_log
--
eval
LOAD
DATA
INFILE
'$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat'
INTO
TABLE
t1
;
--
enable_query_log
--
let
$wsrep_last_committed_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
connection
node_2
SELECT
COUNT
(
*
)
=
101
FROM
t1
;
# LOAD-ing 101 rows causes 1 commit to be registered
--
disable_query_log
--
eval
SELECT
$wsrep_last_committed_after
=
$wsrep_last_committed_before
+
1
AS
wsrep_last_committed_diff
;
--
enable_query_log
DROP
TABLE
t1
;
--
echo
# Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
--
echo
# entries.
--
connection
node_1
SET
GLOBAL
wsrep_load_data_splitting
=
OFF
;
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
)
ENGINE
=
INNODB
PARTITION
BY
HASH
(
pk
)
PARTITIONS
2
;
# Record wsrep_last_committed as it was before LOAD DATA
--
let
$wsrep_last_committed_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
disable_query_log
--
eval
LOAD
DATA
INFILE
'$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat'
INTO
TABLE
t1
;
--
enable_query_log
--
let
$wsrep_last_committed_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
connection
node_2
SELECT
COUNT
(
*
)
=
20002
FROM
t1
;
# LOAD-ing 20002 rows causes 1 commit to be registered
--
disable_query_log
--
eval
SELECT
$wsrep_last_committed_after
=
$wsrep_last_committed_before
+
1
AS
wsrep_last_committed_diff
;
--
enable_query_log
DROP
TABLE
t1
;
--
connection
node_1
# Restore the original value
--
eval
SET
GLOBAL
wsrep_load_data_splitting
=
$wsrep_load_data_splitting_orig
;
# Cleanup
remove_file
'$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat'
;
remove_file
'$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat'
;
--
source
include
/
galera_end
.
inc
--
echo
# End of test
mysql-test/suite/wsrep/suite.pm
View file @
f533b2b4
...
...
@@ -25,8 +25,8 @@ return "No my_print_defaults" unless $epath;
push
@::global_suppressions
,
(
qr(WSREP: Could not open saved state file for reading: )
,
qr(WSREP: option --wsrep-ca
su
al-reads is deprecated)
,
qr(WSREP: --wsrep-ca
su
al-reads=ON takes precedence over --wsrep-sync-wait=0)
,
qr(WSREP: option --wsrep-ca
us
al-reads is deprecated)
,
qr(WSREP: --wsrep-ca
us
al-reads=ON takes precedence over --wsrep-sync-wait=0)
,
qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|
,
);
...
...
sql/mysqld.cc
View file @
f533b2b4
...
...
@@ -9676,10 +9676,10 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
}
if
(
global_system_variables
.
wsrep_causal_reads
)
{
WSREP_WARN
(
"option --wsrep-ca
su
al-reads is deprecated"
);
WSREP_WARN
(
"option --wsrep-ca
us
al-reads is deprecated"
);
if
(
!
(
global_system_variables
.
wsrep_sync_wait
&
WSREP_SYNC_WAIT_BEFORE_READ
))
{
WSREP_WARN
(
"--wsrep-ca
su
al-reads=ON takes precedence over --wsrep-sync-wait=%u. "
WSREP_WARN
(
"--wsrep-ca
us
al-reads=ON takes precedence over --wsrep-sync-wait=%u. "
"WSREP_SYNC_WAIT_BEFORE_READ is on"
,
global_system_variables
.
wsrep_sync_wait
);
global_system_variables
.
wsrep_sync_wait
|=
WSREP_SYNC_WAIT_BEFORE_READ
;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
f533b2b4
...
...
@@ -7483,10 +7483,11 @@ no_commit:
;
}
else
if
(
src_table
==
prebuilt
->
table
)
{
#ifdef WITH_WSREP
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
sql_command
==
SQLCOM_LOAD
&&
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
switch
(
wsrep_run_wsrep_commit
(
user_thd
,
wsrep_hton
,
1
))
{
...
...
@@ -7514,10 +7515,11 @@ no_commit:
prebuilt
->
sql_stat_start
=
TRUE
;
}
else
{
#ifdef WITH_WSREP
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
sql_command
==
SQLCOM_LOAD
&&
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
switch
(
wsrep_run_wsrep_commit
(
user_thd
,
wsrep_hton
,
1
))
{
...
...
@@ -7739,14 +7741,15 @@ report_error:
user_thd
);
#ifdef WITH_WSREP
if
(
!
error_result
&&
wsrep_thd_exec_mode
(
user_thd
)
==
LOCAL_STATE
&&
wsrep_on
(
user_thd
)
&&
!
wsrep_consistency_check
(
user_thd
)
&&
(
sql_command
!=
SQLCOM_LOAD
||
thd_binlog_format
(
user_thd
)
==
BINLOG_FORMAT_ROW
))
{
if
(
wsrep_append_keys
(
user_thd
,
false
,
record
,
NULL
))
{
DBUG_PRINT
(
"wsrep"
,
(
"row key failed"
));
error_result
=
HA_ERR_INTERNAL_ERROR
;
if
(
!
error_result
&&
wsrep_thd_exec_mode
(
user_thd
)
==
LOCAL_STATE
&&
wsrep_on
(
user_thd
)
&&
!
wsrep_consistency_check
(
user_thd
))
{
if
(
wsrep_append_keys
(
user_thd
,
false
,
record
,
NULL
))
{
DBUG_PRINT
(
"wsrep"
,
(
"row key failed"
));
error_result
=
HA_ERR_INTERNAL_ERROR
;
goto
wsrep_error
;
}
}
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
f533b2b4
...
...
@@ -8055,10 +8055,11 @@ no_commit:
;
}
else
if
(
src_table
==
prebuilt
->
table
)
{
#ifdef WITH_WSREP
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
sql_command
==
SQLCOM_LOAD
&&
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
switch
(
wsrep_run_wsrep_commit
(
user_thd
,
wsrep_hton
,
1
))
{
...
...
@@ -8086,10 +8087,11 @@ no_commit:
prebuilt
->
sql_stat_start
=
TRUE
;
}
else
{
#ifdef WITH_WSREP
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
if
(
wsrep_on
(
user_thd
)
&&
wsrep_load_data_splitting
&&
sql_command
==
SQLCOM_LOAD
&&
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
!
thd_test_options
(
user_thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
switch
(
wsrep_run_wsrep_commit
(
user_thd
,
wsrep_hton
,
1
))
{
...
...
@@ -8320,14 +8322,15 @@ report_error:
user_thd
);
#ifdef WITH_WSREP
if
(
!
error_result
&&
wsrep_thd_exec_mode
(
user_thd
)
==
LOCAL_STATE
&&
wsrep_on
(
user_thd
)
&&
!
wsrep_consistency_check
(
user_thd
)
&&
(
sql_command
!=
SQLCOM_LOAD
||
thd_binlog_format
(
user_thd
)
==
BINLOG_FORMAT_ROW
))
{
if
(
wsrep_append_keys
(
user_thd
,
false
,
record
,
NULL
))
{
DBUG_PRINT
(
"wsrep"
,
(
"row key failed"
));
error_result
=
HA_ERR_INTERNAL_ERROR
;
if
(
!
error_result
&&
wsrep_thd_exec_mode
(
user_thd
)
==
LOCAL_STATE
&&
wsrep_on
(
user_thd
)
&&
!
wsrep_consistency_check
(
user_thd
))
{
if
(
wsrep_append_keys
(
user_thd
,
false
,
record
,
NULL
))
{
DBUG_PRINT
(
"wsrep"
,
(
"row key failed"
));
error_result
=
HA_ERR_INTERNAL_ERROR
;
goto
wsrep_error
;
}
}
...
...
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