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
a5e8bce1
Commit
a5e8bce1
authored
Jun 23, 2005
by
lenz@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/space/my/mysql-4.1
parents
cacb7199
53761ce0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
218 additions
and
10 deletions
+218
-10
mysql-test/r/rpl_multi_update3.result
mysql-test/r/rpl_multi_update3.result
+81
-0
mysql-test/t/rpl_multi_update3.test
mysql-test/t/rpl_multi_update3.test
+129
-4
mysys/my_access.c
mysys/my_access.c
+7
-5
sql/item.h
sql/item.h
+1
-1
No files found.
mysql-test/r/rpl_multi_update3.result
View file @
a5e8bce1
...
...
@@ -4,6 +4,8 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-------- Test for BUG#9361 --------
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
...
...
@@ -41,3 +43,82 @@ a b
1 6
2 6
drop table t1,t2;
-------- Test 1 for BUG#9361 --------
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
a1 char(30),
a2 int,
a3 int,
a4 char(30),
a5 char(30)
);
CREATE TABLE t2 (
b1 int,
b2 char(30)
);
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
INSERT INTO t2 VALUES (1, 'baz');
UPDATE t1 a, t2
SET a.a1 = 'No'
WHERE a.a2 =
(SELECT b1
FROM t2
WHERE b2 = 'baz')
AND a.a3 IS NULL
AND a.a4 = 'foo'
AND a.a5 = 'bar';
SELECT * FROM t1;
a1 a2 a3 a4 a5
No 1 NULL foo bar
SELECT * FROM t2;
b1 b2
1 baz
DROP TABLE t1, t2;
-------- Test 2 for BUG#9361 --------
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
CREATE TABLE t1 (
i INT,
j INT,
x INT,
y INT,
z INT
);
CREATE TABLE t2 (
i INT,
k INT,
x INT,
y INT,
z INT
);
CREATE TABLE t3 (
j INT,
k INT,
x INT,
y INT,
z INT
);
INSERT INTO t1 VALUES ( 1, 2,13,14,15);
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
UPDATE t1 AS a
INNER JOIN t2 AS b
ON a.i = b.i
INNER JOIN t3 AS c
ON a.j = c.j AND b.k = c.k
SET a.x = b.x,
a.y = b.y,
a.z = (
SELECT sum(z)
FROM t3
WHERE y = 34
)
WHERE b.x = 23;
SELECT * FROM t1;
i j x y z
1 2 23 24 71
DROP TABLE t1, t2, t3;
mysql-test/t/rpl_multi_update3.test
View file @
a5e8bce1
source
include
/
master
-
slave
.
inc
;
##############################################################################
#
# Let's verify that multi-update with a subselect does not cause the slave to crash
# (BUG#10442)
source
include
/
master
-
slave
.
inc
;
#
--
disable_query_log
SELECT
'-------- Test for BUG#9361 --------'
as
""
;
--
enable_query_log
CREATE
TABLE
t1
(
a
int
unsigned
not
null
auto_increment
primary
key
,
...
...
@@ -25,10 +31,129 @@ UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
s
ave_master_pos
;
s
ync_slave_with_master
;
connection
slave
;
sync_with_master
;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
connection
master
;
drop
table
t1
,
t2
;
##############################################################################
#
# Test for BUG#9361:
# Subselects should work inside multi-updates
#
--
disable_query_log
SELECT
'-------- Test 1 for BUG#9361 --------'
as
""
;
--
enable_query_log
connection
master
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
a1
char
(
30
),
a2
int
,
a3
int
,
a4
char
(
30
),
a5
char
(
30
)
);
CREATE
TABLE
t2
(
b1
int
,
b2
char
(
30
)
);
# Insert one row per table
INSERT
INTO
t1
VALUES
(
'Yes'
,
1
,
NULL
,
'foo'
,
'bar'
);
INSERT
INTO
t2
VALUES
(
1
,
'baz'
);
# This should update the row in t1
UPDATE
t1
a
,
t2
SET
a
.
a1
=
'No'
WHERE
a
.
a2
=
(
SELECT
b1
FROM
t2
WHERE
b2
=
'baz'
)
AND
a
.
a3
IS
NULL
AND
a
.
a4
=
'foo'
AND
a
.
a5
=
'bar'
;
sync_slave_with_master
;
connection
slave
;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t2
;
connection
master
;
DROP
TABLE
t1
,
t2
;
##############################################################################
#
# Second test for BUG#9361
#
--
disable_query_log
SELECT
'-------- Test 2 for BUG#9361 --------'
as
""
;
--
enable_query_log
connection
master
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t2
;
DROP
TABLE
IF
EXISTS
t3
;
--
enable_warnings
CREATE
TABLE
t1
(
i
INT
,
j
INT
,
x
INT
,
y
INT
,
z
INT
);
CREATE
TABLE
t2
(
i
INT
,
k
INT
,
x
INT
,
y
INT
,
z
INT
);
CREATE
TABLE
t3
(
j
INT
,
k
INT
,
x
INT
,
y
INT
,
z
INT
);
INSERT
INTO
t1
VALUES
(
1
,
2
,
13
,
14
,
15
);
INSERT
INTO
t2
VALUES
(
1
,
3
,
23
,
24
,
25
);
INSERT
INTO
t3
VALUES
(
2
,
3
,
1
,
34
,
35
),
(
2
,
3
,
1
,
34
,
36
);
UPDATE
t1
AS
a
INNER
JOIN
t2
AS
b
ON
a
.
i
=
b
.
i
INNER
JOIN
t3
AS
c
ON
a
.
j
=
c
.
j
AND
b
.
k
=
c
.
k
SET
a
.
x
=
b
.
x
,
a
.
y
=
b
.
y
,
a
.
z
=
(
SELECT
sum
(
z
)
FROM
t3
WHERE
y
=
34
)
WHERE
b
.
x
=
23
;
sync_slave_with_master
;
connection
slave
;
SELECT
*
FROM
t1
;
connection
master
;
DROP
TABLE
t1
,
t2
,
t3
;
mysys/my_access.c
View file @
a5e8bce1
...
...
@@ -93,18 +93,20 @@ int check_if_legal_filename(const char *path)
path
+=
dirname_length
(
path
);
/* To start of filename */
if
(
!
(
end
=
strchr
(
path
,
FN_EXTCHAR
)))
end
=
strend
(
path
);
if
(
path
==
end
||
(
uint
)
(
path
-
end
)
>
MAX_RESERVED_NAME_LENGTH
)
if
(
path
==
end
||
(
uint
)
(
end
-
path
)
>
MAX_RESERVED_NAME_LENGTH
)
DBUG_RETURN
(
0
);
/* Simplify inner loop */
for
(
reserved_name
=
reserved_names
;
*
reserved_name
;
reserved_name
++
)
{
const
char
*
name
=
path
;
while
(
name
!=
end
)
const
char
*
current_reserved_name
=
*
reserved_name
;
while
(
name
!=
end
&&
*
current_reserved_name
)
{
if
(
my_toupper
(
&
my_charset_latin1
,
*
path
)
!=
my_toupper
(
&
my_charset_latin1
,
*
name
))
if
(
*
current_reserved_name
!=
my_toupper
(
&
my_charset_latin1
,
*
name
))
break
;
if
(
name
++
==
end
)
current_reserved_name
++
;
if
(
++
name
==
end
)
DBUG_RETURN
(
1
);
/* Found wrong path */
}
}
...
...
sql/item.h
View file @
a5e8bce1
...
...
@@ -336,7 +336,7 @@ public:
virtual
bool
set_flags_processor
(
byte
*
args
)
{
this
->
item_flags
|=
*
((
uint8
*
)
args
);
return
tru
e
;
return
fals
e
;
}
};
...
...
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