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
d1f61d6f
Commit
d1f61d6f
authored
21 years ago
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.r18.ru:/usr/home/ram/work/4.1
parents
c2a4a0ec
a7beff5e
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
22 deletions
+50
-22
mysql-test/r/handler.result
mysql-test/r/handler.result
+19
-0
mysql-test/t/handler.test
mysql-test/t/handler.test
+14
-0
sql/sql_handler.cc
sql/sql_handler.cc
+17
-22
No files found.
mysql-test/r/handler.result
View file @
d1f61d6f
...
...
@@ -148,3 +148,22 @@ alter table t1 type=MyISAM;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
create table t1 (a int);
insert into t1 values (1),(2),(3),(4),(5),(6);
delete from t1 limit 2;
handler t1 open;
handler t1 read first;
a
3
handler t1 read first limit 1,1;
a
4
handler t1 read first limit 2,2;
a
5
6
delete from t1 limit 3;
handler t1 read first;
a
6
drop table t1;
This diff is collapsed.
Click to expand it.
mysql-test/t/handler.test
View file @
d1f61d6f
...
...
@@ -85,3 +85,17 @@ alter table t1 type=MyISAM;
handler
t2
read
first
;
drop
table
t1
;
#
# test case for the bug #787
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
);
delete
from
t1
limit
2
;
handler
t1
open
;
handler
t1
read
first
;
handler
t1
read
first
limit
1
,
1
;
handler
t1
read
first
limit
2
,
2
;
delete
from
t1
limit
3
;
handler
t1
read
first
;
drop
table
t1
;
This diff is collapsed.
Click to expand it.
sql/sql_handler.cc
View file @
d1f61d6f
...
...
@@ -222,6 +222,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
goto
err
;
}
if
(
err
==
HA_ERR_RECORD_DELETED
)
continue
;
if
(
err
)
{
if
(
err
!=
HA_ERR_KEY_NOT_FOUND
&&
err
!=
HA_ERR_END_OF_FILE
)
...
...
@@ -233,31 +235,24 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
goto
ok
;
}
if
(
cond
)
if
(
cond
&&
!
cond
->
val_int
())
continue
;
if
(
!
err
&&
num_rows
>=
offset_limit
)
{
err
=
err
;
if
(
!
cond
->
val_int
())
continue
;
}
if
(
num_rows
>=
offset_limit
)
{
if
(
!
err
)
String
*
packet
=
&
thd
->
packet
;
Item
*
item
;
protocol
->
prepare_for_resend
();
it
.
rewind
();
while
((
item
=
it
++
))
{
String
*
packet
=
&
thd
->
packet
;
Item
*
item
;
protocol
->
prepare_for_resend
();
it
.
rewind
();
while
((
item
=
it
++
))
{
if
(
item
->
send
(
thd
->
protocol
,
&
buffer
))
{
protocol
->
free
();
// Free used
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
goto
err
;
}
}
protocol
->
write
();
if
(
item
->
send
(
thd
->
protocol
,
&
buffer
))
{
protocol
->
free
();
// Free used
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
goto
err
;
}
}
protocol
->
write
();
}
num_rows
++
;
}
...
...
This diff is collapsed.
Click to expand it.
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