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
03fccad9
Commit
03fccad9
authored
Apr 21, 2005
by
lenz@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/space/my/mysql-4.1
parents
7ca62cc6
53b496a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
libmysql/libmysql.c
libmysql/libmysql.c
+1
-0
mysql-test/r/olap.result
mysql-test/r/olap.result
+13
-0
mysql-test/t/olap.test
mysql-test/t/olap.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+13
-1
No files found.
libmysql/libmysql.c
View file @
03fccad9
...
...
@@ -186,6 +186,7 @@ void STDCALL mysql_server_end()
}
else
mysql_thread_end
();
free_charsets
();
mysql_client_init
=
org_my_init_done
=
0
;
}
...
...
mysql-test/r/olap.result
View file @
03fccad9
...
...
@@ -392,3 +392,16 @@ SELECT SQL_CALC_FOUND_ROWS a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
a SUM(b)
1 4
DROP TABLE t1;
CREATE TABLE t1 (a int(11) NOT NULL);
INSERT INTO t1 VALUES (1),(2);
SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP;
a m
1 1
2 2
NULL 3
SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2;
a m
1 1
2 2
NULL 3
DROP TABLE t1;
mysql-test/t/olap.test
View file @
03fccad9
...
...
@@ -171,3 +171,16 @@ SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
SELECT
SQL_CALC_FOUND_ROWS
a
,
SUM
(
b
)
FROM
t1
GROUP
BY
a
WITH
ROLLUP
LIMIT
1
;
DROP
TABLE
t1
;
#
# Tests for bug #9681: ROLLUP in subquery for derived table wiht
# a group by field declared as NOT NULL
#
CREATE
TABLE
t1
(
a
int
(
11
)
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
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
;
DROP
TABLE
t1
;
sql/sql_select.cc
View file @
03fccad9
...
...
@@ -4779,7 +4779,7 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field,
item
->
result_field
=
new_field
;
else
new_field
->
field_name
=
name
;
if
(
org_field
->
maybe_null
())
if
(
org_field
->
maybe_null
()
||
(
item
&&
item
->
maybe_null
)
)
new_field
->
flags
&=
~
NOT_NULL_FLAG
;
// Because of outer join
if
(
org_field
->
type
()
==
FIELD_TYPE_VAR_STRING
)
table
->
db_create_options
|=
HA_OPTION_PACK_RECORD
;
...
...
@@ -9199,7 +9199,19 @@ bool JOIN::rollup_init()
for
(
j
=
0
;
j
<
fields_list
.
elements
;
j
++
)
rollup
.
fields
[
i
].
push_back
(
rollup
.
null_items
[
i
]);
}
List_iterator_fast
<
Item
>
it
(
fields_list
);
Item
*
item
;
while
((
item
=
it
++
))
{
ORDER
*
group_tmp
;
for
(
group_tmp
=
group_list
;
group_tmp
;
group_tmp
=
group_tmp
->
next
)
{
if
(
*
group_tmp
->
item
==
item
)
item
->
maybe_null
=
1
;
}
}
return
0
;
}
...
...
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