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
0fdd3dce
Commit
0fdd3dce
authored
Jan 11, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for bug#17711
parents
10698df6
66179638
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
mysql-test/r/delete.result
mysql-test/r/delete.result
+7
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+10
-0
sql/sql_delete.cc
sql/sql_delete.cc
+1
-1
No files found.
mysql-test/r/delete.result
View file @
0fdd3dce
...
...
@@ -186,4 +186,11 @@ select count(*) from t1;
count(*)
0
drop table t1;
create table t1(f1 int primary key);
insert into t1 values (4),(3),(1),(2);
delete from t1 where (@a:= f1) order by f1 limit 1;
select @a;
@a
1
drop table t1;
End of 4.1 tests
mysql-test/t/delete.test
View file @
0fdd3dce
...
...
@@ -174,4 +174,14 @@ delete from t1 where a is null;
select
count
(
*
)
from
t1
;
drop
table
t1
;
#
# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
# non-restricting WHERE is present.
#
create
table
t1
(
f1
int
primary
key
);
insert
into
t1
values
(
4
),(
3
),(
1
),(
2
);
delete
from
t1
where
(
@
a
:=
f1
)
order
by
f1
limit
1
;
select
@
a
;
drop
table
t1
;
--
echo
End
of
4.1
tests
sql/sql_delete.cc
View file @
0fdd3dce
...
...
@@ -142,7 +142,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_RETURN
(
-
1
);
// This will force out message
}
if
(
!
select
&&
limit
!=
HA_POS_ERROR
)
if
(
(
!
select
||
table
->
quick_keys
.
is_clear_all
())
&&
limit
!=
HA_POS_ERROR
)
usable_index
=
get_index_for_order
(
table
,
(
ORDER
*
)(
order
->
first
),
limit
);
if
(
usable_index
==
MAX_KEY
)
...
...
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