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
b2494b81
Commit
b2494b81
authored
May 22, 2006
by
gkodinov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/B18745
into mysql.com:/home/kgeorge/mysql/5.1/B18745
parents
3a20e8c1
b357c232
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
210 additions
and
209 deletions
+210
-209
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+0
-138
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+138
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+0
-71
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+72
-0
No files found.
mysql-test/r/func_group.result
View file @
b2494b81
...
...
@@ -821,144 +821,6 @@ SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
MAX(id)
NULL
DROP TABLE t1;
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
create table t2i (a int) engine=innodb;
insert into t2m values (5);
insert into t2i values (5);
select min(a) from t1m;
min(a)
NULL
select min(7) from t1m;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select min(7) from t2m join t1m;
min(7)
NULL
select max(a) from t1m;
max(a)
NULL
select max(7) from t1m;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(7) from t2m join t1m;
max(7)
NULL
select 1, min(a) from t1m where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1m where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1m where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1m where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1m where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1m where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1m where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1m where 1=99;
1 max(1)
1 NULL
select min(a) from t1i;
min(a)
NULL
select min(7) from t1i;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select min(7) from t2i join t1i;
min(7)
NULL
select max(a) from t1i;
max(a)
NULL
select max(7) from t1i;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select max(7) from t2i join t1i;
max(7)
NULL
select 1, min(a) from t1i where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1i where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1i where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1i where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1i where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1i where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1i where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1i where 1=99;
1 max(1)
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t2m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2m system NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
create table t2 (ff double);
insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2;
...
...
mysql-test/r/innodb_mysql.result
View file @
b2494b81
...
...
@@ -54,3 +54,141 @@ c.c_id = 218 and expiredate is null;
slai_id
12
drop table t1, t2;
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
create table t2i (a int) engine=innodb;
insert into t2m values (5);
insert into t2i values (5);
select min(a) from t1m;
min(a)
NULL
select min(7) from t1m;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select min(7) from t2m join t1m;
min(7)
NULL
select max(a) from t1m;
max(a)
NULL
select max(7) from t1m;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(7) from t2m join t1m;
max(7)
NULL
select 1, min(a) from t1m where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1m where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1m where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1m where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1m where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1m where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1m where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1m where 1=99;
1 max(1)
1 NULL
select min(a) from t1i;
min(a)
NULL
select min(7) from t1i;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select min(7) from t2i join t1i;
min(7)
NULL
select max(a) from t1i;
max(a)
NULL
select max(7) from t1i;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select max(7) from t2i join t1i;
max(7)
NULL
select 1, min(a) from t1i where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1i where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1i where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1i where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1i where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1i where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1i where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1i where 1=99;
1 max(1)
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t2m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2m system NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
mysql-test/t/func_group.test
View file @
b2494b81
...
...
@@ -539,77 +539,6 @@ INSERT INTO t1 VALUES
SELECT
MAX
(
id
)
FROM
t1
WHERE
id
<
3
AND
a
=
2
AND
b
=
6
;
DROP
TABLE
t1
;
#
# Bug #12882 min/max inconsistent on empty table
#
--
disable_warnings
create
table
t1m
(
a
int
)
engine
=
myisam
;
create
table
t1i
(
a
int
)
engine
=
innodb
;
create
table
t2m
(
a
int
)
engine
=
myisam
;
create
table
t2i
(
a
int
)
engine
=
innodb
;
--
enable_warnings
insert
into
t2m
values
(
5
);
insert
into
t2i
values
(
5
);
# test with MyISAM
select
min
(
a
)
from
t1m
;
select
min
(
7
)
from
t1m
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2m
join
t1m
;
select
min
(
7
)
from
t2m
join
t1m
;
select
max
(
a
)
from
t1m
;
select
max
(
7
)
from
t1m
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2m
join
t1m
;
select
max
(
7
)
from
t2m
join
t1m
;
select
1
,
min
(
a
)
from
t1m
where
a
=
99
;
select
1
,
min
(
a
)
from
t1m
where
1
=
99
;
select
1
,
min
(
1
)
from
t1m
where
a
=
99
;
select
1
,
min
(
1
)
from
t1m
where
1
=
99
;
select
1
,
max
(
a
)
from
t1m
where
a
=
99
;
select
1
,
max
(
a
)
from
t1m
where
1
=
99
;
select
1
,
max
(
1
)
from
t1m
where
a
=
99
;
select
1
,
max
(
1
)
from
t1m
where
1
=
99
;
# test with InnoDB
select
min
(
a
)
from
t1i
;
select
min
(
7
)
from
t1i
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2i
join
t1i
;
select
min
(
7
)
from
t2i
join
t1i
;
select
max
(
a
)
from
t1i
;
select
max
(
7
)
from
t1i
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2i
join
t1i
;
select
max
(
7
)
from
t2i
join
t1i
;
select
1
,
min
(
a
)
from
t1i
where
a
=
99
;
select
1
,
min
(
a
)
from
t1i
where
1
=
99
;
select
1
,
min
(
1
)
from
t1i
where
a
=
99
;
select
1
,
min
(
1
)
from
t1i
where
1
=
99
;
select
1
,
max
(
a
)
from
t1i
where
a
=
99
;
select
1
,
max
(
a
)
from
t1i
where
1
=
99
;
select
1
,
max
(
1
)
from
t1i
where
a
=
99
;
select
1
,
max
(
1
)
from
t1i
where
1
=
99
;
# mixed MyISAM/InnoDB test
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
drop
table
t1m
,
t1i
,
t2m
,
t2i
;
# End of 4.1 tests
#
...
...
mysql-test/t/innodb_mysql.test
View file @
b2494b81
...
...
@@ -57,3 +57,75 @@ where
c
.
c_id
=
218
and
expiredate
is
null
;
drop
table
t1
,
t2
;
#
# Bug #12882 min/max inconsistent on empty table
#
--
disable_warnings
create
table
t1m
(
a
int
)
engine
=
myisam
;
create
table
t1i
(
a
int
)
engine
=
innodb
;
create
table
t2m
(
a
int
)
engine
=
myisam
;
create
table
t2i
(
a
int
)
engine
=
innodb
;
--
enable_warnings
insert
into
t2m
values
(
5
);
insert
into
t2i
values
(
5
);
# test with MyISAM
select
min
(
a
)
from
t1m
;
select
min
(
7
)
from
t1m
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2m
join
t1m
;
select
min
(
7
)
from
t2m
join
t1m
;
select
max
(
a
)
from
t1m
;
select
max
(
7
)
from
t1m
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2m
join
t1m
;
select
max
(
7
)
from
t2m
join
t1m
;
select
1
,
min
(
a
)
from
t1m
where
a
=
99
;
select
1
,
min
(
a
)
from
t1m
where
1
=
99
;
select
1
,
min
(
1
)
from
t1m
where
a
=
99
;
select
1
,
min
(
1
)
from
t1m
where
1
=
99
;
select
1
,
max
(
a
)
from
t1m
where
a
=
99
;
select
1
,
max
(
a
)
from
t1m
where
1
=
99
;
select
1
,
max
(
1
)
from
t1m
where
a
=
99
;
select
1
,
max
(
1
)
from
t1m
where
1
=
99
;
# test with InnoDB
select
min
(
a
)
from
t1i
;
select
min
(
7
)
from
t1i
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2i
join
t1i
;
select
min
(
7
)
from
t2i
join
t1i
;
select
max
(
a
)
from
t1i
;
select
max
(
7
)
from
t1i
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2i
join
t1i
;
select
max
(
7
)
from
t2i
join
t1i
;
select
1
,
min
(
a
)
from
t1i
where
a
=
99
;
select
1
,
min
(
a
)
from
t1i
where
1
=
99
;
select
1
,
min
(
1
)
from
t1i
where
a
=
99
;
select
1
,
min
(
1
)
from
t1i
where
1
=
99
;
select
1
,
max
(
a
)
from
t1i
where
a
=
99
;
select
1
,
max
(
a
)
from
t1i
where
1
=
99
;
select
1
,
max
(
1
)
from
t1i
where
a
=
99
;
select
1
,
max
(
1
)
from
t1i
where
1
=
99
;
# mixed MyISAM/InnoDB test
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
drop
table
t1m
,
t1i
,
t2m
,
t2i
;
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