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
246b4be0
Commit
246b4be0
authored
Dec 17, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
BUG#46166
Automerge from mysql-5.1-bugteam.
parents
b4fe0e0c
4c0c5525
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
11 deletions
+33
-11
mysql-test/suite/binlog/r/binlog_index.result
mysql-test/suite/binlog/r/binlog_index.result
+2
-2
mysql-test/suite/binlog/t/binlog_index.test
mysql-test/suite/binlog/t/binlog_index.test
+2
-0
mysql-test/suite/rpl/r/rpl_binlog_errors.result
mysql-test/suite/rpl/r/rpl_binlog_errors.result
+6
-6
mysql-test/suite/rpl/t/rpl_binlog_errors.test
mysql-test/suite/rpl/t/rpl_binlog_errors.test
+5
-3
sql/log.cc
sql/log.cc
+18
-0
No files found.
mysql-test/suite/binlog/r/binlog_index.result
View file @
246b4be0
...
@@ -132,7 +132,7 @@ master-bin.000011
...
@@ -132,7 +132,7 @@ master-bin.000011
# fault_injection_registering_index
# fault_injection_registering_index
SET SESSION debug="+d,fault_injection_registering_index";
SET SESSION debug="+d,fault_injection_registering_index";
flush logs;
flush logs;
ERROR HY000: Can't open file: '
./
master-bin.000012' (errno: 1)
ERROR HY000: Can't open file: 'master-bin.000012' (errno: 1)
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
SELECT @index;
@index
@index
...
@@ -157,7 +157,7 @@ master-bin.000012
...
@@ -157,7 +157,7 @@ master-bin.000012
# fault_injection_updating_index
# fault_injection_updating_index
SET SESSION debug="+d,fault_injection_updating_index";
SET SESSION debug="+d,fault_injection_updating_index";
flush logs;
flush logs;
ERROR HY000: Can't open file: '
./
master-bin.000013' (errno: 1)
ERROR HY000: Can't open file: 'master-bin.000013' (errno: 1)
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
SELECT @index;
@index
@index
...
...
mysql-test/suite/binlog/t/binlog_index.test
View file @
246b4be0
...
@@ -218,6 +218,7 @@ SELECT @index;
...
@@ -218,6 +218,7 @@ SELECT @index;
--
echo
# fault_injection_registering_index
--
echo
# fault_injection_registering_index
SET
SESSION
debug
=
"+d,fault_injection_registering_index"
;
SET
SESSION
debug
=
"+d,fault_injection_registering_index"
;
--
replace_regex
/
\
.
[
\\\
/
]
master
/
master
/
--
error
ER_CANT_OPEN_FILE
--
error
ER_CANT_OPEN_FILE
flush
logs
;
flush
logs
;
...
@@ -237,6 +238,7 @@ SELECT @index;
...
@@ -237,6 +238,7 @@ SELECT @index;
--
echo
# fault_injection_updating_index
--
echo
# fault_injection_updating_index
SET
SESSION
debug
=
"+d,fault_injection_updating_index"
;
SET
SESSION
debug
=
"+d,fault_injection_updating_index"
;
--
replace_regex
/
\
.
[
\\\
/
]
master
/
master
/
--
error
ER_CANT_OPEN_FILE
--
error
ER_CANT_OPEN_FILE
flush
logs
;
flush
logs
;
...
...
mysql-test/suite/rpl/r/rpl_binlog_errors.result
View file @
246b4be0
...
@@ -35,9 +35,9 @@ master-bin.000001 #
...
@@ -35,9 +35,9 @@ master-bin.000001 #
SET GLOBAL debug="";
SET GLOBAL debug="";
RESET MASTER;
RESET MASTER;
###################### TEST #3
###################### TEST #3
CREATE TABLE t1 (a
int
);
CREATE TABLE t1 (a
INT
);
CREATE TABLE t2 (a
TEXT
) Engine=InnoDB;
CREATE TABLE t2 (a
VARCHAR(16384)
) Engine=InnoDB;
CREATE TABLE t4 (a
TEXT
);
CREATE TABLE t4 (a
VARCHAR(16384)
);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
RESET MASTER;
RESET MASTER;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
...
@@ -181,7 +181,7 @@ SHOW WARNINGS;
...
@@ -181,7 +181,7 @@ SHOW WARNINGS;
Level Code Message
Level Code Message
SET GLOBAL debug="+d,fault_injection_registering_index";
SET GLOBAL debug="+d,fault_injection_registering_index";
FLUSH LOGS;
FLUSH LOGS;
ERROR HY000: Can't open file: '
./
master-bin.000002' (errno: 1)
ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1)
SET GLOBAL debug="-d,fault_injection_registering_index";
SET GLOBAL debug="-d,fault_injection_registering_index";
SHOW BINARY LOGS;
SHOW BINARY LOGS;
ERROR HY000: You are not using binary logging
ERROR HY000: You are not using binary logging
...
@@ -194,7 +194,7 @@ DROP TABLE t5;
...
@@ -194,7 +194,7 @@ DROP TABLE t5;
###################### TEST #11
###################### TEST #11
SET GLOBAL debug="+d,fault_injection_openning_index";
SET GLOBAL debug="+d,fault_injection_openning_index";
FLUSH LOGS;
FLUSH LOGS;
ERROR HY000: Can't open file: '
./
master-bin.index' (errno: 1)
ERROR HY000: Can't open file: 'master-bin.index' (errno: 1)
SET GLOBAL debug="-d,fault_injection_openning_index";
SET GLOBAL debug="-d,fault_injection_openning_index";
RESET MASTER;
RESET MASTER;
ERROR HY000: Binlog closed, cannot RESET MASTER
ERROR HY000: Binlog closed, cannot RESET MASTER
...
@@ -207,7 +207,7 @@ DROP TABLE t5;
...
@@ -207,7 +207,7 @@ DROP TABLE t5;
###################### TEST #12
###################### TEST #12
SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
FLUSH LOGS;
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin' (errno:
0
)
ERROR HY000: Can't open file: 'master-bin' (errno:
2
)
SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
RESET MASTER;
RESET MASTER;
ERROR HY000: Binlog closed, cannot RESET MASTER
ERROR HY000: Binlog closed, cannot RESET MASTER
...
...
mysql-test/suite/rpl/t/rpl_binlog_errors.test
View file @
246b4be0
...
@@ -82,9 +82,9 @@ RESET MASTER;
...
@@ -82,9 +82,9 @@ RESET MASTER;
### ACTION: create some tables (t1, t2, t4) and insert some values in
### ACTION: create some tables (t1, t2, t4) and insert some values in
### table t1
### table t1
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
TEXT
)
Engine
=
InnoDB
;
CREATE
TABLE
t2
(
a
VARCHAR
(
16384
)
)
Engine
=
InnoDB
;
CREATE
TABLE
t4
(
a
TEXT
);
CREATE
TABLE
t4
(
a
VARCHAR
(
16384
)
);
INSERT
INTO
t1
VALUES
(
1
);
INSERT
INTO
t1
VALUES
(
1
);
RESET
MASTER
;
RESET
MASTER
;
...
@@ -272,6 +272,7 @@ SHOW WARNINGS;
...
@@ -272,6 +272,7 @@ SHOW WARNINGS;
# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
SET
GLOBAL
debug
=
"+d,fault_injection_registering_index"
;
SET
GLOBAL
debug
=
"+d,fault_injection_registering_index"
;
--
replace_regex
/
\
.
[
\\\
/
]
master
/
master
/
--
error
ER_CANT_OPEN_FILE
--
error
ER_CANT_OPEN_FILE
FLUSH
LOGS
;
FLUSH
LOGS
;
SET
GLOBAL
debug
=
"-d,fault_injection_registering_index"
;
SET
GLOBAL
debug
=
"-d,fault_injection_registering_index"
;
...
@@ -298,6 +299,7 @@ DROP TABLE t5;
...
@@ -298,6 +299,7 @@ DROP TABLE t5;
# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
SET
GLOBAL
debug
=
"+d,fault_injection_openning_index"
;
SET
GLOBAL
debug
=
"+d,fault_injection_openning_index"
;
--
replace_regex
/
\
.
[
\\\
/
]
master
/
master
/
--
error
ER_CANT_OPEN_FILE
--
error
ER_CANT_OPEN_FILE
FLUSH
LOGS
;
FLUSH
LOGS
;
SET
GLOBAL
debug
=
"-d,fault_injection_openning_index"
;
SET
GLOBAL
debug
=
"-d,fault_injection_openning_index"
;
...
...
sql/log.cc
View file @
246b4be0
...
@@ -2976,6 +2976,23 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
...
@@ -2976,6 +2976,23 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
sync_purge_index_file
()
||
sync_purge_index_file
()
||
DBUG_EVALUATE_IF
(
"fault_injection_registering_index"
,
1
,
0
))
DBUG_EVALUATE_IF
(
"fault_injection_registering_index"
,
1
,
0
))
{
{
/**
TODO: although this was introduced to appease valgrind
when injecting emulated faults using fault_injection_registering_index
it may be good to consider what actually happens when
open_purge_index_file succeeds but register or sync fails.
Perhaps we might need the code below in MYSQL_LOG_BIN::cleanup
for "real life" purposes as well?
*/
DBUG_EXECUTE_IF
(
"fault_injection_registering_index"
,
{
if
(
my_b_inited
(
&
purge_index_file
))
{
end_io_cache
(
&
purge_index_file
);
my_close
(
purge_index_file
.
file
,
MYF
(
0
));
}
});
sql_print_error
(
"MSYQL_BIN_LOG::open failed to sync the index file."
);
sql_print_error
(
"MSYQL_BIN_LOG::open failed to sync the index file."
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
@@ -4219,6 +4236,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock)
...
@@ -4219,6 +4236,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock)
if
(
DBUG_EVALUATE_IF
(
"fault_injection_new_file_rotate_event"
,
(
error
=
close_on_error
=
TRUE
),
FALSE
)
||
if
(
DBUG_EVALUATE_IF
(
"fault_injection_new_file_rotate_event"
,
(
error
=
close_on_error
=
TRUE
),
FALSE
)
||
(
error
=
r
.
write
(
&
log_file
)))
(
error
=
r
.
write
(
&
log_file
)))
{
{
DBUG_EXECUTE_IF
(
"fault_injection_new_file_rotate_event"
,
errno
=
2
;);
close_on_error
=
TRUE
;
close_on_error
=
TRUE
;
my_printf_error
(
ER_ERROR_ON_WRITE
,
ER
(
ER_CANT_OPEN_FILE
),
MYF
(
ME_FATALERROR
),
name
,
errno
);
my_printf_error
(
ER_ERROR_ON_WRITE
,
ER
(
ER_CANT_OPEN_FILE
),
MYF
(
ME_FATALERROR
),
name
,
errno
);
goto
end
;
goto
end
;
...
...
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