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
be5485ce
Commit
be5485ce
authored
Dec 08, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug32815
parents
9be915e7
c394dbe1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+12
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+15
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/innodb_mysql.result
View file @
be5485ce
...
...
@@ -1213,4 +1213,16 @@ a b
3 2
1 1
DROP TABLE t1;
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL idx NULL NULL NULL 3 Using where; Using filesort
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
id type d
191 member 1
NULL member 3
NULL member 4
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/innodb_mysql.test
View file @
be5485ce
...
...
@@ -960,4 +960,19 @@ SELECT * FROM t1 ORDER BY b DESC, a ASC;
DROP
TABLE
t1
;
#
# Bug #32815: query with ORDER BY and a possible ref_or_null access
#
CREATE
TABLE
t1
(
id
int
,
type
char
(
6
),
d
int
,
INDEX
idx
(
id
,
d
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
191
,
'member'
,
1
),
(
NULL
,
'member'
,
3
),
(
NULL
,
'member'
,
4
),
(
201
,
'member'
,
2
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
id
=
191
OR
id
IS
NULL
ORDER
BY
d
;
SELECT
*
FROM
t1
WHERE
id
=
191
OR
id
IS
NULL
ORDER
BY
d
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/sql_select.cc
View file @
be5485ce
...
...
@@ -3691,7 +3691,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
found_eq_constant
=
0
;
for
(
i
=
0
;
i
<
keyuse
->
elements
-
1
;
i
++
,
use
++
)
{
if
(
!
use
->
used_tables
)
if
(
!
use
->
used_tables
&&
use
->
optimize
!=
KEY_OPTIMIZE_REF_OR_NULL
)
use
->
table
->
const_key_parts
[
use
->
key
]
|=
use
->
keypart_map
;
if
(
use
->
keypart
!=
FT_KEYPART
)
{
...
...
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