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
c9f64f71
Commit
c9f64f71
authored
Aug 02, 2006
by
cmiller@zippy.cornsilk.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#9719: DELETE with WHERE on HEAP table just deletes first row of matched
set. (Ramil's patch, recreated.)
parent
757493d4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
1 deletion
+57
-1
heap/hp_delete.c
heap/hp_delete.c
+3
-0
mysql-test/r/heap_btree.result
mysql-test/r/heap_btree.result
+35
-0
mysql-test/t/heap_btree.test
mysql-test/t/heap_btree.test
+19
-1
No files found.
heap/hp_delete.c
View file @
c9f64f71
...
@@ -73,7 +73,10 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
...
@@ -73,7 +73,10 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
int
res
;
int
res
;
if
(
flag
)
if
(
flag
)
{
info
->
last_pos
=
NULL
;
/* For heap_rnext/heap_rprev */
info
->
last_pos
=
NULL
;
/* For heap_rnext/heap_rprev */
info
->
lastkey_len
=
0
;
}
custom_arg
.
keyseg
=
keyinfo
->
seg
;
custom_arg
.
keyseg
=
keyinfo
->
seg
;
custom_arg
.
key_length
=
hp_rb_make_key
(
keyinfo
,
info
->
recbuf
,
record
,
recpos
);
custom_arg
.
key_length
=
hp_rb_make_key
(
keyinfo
,
info
->
recbuf
,
record
,
recpos
);
...
...
mysql-test/r/heap_btree.result
View file @
c9f64f71
...
@@ -246,3 +246,38 @@ DELETE from t1 where a < 100;
...
@@ -246,3 +246,38 @@ DELETE from t1 where a < 100;
SELECT * from t1;
SELECT * from t1;
a
a
DROP TABLE t1;
DROP TABLE t1;
create table t1(a int not null, key using btree(a)) engine=heap;
insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
select a from t1 where a > 2;
a
3
3
3
3
delete from t1 where a < 4;
select a from t1;
a
insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
select a from t1 where a > 4;
a
delete from t1 where a > 4;
select a from t1;
a
3
3
1
3
3
1
2
2
2
select a from t1 where a > 3;
a
delete from t1 where a >= 2;
select a from t1;
a
1
1
drop table t1;
End of 4.1 tests
mysql-test/t/heap_btree.test
View file @
c9f64f71
...
@@ -164,4 +164,22 @@ DELETE from t1 where a < 100;
...
@@ -164,4 +164,22 @@ DELETE from t1 where a < 100;
SELECT
*
from
t1
;
SELECT
*
from
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# End of 4.1 tests
#
# Bug #9719: problem with delete
#
create
table
t1
(
a
int
not
null
,
key
using
btree
(
a
))
engine
=
heap
;
insert
into
t1
values
(
2
),
(
2
),
(
2
),
(
1
),
(
1
),
(
3
),
(
3
),
(
3
),
(
3
);
select
a
from
t1
where
a
>
2
;
delete
from
t1
where
a
<
4
;
select
a
from
t1
;
insert
into
t1
values
(
2
),
(
2
),
(
2
),
(
1
),
(
1
),
(
3
),
(
3
),
(
3
),
(
3
);
select
a
from
t1
where
a
>
4
;
delete
from
t1
where
a
>
4
;
select
a
from
t1
;
select
a
from
t1
where
a
>
3
;
delete
from
t1
where
a
>=
2
;
select
a
from
t1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
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