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
e2aad850
Commit
e2aad850
authored
May 23, 2009
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
BUG#41725: upmerge: 5.0-bt --> 5.1-bt
parents
53c09b3a
2b4fcc1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
mysql-test/suite/rpl/r/rpl_temporary.result
mysql-test/suite/rpl/r/rpl_temporary.result
+19
-0
mysql-test/suite/rpl/t/rpl_temporary.test
mysql-test/suite/rpl/t/rpl_temporary.test
+71
-0
sql/slave.cc
sql/slave.cc
+9
-0
No files found.
mysql-test/suite/rpl/r/rpl_temporary.result
View file @
e2aad850
...
@@ -6,6 +6,25 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
...
@@ -6,6 +6,25 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
start slave;
call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
reset master;
reset master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('a');
include/stop_slave.inc
include/start_slave.inc
INSERT INTO t1 VALUES ('b');
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam;
INSERT INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
include/stop_slave.inc
include/start_slave.inc
INSERT INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
DROP TABLE t1;
SET @save_select_limit=@@session.sql_select_limit;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
ERROR 42000: Access denied; you need the SUPER privilege for this operation
...
...
mysql-test/suite/rpl/t/rpl_temporary.test
View file @
e2aad850
...
@@ -22,6 +22,77 @@ call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032
...
@@ -22,6 +22,77 @@ call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032
sync_with_master
;
sync_with_master
;
reset
master
;
reset
master
;
# ##################################################################
# BUG#41725: slave crashes when inserting into temporary table after
# stop/start slave
#
# This test checks that both reported issues (assertion failure and
# crash) go away. It is implemented as follows:
#
# case 1: assertion failure
# i) create and insert into temporary table on master
# ii) sync slave with master
# iii) stop and restart slave
# iv) insert into master another value
# v) sync slave with master
#
#
# case 2: crash (SIGSEV)
# i) create and insert into temporary table on master (insert
# produces warnings)
# ii) sync slave with master
# iii) stop and restart slave
# iv) insert into master more values
# v) sync slave with master
# case 1: Assertion in Field_string::store() failed because current
# thread reference differed from table->in_use after slave
# restart
connection
master
;
disable_warnings
;
DROP
TABLE
IF
EXISTS
t1
;
enable_warnings
;
CREATE
TEMPORARY
TABLE
t1
(
a
char
(
1
));
INSERT
INTO
t1
VALUES
(
'a'
);
sync_slave_with_master
;
source
include
/
stop_slave
.
inc
;
source
include
/
start_slave
.
inc
;
connection
master
;
INSERT
INTO
t1
VALUES
(
'b'
);
sync_slave_with_master
;
# case 2: crash on sp_rcontext::find_handler because it used
# reference to invalid THD object after slave restart
connection
master
;
disable_warnings
;
DROP
TABLE
IF
EXISTS
t1
;
enable_warnings
;
CREATE
TEMPORARY
TABLE
`t1`
(
`a`
tinyint
,
`b`
char
(
1
))
engine
=
myisam
;
INSERT
INTO
`t1`
set
`a`
=
128
,
`b`
=
'128'
;
sync_slave_with_master
;
source
include
/
stop_slave
.
inc
;
source
include
/
start_slave
.
inc
;
connection
master
;
INSERT
INTO
`t1`
set
`a`
=
128
,
`b`
=
'128'
;
sync_slave_with_master
;
# cleanup
connection
master
;
DROP
TABLE
t1
;
sync_slave_with_master
;
connection
master
;
connection
master
;
connect
(
con1
,
localhost
,
root
,,);
connect
(
con1
,
localhost
,
root
,,);
...
...
sql/slave.cc
View file @
e2aad850
...
@@ -389,6 +389,13 @@ void init_slave_skip_errors(const char* arg)
...
@@ -389,6 +389,13 @@ void init_slave_skip_errors(const char* arg)
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
static
void
set_thd_in_use_temporary_tables
(
Relay_log_info
*
rli
)
{
TABLE
*
table
;
for
(
table
=
rli
->
save_temporary_tables
;
table
;
table
=
table
->
next
)
table
->
in_use
=
rli
->
sql_thd
;
}
int
terminate_slave_threads
(
Master_info
*
mi
,
int
thread_mask
,
bool
skip_lock
)
int
terminate_slave_threads
(
Master_info
*
mi
,
int
thread_mask
,
bool
skip_lock
)
{
{
...
@@ -2757,6 +2764,7 @@ pthread_handler_t handle_slave_sql(void *arg)
...
@@ -2757,6 +2764,7 @@ pthread_handler_t handle_slave_sql(void *arg)
}
}
thd
->
init_for_queries
();
thd
->
init_for_queries
();
thd
->
temporary_tables
=
rli
->
save_temporary_tables
;
// restore temp tables
thd
->
temporary_tables
=
rli
->
save_temporary_tables
;
// restore temp tables
set_thd_in_use_temporary_tables
(
rli
);
// (re)set sql_thd in use for saved temp tables
pthread_mutex_lock
(
&
LOCK_thread_count
);
pthread_mutex_lock
(
&
LOCK_thread_count
);
threads
.
append
(
thd
);
threads
.
append
(
thd
);
pthread_mutex_unlock
(
&
LOCK_thread_count
);
pthread_mutex_unlock
(
&
LOCK_thread_count
);
...
@@ -3003,6 +3011,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
...
@@ -3003,6 +3011,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
DBUG_ASSERT
(
rli
->
sql_thd
==
thd
);
DBUG_ASSERT
(
rli
->
sql_thd
==
thd
);
THD_CHECK_SENTRY
(
thd
);
THD_CHECK_SENTRY
(
thd
);
rli
->
sql_thd
=
0
;
rli
->
sql_thd
=
0
;
set_thd_in_use_temporary_tables
(
rli
);
// (re)set sql_thd in use for saved temp tables
pthread_mutex_lock
(
&
LOCK_thread_count
);
pthread_mutex_lock
(
&
LOCK_thread_count
);
THD_CHECK_SENTRY
(
thd
);
THD_CHECK_SENTRY
(
thd
);
delete
thd
;
delete
thd
;
...
...
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