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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
947715c2
Commit
947715c2
authored
Jan 11, 2008
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.1-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.1-opt-bug33697
parents
17c51178
b85ffdb5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
17 deletions
+69
-17
mysql-test/include/mix1.inc
mysql-test/include/mix1.inc
+41
-14
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+26
-1
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+0
-1
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
mysql-test/include/mix1.inc
View file @
947715c2
...
...
@@ -723,20 +723,6 @@ set @@sort_buffer_size=default;
DROP
TABLE
t1
,
t2
;
#
# 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
;
# Test of behaviour with CREATE ... SELECT
#
...
...
@@ -1091,6 +1077,19 @@ desc t1;
show
create
table
t1
;
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
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
...
...
@@ -1383,4 +1382,32 @@ create table t1 (a int auto_increment primary key) engine=innodb;
alter
table
t1
order
by
a
;
drop
table
t1
;
#
# Bug #33697: ORDER BY primary key DESC vs. ref access + filesort
# (reproduced only with InnoDB tables)
#
CREATE
TABLE
t1
(
vid
integer
NOT
NULL
,
tid
integer
NOT
NULL
,
idx
integer
NOT
NULL
,
name
varchar
(
128
)
NOT
NULL
,
type
varchar
(
128
)
NULL
,
PRIMARY
KEY
(
idx
,
vid
,
tid
),
UNIQUE
(
vid
,
tid
,
name
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
,
1
,
1
,
'pk'
,
NULL
),(
2
,
1
,
1
,
'pk'
,
NULL
),(
3
,
1
,
1
,
'pk'
,
NULL
),(
4
,
1
,
1
,
'c1'
,
NULL
),
(
5
,
1
,
1
,
'pk'
,
NULL
),(
1
,
1
,
2
,
'c1'
,
NULL
),(
2
,
1
,
2
,
'c1'
,
NULL
),(
3
,
1
,
2
,
'c1'
,
NULL
),
(
4
,
1
,
2
,
'c2'
,
NULL
),(
5
,
1
,
2
,
'c1'
,
NULL
),(
2
,
1
,
3
,
'c2'
,
NULL
),(
3
,
1
,
3
,
'c2'
,
NULL
),
(
4
,
1
,
3
,
'pk'
,
NULL
),(
5
,
1
,
3
,
'c2'
,
NULL
),
(
2
,
1
,
4
,
'c_extra'
,
NULL
),(
3
,
1
,
4
,
'c_extra'
,
NULL
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
tid
=
1
AND
vid
=
3
ORDER
BY
idx
DESC
;
SELECT
*
FROM
t1
WHERE
tid
=
1
AND
vid
=
3
ORDER
BY
idx
DESC
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
mysql-test/r/innodb_mysql.result
View file @
947715c2
...
...
@@ -1349,7 +1349,7 @@ 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
1 SIMPLE t1 ALL idx NULL NULL NULL
4
Using where; Using filesort
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
id type d
191 member 1
...
...
@@ -1609,4 +1609,29 @@ alter table t1 order by a;
Warnings:
Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1'
drop table t1;
CREATE TABLE t1
(vid integer NOT NULL,
tid integer NOT NULL,
idx integer NOT NULL,
name varchar(128) NOT NULL,
type varchar(128) NULL,
PRIMARY KEY(idx, vid, tid),
UNIQUE(vid, tid, name)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(1,1,1,'pk',NULL),(2,1,1,'pk',NULL),(3,1,1,'pk',NULL),(4,1,1,'c1',NULL),
(5,1,1,'pk',NULL),(1,1,2,'c1',NULL),(2,1,2,'c1',NULL),(3,1,2,'c1',NULL),
(4,1,2,'c2',NULL),(5,1,2,'c1',NULL),(2,1,3,'c2',NULL),(3,1,3,'c2',NULL),
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
EXPLAIN SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index vid PRIMARY 12 NULL 16 Using where
SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
vid tid idx name type
3 1 4 c_extra NULL
3 1 3 c2 NULL
3 1 2 c1 NULL
3 1 1 pk NULL
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/disabled.def
View file @
947715c2
...
...
@@ -18,7 +18,6 @@ federated_transactions : Bug#29523 Transactions do not work
events : Bug#32664 events.test fails randomly
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
kill : Bug#29149: Test "kill" fails on Windows
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
wait_timeout : Bug#32801 wait_timeout.test fails randomly
ctype_create : Bug#32965 main.ctype_create fails
status : Bug#32966 main.status fails
...
...
sql/sql_select.cc
View file @
947715c2
...
...
@@ -13122,7 +13122,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
select
->
quick
=
tmp
;
}
}
else
if
(
tab
->
ref
.
key
>=
0
&&
tab
->
ref
.
key_parts
<=
used_key_parts
)
else
if
(
tab
->
type
!=
JT_NEXT
&&
tab
->
ref
.
key
>=
0
&&
tab
->
ref
.
key_parts
<=
used_key_parts
)
{
/*
SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC
...
...
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