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
6d6e107f
Commit
6d6e107f
authored
Oct 14, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- set 'updating' in both tables list if we have two of them (because of subquery) (BUG#13236)
- fixed test
parent
829a4831
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
mysql-test/r/rpl_multi_update2.result
mysql-test/r/rpl_multi_update2.result
+13
-0
mysql-test/t/rpl_multi_update2.test
mysql-test/t/rpl_multi_update2.test
+27
-0
sql/sql_update.cc
sql/sql_update.cc
+6
-2
No files found.
mysql-test/r/rpl_multi_update2.result
View file @
6d6e107f
...
@@ -4,6 +4,7 @@ reset master;
...
@@ -4,6 +4,7 @@ reset master;
reset slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
start slave;
drop table if exists t1,t2;
CREATE TABLE t1 (
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
a int unsigned not null auto_increment primary key,
b int unsigned
b int unsigned
...
@@ -40,3 +41,15 @@ SELECT * FROM t2 ORDER BY a;
...
@@ -40,3 +41,15 @@ SELECT * FROM t2 ORDER BY a;
a b
a b
1 0
1 0
2 1
2 1
drop table t1,t2;
reset master;
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (0);
UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
select * from t1;
a
3
select * from t1;
a
3
drop table t1;
mysql-test/t/rpl_multi_update2.test
View file @
6d6e107f
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
source
include
/
master
-
slave
.
inc
;
source
include
/
master
-
slave
.
inc
;
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
CREATE
TABLE
t1
(
a
int
unsigned
not
null
auto_increment
primary
key
,
a
int
unsigned
not
null
auto_increment
primary
key
,
b
int
unsigned
b
int
unsigned
...
@@ -32,4 +36,27 @@ sync_with_master;
...
@@ -32,4 +36,27 @@ sync_with_master;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
connection
master
;
drop
table
t1
,
t2
;
sync_slave_with_master
;
#
# BUG#13236 multi-update with subquery & --replicate-ignore-table
#
reset
master
;
connection
master
;
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
0
);
UPDATE
t1
,
(
SELECT
3
as
b
)
AS
x
SET
t1
.
a
=
x
.
b
;
select
*
from
t1
;
sync_slave_with_master
;
connection
slave
;
select
*
from
t1
;
connection
master
;
drop
table
t1
;
sync_slave_with_master
;
# End of 4.1 tests
# End of 4.1 tests
sql/sql_update.cc
View file @
6d6e107f
...
@@ -569,7 +569,9 @@ int mysql_multi_update_lock(THD *thd,
...
@@ -569,7 +569,9 @@ int mysql_multi_update_lock(THD *thd,
}
}
DBUG_PRINT
(
"info"
,(
"setting table `%s` for update"
,
tl
->
alias
));
DBUG_PRINT
(
"info"
,(
"setting table `%s` for update"
,
tl
->
alias
));
tl
->
lock_type
=
thd
->
lex
->
multi_lock_option
;
tl
->
lock_type
=
thd
->
lex
->
multi_lock_option
;
tl
->
updating
=
1
;
tl
->
updating
=
1
;
// loacal or only list
if
(
tl
->
table_list
)
tl
->
table_list
->
updating
=
1
;
// global list (if we have 2 lists)
wants
=
UPDATE_ACL
;
wants
=
UPDATE_ACL
;
}
}
else
else
...
@@ -579,7 +581,9 @@ int mysql_multi_update_lock(THD *thd,
...
@@ -579,7 +581,9 @@ int mysql_multi_update_lock(THD *thd,
// correct order of statements. Otherwise, we use a TL_READ lock to
// correct order of statements. Otherwise, we use a TL_READ lock to
// improve performance.
// improve performance.
tl
->
lock_type
=
using_update_log
?
TL_READ_NO_INSERT
:
TL_READ
;
tl
->
lock_type
=
using_update_log
?
TL_READ_NO_INSERT
:
TL_READ
;
tl
->
updating
=
0
;
tl
->
updating
=
0
;
// loacal or only list
if
(
tl
->
table_list
)
tl
->
table_list
->
updating
=
0
;
// global list (if we have 2 lists)
wants
=
SELECT_ACL
;
wants
=
SELECT_ACL
;
}
}
...
...
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