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
129efd6a
Commit
129efd6a
authored
Mar 20, 2008
by
svoj@june.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/svoj/devel/bk/mysql-5.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG34768/mysql-5.1-engines
parents
65992efc
6dfb184f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
2 deletions
+90
-2
mysql-test/suite/binlog/r/binlog_stm_ps.result
mysql-test/suite/binlog/r/binlog_stm_ps.result
+2
-1
mysql-test/suite/binlog/r/binlog_unsafe.result
mysql-test/suite/binlog/r/binlog_unsafe.result
+28
-0
mysql-test/suite/binlog/t/binlog_unsafe.test
mysql-test/suite/binlog/t/binlog_unsafe.test
+21
-1
sql/sql_delete.cc
sql/sql_delete.cc
+13
-0
sql/sql_insert.cc
sql/sql_insert.cc
+13
-0
sql/sql_update.cc
sql/sql_update.cc
+13
-0
No files found.
mysql-test/suite/binlog/r/binlog_stm_ps.result
View file @
129efd6a
...
...
@@ -16,5 +16,6 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # User var # # @`a`=98
master-bin.000001 # Query # # use `test`; insert into t1 values (@a),(98)
master-bin.000001 # Query # # use `test`; insert into t1 values (99)
master-bin.000001 # Query # # use `test`; insert into t1 select 100 limit 100
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
drop table t1;
mysql-test/suite/binlog/r/binlog_unsafe.result
View file @
129efd6a
...
...
@@ -11,3 +11,31 @@ Level Warning
Code 1592
Message Statement is not safe to log in statement format.
DROP TABLE t1,t2,t3;
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
DELETE FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
CREATE PROCEDURE p1()
BEGIN
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
UPDATE t1 SET a=1 LIMIT 1;
DELETE FROM t1 LIMIT 1;
END|
CALL p1();
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
mysql-test/suite/binlog/t/binlog_unsafe.test
View file @
129efd6a
...
...
@@ -15,4 +15,24 @@ query_vertical SHOW WARNINGS;
DROP
TABLE
t1
,
t2
,
t3
;
#
# BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode if
# binlog_format=mixed
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
KEY
(
a
),
PRIMARY
KEY
(
b
));
INSERT
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
REPLACE
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
UPDATE
t1
SET
a
=
1
LIMIT
1
;
DELETE
FROM
t1
LIMIT
1
;
delimiter
|
;
CREATE
PROCEDURE
p1
()
BEGIN
INSERT
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
REPLACE
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
UPDATE
t1
SET
a
=
1
LIMIT
1
;
DELETE
FROM
t1
LIMIT
1
;
END
|
delimiter
;
|
CALL
p1
();
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
sql/sql_delete.cc
View file @
129efd6a
...
...
@@ -418,6 +418,19 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
DBUG_ENTER
(
"mysql_prepare_delete"
);
List
<
Item
>
all_fields
;
/*
Statement-based replication of DELETE ... LIMIT is not safe as order of
rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present. However it may confuse users to see very similiar statements
replicated differently.
*/
if
(
thd
->
lex
->
current_select
->
select_limit
)
{
thd
->
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
thd
->
lex
->
allow_sum_func
=
0
;
if
(
setup_tables_and_check_access
(
thd
,
&
thd
->
lex
->
select_lex
.
context
,
&
thd
->
lex
->
select_lex
.
top_join_list
,
...
...
sql/sql_insert.cc
View file @
129efd6a
...
...
@@ -2763,6 +2763,19 @@ bool mysql_insert_select_prepare(THD *thd)
TABLE_LIST
*
first_select_leaf_table
;
DBUG_ENTER
(
"mysql_insert_select_prepare"
);
/*
Statement-based replication of INSERT ... SELECT ... LIMIT is not safe
as order of rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present or we SELECT a constant. However it may confuse users to
see very similiar statements replicated differently.
*/
if
(
lex
->
current_select
->
select_limit
)
{
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
/*
SELECT_LEX do not belong to INSERT statement, so we can't add WHERE
clause if table is VIEW
...
...
sql/sql_update.cc
View file @
129efd6a
...
...
@@ -859,6 +859,19 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
SELECT_LEX
*
select_lex
=
&
thd
->
lex
->
select_lex
;
DBUG_ENTER
(
"mysql_prepare_update"
);
/*
Statement-based replication of UPDATE ... LIMIT is not safe as order of
rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present. However it may confuse users to see very similiar statements
replicated differently.
*/
if
(
thd
->
lex
->
current_select
->
select_limit
)
{
thd
->
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list
->
grant
.
want_privilege
=
table
->
grant
.
want_privilege
=
(
SELECT_ACL
&
~
table
->
grant
.
privilege
);
...
...
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