mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
Merge polly.(none):/home/kaa/src/opt/bug32241/my51-bug29131
into polly.(none):/home/kaa/src/opt/mysql-5.1-opt
This commit is contained in:
commit
6733c292a8
3 changed files with 50 additions and 1 deletions
|
@ -87,3 +87,23 @@ Warnings:
|
|||
Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
CREATE TABLE t2 (b INT,
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b));
|
||||
INSERT INTO t2 VALUES (),(),();
|
||||
EXPLAIN SELECT 1 FROM
|
||||
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X X X X X X X const row not found
|
||||
X X X X X X X X X
|
||||
X X X X X X X X X Range checked for each record (index map: 0xFFFFFFFFFF)
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -66,4 +66,32 @@ explain extended select * from t1 having 1;
|
|||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #32241: memory corruption due to large index map in 'Range checked for
|
||||
# each record'
|
||||
#
|
||||
|
||||
CREATE TABLE t1(c INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
|
||||
CREATE TABLE t2 (b INT,
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b));
|
||||
|
||||
INSERT INTO t2 VALUES (),(),();
|
||||
|
||||
# We only need to make sure that there is no buffer overrun and the index map
|
||||
# is displayed correctly
|
||||
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X
|
||||
EXPLAIN SELECT 1 FROM
|
||||
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
|
|
@ -15915,7 +15915,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
|
|||
{
|
||||
if (tab->use_quick == 2)
|
||||
{
|
||||
char buf[MAX_KEY/8+1];
|
||||
/* 4 bits per 1 hex digit + terminating '\0' */
|
||||
char buf[MAX_KEY / 4 + 1];
|
||||
extra.append(STRING_WITH_LEN("; Range checked for each "
|
||||
"record (index map: 0x"));
|
||||
extra.append(tab->keys.print(buf));
|
||||
|
|
Loading…
Reference in a new issue