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
a7739162
Commit
a7739162
authored
Mar 17, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).
parent
c5478c4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
mysql-test/r/update.result
mysql-test/r/update.result
+7
-0
mysql-test/t/update.test
mysql-test/t/update.test
+10
-0
sql/key.cc
sql/key.cc
+1
-1
No files found.
mysql-test/r/update.result
View file @
a7739162
...
...
@@ -209,3 +209,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
drop table t1, t2;
create table t1 (a int, b char(255), key(a, b(20)));
insert into t1 values (0, '1');
update t1 set b = b + 1 where a = 0;
select * from t1;
a b
0 2
drop table t1;
mysql-test/t/update.test
View file @
a7739162
...
...
@@ -164,3 +164,13 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
where
t1
.
c3
=
10
;
drop
table
t1
,
t2
;
#
# Bug #8942: a problem with update and partial key part
#
create
table
t1
(
a
int
,
b
char
(
255
),
key
(
a
,
b
(
20
)));
insert
into
t1
values
(
0
,
'1'
);
update
t1
set
b
=
b
+
1
where
a
=
0
;
select
*
from
t1
;
drop
table
t1
;
sql/key.cc
View file @
a7739162
...
...
@@ -265,7 +265,7 @@ bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields)
f
.
rewind
();
while
((
field
=
(
Item_field
*
)
f
++
))
{
if
(
key_part
->
field
==
field
->
field
)
if
(
key_part
->
field
->
eq
(
field
->
field
)
)
return
1
;
}
}
...
...
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