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
7b38492a
Commit
7b38492a
authored
Nov 16, 2007
by
kaa@polly.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge polly.(none):/home/kaa/src/opt/bug32241/my50-bug29131
into polly.(none):/home/kaa/src/opt/mysql-5.0-opt
parents
b12f4cbb
82125f28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
1 deletion
+50
-1
mysql-test/r/explain.result
mysql-test/r/explain.result
+20
-0
mysql-test/t/explain.test
mysql-test/t/explain.test
+28
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
mysql-test/r/explain.result
View file @
7b38492a
...
...
@@ -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;
mysql-test/t/explain.test
View file @
7b38492a
...
...
@@ -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.
sql/sql_select.cc
View file @
7b38492a
...
...
@@ -15327,7 +15327,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
));
...
...
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