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
40e87bcf
Commit
40e87bcf
authored
Jun 29, 2009
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
merge: 5.1-bt bug branch --> 5.1-bt latest
parents
db044ad9
92956ef6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
1 deletion
+107
-1
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
+30
-0
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt
...-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt
+1
-0
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
+73
-0
sql/sql_class.cc
sql/sql_class.cc
+3
-1
No files found.
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
0 → 100644
View file @
40e87bcf
### NOT filtered database => assertion: warnings ARE shown
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a int, b int, primary key (a));
INSERT INTO t1 VALUES (1,2), (2,3);
UPDATE t1 SET b='4' WHERE a=1 LIMIT 1;
Warnings:
Note 1592 Statement may not be safe to log in statement format.
UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1;
Warnings:
Note 1592 Statement may not be safe to log in statement format.
DROP TABLE t1;
### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown
SET SQL_LOG_BIN= 0;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a int, b int, primary key (a));
INSERT INTO t1 VALUES (1,2), (2,3);
UPDATE t1 SET b='4' WHERE a=1 LIMIT 1;
UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1;
DROP TABLE t1;
SET SQL_LOG_BIN= 1;
### FILTERED database => assertion: warnings ARE NOT shown
CREATE DATABASE b42851;
USE b42851;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a int, b int, primary key (a));
INSERT INTO t1 VALUES (1,2), (2,3);
UPDATE t1 SET b='4' WHERE a=1 LIMIT 1;
UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1;
DROP TABLE t1;
DROP DATABASE b42851;
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt
0 → 100644
View file @
40e87bcf
--binlog-ignore-db=b42851
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
0 → 100644
View file @
40e87bcf
# BUG#42851: Spurious "Statement is not safe to log in statement
# format." warnings
#
# WHY
# ===
#
# This test aims at checking that the fix that removes spurious
# entries in the error log when the statement is filtered out from
# binlog, is working.
#
# HOW
# ===
#
# The test case is split into three assertions when issuing statements
# containing LIMIT and ORDER BY:
#
# i) issue statements in database that is not filtered => check
# that warnings ARE shown;
#
# ii) issue statements in database that is not filtered, but with
# binlog disabled => check that warnings ARE NOT shown;
#
# iii) issue statements in database that is filtered => check that
# warnings ARE NOT shown.
--
source
include
/
have_log_bin
.
inc
--
source
include
/
have_binlog_format_statement
.
inc
--
echo
### NOT filtered database => assertion: warnings ARE shown
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
,
b
int
,
primary
key
(
a
));
INSERT
INTO
t1
VALUES
(
1
,
2
),
(
2
,
3
);
UPDATE
t1
SET
b
=
'4'
WHERE
a
=
1
LIMIT
1
;
UPDATE
t1
SET
b
=
'5'
WHERE
a
=
2
ORDER
BY
a
LIMIT
1
;
DROP
TABLE
t1
;
--
echo
### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown
SET
SQL_LOG_BIN
=
0
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
,
b
int
,
primary
key
(
a
));
INSERT
INTO
t1
VALUES
(
1
,
2
),
(
2
,
3
);
UPDATE
t1
SET
b
=
'4'
WHERE
a
=
1
LIMIT
1
;
UPDATE
t1
SET
b
=
'5'
WHERE
a
=
2
ORDER
BY
a
LIMIT
1
;
DROP
TABLE
t1
;
SET
SQL_LOG_BIN
=
1
;
--
echo
### FILTERED database => assertion: warnings ARE NOT shown
CREATE
DATABASE
b42851
;
USE
b42851
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
,
b
int
,
primary
key
(
a
));
INSERT
INTO
t1
VALUES
(
1
,
2
),
(
2
,
3
);
UPDATE
t1
SET
b
=
'4'
WHERE
a
=
1
LIMIT
1
;
UPDATE
t1
SET
b
=
'5'
WHERE
a
=
2
ORDER
BY
a
LIMIT
1
;
DROP
TABLE
t1
;
# clean up
DROP
DATABASE
b42851
;
sql/sql_class.cc
View file @
40e87bcf
...
...
@@ -27,6 +27,7 @@
#include "mysql_priv.h"
#include "rpl_rli.h"
#include "rpl_filter.h"
#include "rpl_record.h"
#include "slave.h"
#include <my_bitmap.h>
...
...
@@ -3684,7 +3685,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
we should print a warning.
*/
if
(
sql_log_bin_toplevel
&&
lex
->
is_stmt_unsafe
()
&&
variables
.
binlog_format
==
BINLOG_FORMAT_STMT
)
variables
.
binlog_format
==
BINLOG_FORMAT_STMT
&&
binlog_filter
->
db_ok
(
this
->
db
))
{
/*
A warning can be elevated a error when STRICT sql mode.
...
...
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