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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1a2df3f4
Commit
1a2df3f4
authored
Dec 01, 2010
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
automatic merge with 5.1
parents
863a493b
41df9be0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
2 deletions
+103
-2
mysql-test/extra/rpl_tests/rpl_auto_increment.test
mysql-test/extra/rpl_tests/rpl_auto_increment.test
+56
-0
mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
+1
-0
mysql-test/suite/rpl/r/rpl_auto_increment.result
mysql-test/suite/rpl/r/rpl_auto_increment.result
+29
-0
mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
+1
-0
sql/log_event.cc
sql/log_event.cc
+13
-0
storage/xtradb/sync/sync0rw.c
storage/xtradb/sync/sync0rw.c
+3
-2
No files found.
mysql-test/extra/rpl_tests/rpl_auto_increment.test
View file @
1a2df3f4
...
...
@@ -241,3 +241,59 @@ DROP TABLE t1;
DROP
TABLE
t2
;
SET
SQL_MODE
=
''
;
sync_slave_with_master
;
#
# Bug#54201: "SET INSERT_ID" event must be ignored if corresponding event is
# ignored.
#
connection
master
;
CREATE
TABLE
t1
(
s
VARCHAR
(
10
))
ENGINE
=
myisam
;
# -slave.opt has --replicate-ignore-table=test.t_ignored1
CREATE
TABLE
t_ignored1
(
id
INT
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
myisam
;
connection
slave
;
CREATE
TABLE
test
.
slave_only
(
id
INT
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
myisam
;
INSERT
INTO
slave_only
VALUES
(
NULL
);
CREATE
TRIGGER
t1_update
AFTER
UPDATE
ON
t1
FOR
EACH
ROW
INSERT
INTO
slave_only
VALUES
(
NULL
);
connection
master
;
INSERT
INTO
t_ignored1
VALUES
(
NULL
);
INSERT
INTO
t1
VALUES
(
's'
);
UPDATE
t1
SET
s
=
's1'
;
# With Bug#54201, slave stops with duplicate key error here due to trigger
# using the insert_id from insert on master into t1_ignored1
sync_slave_with_master
;
connection
slave
;
SELECT
*
FROM
t1
;
connection
master
;
CREATE
TABLE
t_ignored2
(
id
INT
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
myisam
;
sync_slave_with_master
;
connection
slave
;
STOP
SLAVE
;
# Ignore the next INSERT into t_ignored2 and the INSERT_ID event just before it.
SET
GLOBAL
sql_slave_skip_counter
=
2
;
START
SLAVE
;
connection
master
;
INSERT
INTO
t_ignored2
VALUES
(
NULL
);
UPDATE
t1
SET
s
=
's2'
;
sync_slave_with_master
;
connection
slave
;
SELECT
*
FROM
t1
;
SHOW
TABLES
LIKE
't\_ignored_'
;
SELECT
*
FROM
t_ignored2
;
DROP
TABLE
slave_only
;
connection
master
;
DROP
TABLE
t1
;
DROP
TABLE
t_ignored1
;
DROP
TABLE
t_ignored2
;
sync_slave_with_master
;
mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
View file @
1a2df3f4
...
...
@@ -73,6 +73,7 @@ UNLOCK TABLES;
--
connection
con2
--
reap
--
error
0
,
1205
UNLOCK
TABLES
;
--
connection
con3
...
...
mysql-test/suite/rpl/r/rpl_auto_increment.result
View file @
1a2df3f4
...
...
@@ -312,3 +312,32 @@ Comparing tables master:test.t2 and slave:test.t2
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam;
CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
INSERT INTO slave_only VALUES(NULL);
CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL);
INSERT INTO t_ignored1 VALUES(NULL);
INSERT INTO t1 VALUES('s');
UPDATE t1 SET s='s1';
SELECT * FROM t1;
s
s1
CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
STOP SLAVE;
SET GLOBAL sql_slave_skip_counter = 2;
START SLAVE;
INSERT INTO t_ignored2 VALUES(NULL);
UPDATE t1 SET s='s2';
SELECT * FROM t1;
s
s2
SHOW TABLES LIKE 't\_ignored_';
Tables_in_test (t\_ignored_)
t_ignored2
SELECT * FROM t_ignored2;
id
DROP TABLE slave_only;
DROP TABLE t1;
DROP TABLE t_ignored1;
DROP TABLE t_ignored2;
mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
0 → 100644
View file @
1a2df3f4
--replicate-ignore-table=test.t_ignored1
sql/log_event.cc
View file @
1a2df3f4
...
...
@@ -3307,6 +3307,19 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
/* If the query was not ignored, it is printed to the general log */
if
(
!
thd
->
is_error
()
||
thd
->
main_da
.
sql_errno
()
!=
ER_SLAVE_IGNORED_TABLE
)
general_log_write
(
thd
,
COM_QUERY
,
thd
->
query
(),
thd
->
query_length
());
else
{
/*
Bug#54201: If we skip an INSERT query that uses auto_increment, then we
should reset any @@INSERT_ID set by an Intvar_log_event associated with
the query; otherwise the @@INSERT_ID will linger until the next INSERT
that uses auto_increment and may affect extra triggers on the slave etc.
We reset INSERT_ID unconditionally; it is probably cheaper than
checking if it is necessary.
*/
thd
->
auto_inc_intervals_forced
.
empty
();
}
compare_errors:
...
...
storage/xtradb/sync/sync0rw.c
View file @
1a2df3f4
...
...
@@ -247,10 +247,11 @@ rw_lock_create_func(
lock
->
mutex
.
cmutex_name
=
cmutex_name
;
ut_d
(
lock
->
mutex
.
mutex_type
=
1
);
#else
/* INNODB_RW_LOCKS_USE_ATOMICS */
#endif
/* INNODB_RW_LOCKS_USE_ATOMICS */
#if defined(INNODB_RW_LOCKS_USE_ATOMICS) || !defined(UNIV_DEBUG)
(
void
)
cfile_name
;
(
void
)
cline
;
#endif
/* INNODB_RW_LOCKS_USE_ATOMICS */
#endif
lock
->
lock_word
=
X_LOCK_DECR
;
lock
->
waiters
=
0
;
...
...
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