Skip to content

Commit e6856ab

Browse files
author
Tor Didriksen
committed
Backport of
Bug #47338 assertion in handler::ha_external_lock
1 parent c6283d8 commit e6856ab

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

mysql-test/r/analyse.result

+14
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,17 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE();
123123
ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT
124124
DROP TABLE t1;
125125
End of 5.0 tests
126+
#
127+
# Bug #47338 assertion in handler::ha_external_lock
128+
#
129+
drop table if exists t1;
130+
CREATE TEMPORARY TABLE t1 (f2 INT, f1 INT, PRIMARY KEY (f1)) ENGINE = MyISAM;
131+
INSERT t1 ( f1 ) VALUES ( 5 );
132+
INSERT t1 ( f1 ) VALUES ( 6 );
133+
ALTER TABLE t1 ENGINE = MyISAM;
134+
ANALYZE TABLE t1;
135+
Table Op Msg_type Msg_text
136+
test.t1 analyze status OK
137+
SELECT f1,f2 FROM t1 A WHERE f1 BETWEEN 0 AND 1;
138+
f1 f2
139+
drop table t1;

mysql-test/t/analyse.test

+23
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,26 @@ DROP TABLE t1;
133133

134134

135135
--echo End of 5.0 tests
136+
137+
--echo #
138+
--echo # Bug #47338 assertion in handler::ha_external_lock
139+
--echo #
140+
141+
--disable_warnings
142+
drop table if exists t1;
143+
--enable_warnings
144+
145+
CREATE TEMPORARY TABLE t1 (f2 INT, f1 INT, PRIMARY KEY (f1)) ENGINE = MyISAM;
146+
147+
INSERT t1 ( f1 ) VALUES ( 5 );
148+
INSERT t1 ( f1 ) VALUES ( 6 );
149+
150+
ALTER TABLE t1 ENGINE = MyISAM;
151+
ANALYZE TABLE t1;
152+
153+
# Bug #48859 nor reproducible here (was in 6.0)
154+
# Keeping this test case anyways.
155+
156+
SELECT f1,f2 FROM t1 A WHERE f1 BETWEEN 0 AND 1;
157+
158+
drop table t1;

mysys/my_open.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
4949
fd = open((char *) FileName, Flags);
5050
#endif
5151

52-
DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_OPEN,
53-
EE_FILENOTFOUND, MyFlags));
52+
fd= my_register_filename(fd, FileName, FILE_BY_OPEN, EE_FILENOTFOUND, MyFlags);
53+
DBUG_RETURN(fd);
5454
} /* my_open */
5555

5656

sql/handler.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -4412,8 +4412,10 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
44124412
if (mode & HA_MRR_USE_DEFAULT_IMPL || mode & HA_MRR_SORTED)
44134413
{
44144414
use_default_impl= TRUE;
4415-
DBUG_RETURN(h->handler::multi_range_read_init(seq_funcs, seq_init_param,
4416-
n_ranges, mode, buf));
4415+
const int retval=
4416+
h->handler::multi_range_read_init(seq_funcs, seq_init_param,
4417+
n_ranges, mode, buf);
4418+
DBUG_RETURN(retval);
44174419
}
44184420
rowids_buf= buf->buffer;
44194421

@@ -5527,7 +5529,8 @@ int handler::ha_reset()
55275529
free_io_cache(table);
55285530
/* reset the bitmaps to point to defaults */
55295531
table->default_column_bitmaps();
5530-
DBUG_RETURN(reset());
5532+
const int retval= reset();
5533+
DBUG_RETURN(retval);
55315534
}
55325535

55335536

0 commit comments

Comments
 (0)