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
cc5b1779
Commit
cc5b1779
authored
Mar 16, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.0
into gluh.mysql.r18.ru:/home/gluh/Bugs/mysql-4.0.3067
parents
277cf702
5adbc611
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
mysql-test/r/func_if.result
mysql-test/r/func_if.result
+6
-0
mysql-test/t/func_if.test
mysql-test/t/func_if.test
+6
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+3
-3
No files found.
mysql-test/r/func_if.result
View file @
cc5b1779
...
...
@@ -40,6 +40,12 @@ a
aa
aaa
drop table t1;
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
NULL NULL NULL NULL
select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL);
NULLIF(1,NULL) NULLIF(1.0, NULL) NULLIF("test", NULL)
1 1.0 test
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
...
...
mysql-test/t/func_if.test
View file @
cc5b1779
...
...
@@ -20,6 +20,12 @@ select if(u=1,binary st,st) s from t1 order by s;
select
if
(
u
=
1
,
st
,
binary
st
)
s
from
t1
where
st
like
"%a%"
order
by
s
;
drop
table
t1
;
#
# Bug 2629
#
select
NULLIF
(
NULL
,
NULL
),
NULLIF
(
NULL
,
1
),
NULLIF
(
NULL
,
1.0
),
NULLIF
(
NULL
,
"test"
);
select
NULLIF
(
1
,
NULL
),
NULLIF
(
1.0
,
NULL
),
NULLIF
(
"test"
,
NULL
);
#
# Problem with IF()
#
...
...
sql/item_cmpfunc.cc
View file @
cc5b1779
...
...
@@ -616,7 +616,7 @@ double
Item_func_nullif
::
val
()
{
double
value
;
if
(
!
(
this
->*
cmp_func
)()
||
null_value
)
if
(
!
(
this
->*
cmp_func
)())
{
null_value
=
1
;
return
0.0
;
...
...
@@ -630,7 +630,7 @@ longlong
Item_func_nullif
::
val_int
()
{
longlong
value
;
if
(
!
(
this
->*
cmp_func
)()
||
null_value
)
if
(
!
(
this
->*
cmp_func
)())
{
null_value
=
1
;
return
0
;
...
...
@@ -644,7 +644,7 @@ String *
Item_func_nullif
::
val_str
(
String
*
str
)
{
String
*
res
;
if
(
!
(
this
->*
cmp_func
)()
||
null_value
)
if
(
!
(
this
->*
cmp_func
)())
{
null_value
=
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