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
d276ce34
Commit
d276ce34
authored
Sep 11, 2007
by
sergefp@pylon.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/psergey/mysql-4.1-bug30385
into mysql.com:/home/psergey/mysql-5.0-bug30385
parents
d330a491
da04109d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/delete.result
mysql-test/r/delete.result
+12
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+13
-0
sql/opt_range.cc
sql/opt_range.cc
+2
-1
No files found.
mysql-test/r/delete.result
View file @
d276ce34
...
...
@@ -183,6 +183,18 @@ select @a;
@a
1
drop table t1;
CREATE TABLE t1 (
`date` date ,
`time` time ,
`seq` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`seq`),
KEY `seq` (`seq`),
KEY `time` (`time`),
KEY `date` (`date`)
);
DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1;
drop table t1;
End of 4.1 tests
End of 4.1 tests
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
...
...
mysql-test/t/delete.test
View file @
d276ce34
...
...
@@ -173,6 +173,19 @@ delete from t1 where (@a:= f1) order by f1 limit 1;
select
@
a
;
drop
table
t1
;
# BUG#30385 "Server crash when deleting with order by and limit"
CREATE
TABLE
t1
(
`date`
date
,
`time`
time
,
`seq`
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
PRIMARY
KEY
(
`seq`
),
KEY
`seq`
(
`seq`
),
KEY
`time`
(
`time`
),
KEY
`date`
(
`date`
)
);
DELETE
FROM
t1
ORDER
BY
date
ASC
,
time
ASC
LIMIT
1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
# End of 4.1 tests
...
...
sql/opt_range.cc
View file @
d276ce34
...
...
@@ -1619,6 +1619,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
if
(
!
(
table
->
keys_in_use_for_query
.
is_set
(
idx
)))
continue
;
KEY_PART_INFO
*
keyinfo
=
table
->
key_info
[
idx
].
key_part
;
uint
n_parts
=
table
->
key_info
[
idx
].
key_parts
;
uint
partno
=
0
;
/*
...
...
@@ -1628,7 +1629,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
*/
if
(
!
(
table
->
file
->
index_flags
(
idx
,
0
,
1
)
&
HA_READ_ORDER
))
continue
;
for
(
ord
=
order
;
ord
;
ord
=
ord
->
next
,
partno
++
)
for
(
ord
=
order
;
ord
&&
partno
<
n_parts
;
ord
=
ord
->
next
,
partno
++
)
{
Item
*
item
=
order
->
item
[
0
];
if
(
!
(
item
->
type
()
==
Item
::
FIELD_ITEM
&&
...
...
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