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
b4751a93
Commit
b4751a93
authored
Jul 01, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
parents
a58edfc5
d81f0574
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
6 deletions
+48
-6
mysql-test/r/olap.result
mysql-test/r/olap.result
+22
-0
mysql-test/r/view.result
mysql-test/r/view.result
+1
-1
mysql-test/t/olap.test
mysql-test/t/olap.test
+16
-0
sql/item.h
sql/item.h
+4
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+4
-4
No files found.
mysql-test/r/olap.result
View file @
b4751a93
...
...
@@ -555,3 +555,25 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST')
4 TEST
TEST TEST
DROP TABLE t1,t2;
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;
type
A
B
C
NULL
SELECT type FROM v1 GROUP BY type WITH ROLLUP;
type
A
B
C
NULL
EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using filesort
DROP VIEW v1;
DROP TABLE t1;
mysql-test/r/view.result
View file @
b4751a93
...
...
@@ -1563,7 +1563,7 @@ one 1025,2025,3025
two 1050,1050
select col1,group_concat(col2,col3) from v1 group by col1;
col1 group_concat(col2,col3)
two
1025,2025,3025
one
1025,2025,3025
two 1050,1050
drop view v1;
drop table t1;
...
...
mysql-test/t/olap.test
View file @
b4751a93
...
...
@@ -250,3 +250,19 @@ SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2
DROP
TABLE
t1
,
t2
;
#
# 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
;
sql/item.h
View file @
b4751a93
...
...
@@ -1440,7 +1440,10 @@ class Item_ref :public Item_ident
:
Item_ident
(
thd
,
item
),
result_field
(
item
->
result_field
),
ref
(
item
->
ref
)
{}
enum
Type
type
()
const
{
return
REF_ITEM
;
}
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
{
return
ref
&&
(
*
ref
)
->
eq
(
item
,
binary_cmp
);
}
{
Item
*
it
=
((
Item
*
)
item
)
->
real_item
();
return
ref
&&
(
*
ref
)
->
eq
(
it
,
binary_cmp
);
}
double
val_real
();
longlong
val_int
();
my_decimal
*
val_decimal
(
my_decimal
*
);
...
...
sql/sql_prepare.cc
View file @
b4751a93
...
...
@@ -2447,6 +2447,7 @@ Prepared_statement::~Prepared_statement()
if
(
cursor
)
cursor
->
Cursor
::~
Cursor
();
free_items
();
free_root
(
cursor
->
mem_root
,
MYF
(
0
));
delete
lex
->
result
;
}
...
...
sql/sql_select.cc
View file @
b4751a93
...
...
@@ -1920,7 +1920,6 @@ Cursor::~Cursor()
{
if
(
is_open
())
close
(
FALSE
);
free_root
(
mem_root
,
MYF
(
0
));
}
/*********************************************************************/
...
...
@@ -12157,7 +12156,7 @@ count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
param
->
quick_group
=
1
;
while
((
field
=
li
++
))
{
Item
::
Type
type
=
field
->
type
();
Item
::
Type
type
=
field
->
real_item
()
->
type
();
if
(
type
==
Item
::
FIELD_ITEM
)
param
->
field_count
++
;
else
if
(
type
==
Item
::
SUM_FUNC_ITEM
)
...
...
@@ -12171,7 +12170,7 @@ count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
for
(
uint
i
=
0
;
i
<
sum_item
->
arg_count
;
i
++
)
{
if
(
sum_item
->
args
[
0
]
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
sum_item
->
args
[
0
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
param
->
field_count
++
;
else
param
->
func_count
++
;
...
...
@@ -12418,9 +12417,10 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
param
->
copy_funcs
.
empty
();
for
(
i
=
0
;
(
pos
=
li
++
);
i
++
)
{
if
(
pos
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
pos
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
{
Item_field
*
item
;
pos
=
pos
->
real_item
();
if
(
!
(
item
=
new
Item_field
(
thd
,
((
Item_field
*
)
pos
))))
goto
err
;
pos
=
item
;
...
...
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