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
227d350c
Commit
227d350c
authored
Dec 11, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/dbdata/psergey/mysql-4.0-bug6976
parents
4ca0670d
5e7f265a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+12
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+9
-0
sql/item.cc
sql/item.cc
+1
-0
sql/item.h
sql/item.h
+13
-1
No files found.
mysql-test/r/group_by.result
View file @
227d350c
...
...
@@ -626,3 +626,15 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 6 Using filesort
DROP TABLE t1;
create table t1 (a int);
insert into t1 values(null);
select min(a) is null from t1;
min(a) is null
1
select min(a) is null or null from t1;
min(a) is null or null
1
select 1 and min(a) is null from t1;
1 and min(a) is null
1
drop table t1;
mysql-test/t/group_by.test
View file @
227d350c
...
...
@@ -447,3 +447,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
SELECT
i
,
COUNT
(
DISTINCT
(
i
))
FROM
t1
GROUP
BY
j
ORDER
BY
NULL
;
explain
SELECT
i
,
COUNT
(
DISTINCT
(
i
))
FROM
t1
GROUP
BY
j
ORDER
BY
NULL
;
DROP
TABLE
t1
;
#Test for BUG#6976: Aggregate functions have incorrect NULL-ness
create
table
t1
(
a
int
);
insert
into
t1
values
(
null
);
select
min
(
a
)
is
null
from
t1
;
select
min
(
a
)
is
null
or
null
from
t1
;
select
1
and
min
(
a
)
is
null
from
t1
;
drop
table
t1
;
sql/item.cc
View file @
227d350c
...
...
@@ -687,6 +687,7 @@ bool Item_null::send(THD *thd, String *packet)
/*
This is used for HAVING clause
Find field in select list having the same name
This is not always called, see also Item_ref::Item_ref
*/
bool
Item_ref
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
)
...
...
sql/item.h
View file @
227d350c
...
...
@@ -401,7 +401,19 @@ class Item_ref :public Item_ident
Item_ref
(
char
*
db_par
,
char
*
table_name_par
,
char
*
field_name_par
)
:
Item_ident
(
db_par
,
table_name_par
,
field_name_par
),
ref
(
0
)
{}
Item_ref
(
Item
**
item
,
char
*
table_name_par
,
char
*
field_name_par
)
:
Item_ident
(
NullS
,
table_name_par
,
field_name_par
),
ref
(
item
)
{}
:
Item_ident
(
NullS
,
table_name_par
,
field_name_par
),
ref
(
item
)
{
/*
This ctor is called from Item_XXX::split_sum_func, and fix_fields will
not be called for *this, so we must setup everything here. **ref is
already fixed at this point.
*/
max_length
=
(
*
ref
)
->
max_length
;
decimals
=
(
*
ref
)
->
decimals
;
binary
=
(
*
ref
)
->
binary
;
with_sum_func
=
(
*
ref
)
->
with_sum_func
;
maybe_null
=
(
*
ref
)
->
maybe_null
;
}
enum
Type
type
()
const
{
return
REF_ITEM
;
}
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
{
return
(
*
ref
)
->
eq
(
item
,
binary_cmp
);
}
...
...
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