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
89f06e9d
Commit
89f06e9d
authored
Jun 27, 2008
by
Gleb Shchepa
Browse files
Options
Browse Files
Download
Plain Diff
auto merge from local tree
parents
46c7c724
a8067140
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
mysql-test/r/group_min_max_innodb.result
mysql-test/r/group_min_max_innodb.result
+24
-0
mysql-test/t/group_min_max_innodb.test
mysql-test/t/group_min_max_innodb.test
+24
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-0
No files found.
mysql-test/r/group_min_max_innodb.result
View file @
89f06e9d
drop view if exists v1;
drop table if exists t1,t4;
create table t4 (
create table t4 (
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
) engine=innodb;
) engine=innodb;
...
@@ -70,3 +72,25 @@ explain select distinct f1, f2 from t1;
...
@@ -70,3 +72,25 @@ explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
drop table t1;
drop table t1;
create table t1(pk int primary key) engine=innodb;
create view v1 as select pk from t1 where pk < 20;
insert into t1 values (1), (2), (3), (4);
select distinct pk from v1;
pk
1
2
3
4
insert into t1 values (5), (6), (7);
select distinct pk from v1;
pk
1
2
3
4
5
6
7
drop view v1;
drop table t1;
End of 5.1 tests
mysql-test/t/group_min_max_innodb.test
View file @
89f06e9d
...
@@ -6,6 +6,11 @@
...
@@ -6,6 +6,11 @@
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_innodb
.
inc
--
disable_warnings
drop
view
if
exists
v1
;
drop
table
if
exists
t1
,
t4
;
--
enable_warnings
#
#
# Bug #12672: primary key implcitly included in every innodb index
# Bug #12672: primary key implcitly included in every innodb index
#
#
...
@@ -93,3 +98,22 @@ alter table t1 drop primary key, add primary key (f2, f1);
...
@@ -93,3 +98,22 @@ alter table t1 drop primary key, add primary key (f2, f1);
explain
select
distinct
f1
a
,
f1
b
from
t1
;
explain
select
distinct
f1
a
,
f1
b
from
t1
;
explain
select
distinct
f1
,
f2
from
t1
;
explain
select
distinct
f1
,
f2
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #36632: Select distinct from a simple view on an InnoDB table
# returns incorrect results
#
create
table
t1
(
pk
int
primary
key
)
engine
=
innodb
;
create
view
v1
as
select
pk
from
t1
where
pk
<
20
;
insert
into
t1
values
(
1
),
(
2
),
(
3
),
(
4
);
select
distinct
pk
from
v1
;
insert
into
t1
values
(
5
),
(
6
),
(
7
);
select
distinct
pk
from
v1
;
drop
view
v1
;
drop
table
t1
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
89f06e9d
...
@@ -13179,6 +13179,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -13179,6 +13179,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
tab
->
ref
.
key
=
-
1
;
tab
->
ref
.
key
=
-
1
;
tab
->
ref
.
key_parts
=
0
;
// Don't use ref key.
tab
->
ref
.
key_parts
=
0
;
// Don't use ref key.
tab
->
read_first_record
=
join_init_read_record
;
tab
->
read_first_record
=
join_init_read_record
;
if
(
tab
->
is_using_loose_index_scan
())
join
->
tmp_table_param
.
precomputed_group_by
=
TRUE
;
/*
/*
TODO: update the number of records in join->best_positions[tablenr]
TODO: update the number of records in join->best_positions[tablenr]
*/
*/
...
...
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