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
b2f0f908
Commit
b2f0f908
authored
Sep 08, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge
parent
bcae5256
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
mysql-test/t/olap.test
mysql-test/t/olap.test
+31
-0
No files found.
mysql-test/t/olap.test
View file @
b2f0f908
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
--
enable_warnings
set
@
sav_dpi
=
@@
div_precision_increment
;
set
div_precision_increment
=
5
;
show
variables
like
'div_precision_increment'
;
create
table
t1
(
product
varchar
(
32
),
country_id
int
not
null
,
year
int
,
profit
int
);
create
table
t1
(
product
varchar
(
32
),
country_id
int
not
null
,
year
int
,
profit
int
);
insert
into
t1
values
(
'Computer'
,
2
,
2000
,
1200
),
insert
into
t1
values
(
'Computer'
,
2
,
2000
,
1200
),
(
'TV'
,
1
,
1999
,
150
),
(
'TV'
,
1
,
1999
,
150
),
...
@@ -153,6 +157,13 @@ SELECT DISTINCT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1
...
@@ -153,6 +157,13 @@ SELECT DISTINCT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1
SELECT
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
SELECT
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
SELECT
DISTINCT
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
SELECT
DISTINCT
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
SELECT
b
,
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
SELECT
DISTINCT
b
,
a
,
sum
(
b
)
FROM
t1
GROUP
BY
a
,
b
WITH
ROLLUP
;
ALTER
TABLE
t1
ADD
COLUMN
c
INT
;
SELECT
a
,
b
,
sum
(
c
)
FROM
t1
GROUP
BY
a
,
b
,
c
WITH
ROLLUP
;
SELECT
distinct
a
,
b
,
sum
(
c
)
FROM
t1
GROUP
BY
a
,
b
,
c
WITH
ROLLUP
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
#
...
@@ -184,6 +195,7 @@ SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP;
...
@@ -184,6 +195,7 @@ SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP;
SELECT
*
FROM
(
SELECT
a
,
SUM
(
a
)
m
FROM
t1
GROUP
BY
a
WITH
ROLLUP
)
t2
;
SELECT
*
FROM
(
SELECT
a
,
SUM
(
a
)
m
FROM
t1
GROUP
BY
a
WITH
ROLLUP
)
t2
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
set
div_precision_increment
=
@
sav_dpi
;
#
#
# Tests for bug #7914: ROLLUP over expressions on temporary table
# Tests for bug #7914: ROLLUP over expressions on temporary table
...
@@ -264,3 +276,22 @@ SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
...
@@ -264,3 +276,22 @@ SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
#
# Tests for bug #11639: ROLLUP over view executed through filesort
#
CREATE
TABLE
t1
(
id
int
,
type
char
(
1
));
INSERT
INTO
t1
VALUES
(
1
,
"A"
),(
2
,
"C"
),(
3
,
"A"
),(
4
,
"A"
),(
5
,
"B"
),
(
6
,
"B"
),(
7
,
"A"
),(
8
,
"C"
),(
9
,
"A"
),(
10
,
"C"
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
SELECT
type
FROM
t1
GROUP
BY
type
WITH
ROLLUP
;
SELECT
type
FROM
v1
GROUP
BY
type
WITH
ROLLUP
;
EXPLAIN
SELECT
type
FROM
v1
GROUP
BY
type
WITH
ROLLUP
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
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