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
04d32c1d
Commit
04d32c1d
authored
Nov 07, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1-maint
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
parents
434192fe
02e764bd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
1 deletion
+111
-1
BitKeeper/etc/collapsed
BitKeeper/etc/collapsed
+2
-0
mysql-test/r/func_test.result
mysql-test/r/func_test.result
+75
-0
mysql-test/t/func_test.test
mysql-test/t/func_test.test
+32
-0
sql/item_func.cc
sql/item_func.cc
+2
-1
No files found.
BitKeeper/etc/collapsed
View file @
04d32c1d
452a92d0-31-8wSzSfZi165fcGcXPA
452a92d0-31-8wSzSfZi165fcGcXPA
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ
mysql-test/r/func_test.result
View file @
04d32c1d
...
@@ -183,3 +183,78 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
...
@@ -183,3 +183,78 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
2 2 -2 -2
2 2 -2 -2
select (12%0) <=> null as '1';
1
1
select (12%0) is null as '1';
1
1
select 12%0 as 'NULL';
NULL
NULL
select 12%2 as '0';
0
0
select 12%NULL as 'NULL';
NULL
NULL
select 12 % null as 'NULL';
NULL
NULL
select null % 12 as 'NULL';
NULL
NULL
select null % 0 as 'NULL';
NULL
NULL
select 0 % null as 'NULL';
NULL
NULL
select null % null as 'NULL';
NULL
NULL
select (12 mod 0) <=> null as '1';
1
1
select (12 mod 0) is null as '1';
1
1
select 12 mod 0 as 'NULL';
NULL
NULL
select 12 mod 2 as '0';
0
0
select 12 mod null as 'NULL';
NULL
NULL
select null mod 12 as 'NULL';
NULL
NULL
select null mod 0 as 'NULL';
NULL
NULL
select 0 mod null as 'NULL';
NULL
NULL
select null mod null as 'NULL';
NULL
NULL
select mod(12.0, 0) as 'NULL';
NULL
NULL
select mod(12, 0.0) as 'NULL';
NULL
NULL
select mod(12, NULL) as 'NULL';
NULL
NULL
select mod(12.0, NULL) as 'NULL';
NULL
NULL
select mod(NULL, 2) as 'NULL';
NULL
NULL
select mod(NULL, 2.0) as 'NULL';
NULL
NULL
mysql-test/t/func_test.test
View file @
04d32c1d
...
@@ -108,4 +108,36 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
...
@@ -108,4 +108,36 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select
5
mod
3
,
5
mod
-
3
,
-
5
mod
3
,
-
5
mod
-
3
;
select
5
mod
3
,
5
mod
-
3
,
-
5
mod
3
,
-
5
mod
-
3
;
#
# Bug#23411: The "%" (MOD) operator is not documented; MOD-ing zero returns strange result
# Manual: "Division by zero produces a NULL result"
#
select
(
12
%
0
)
<=>
null
as
'1'
;
select
(
12
%
0
)
is
null
as
'1'
;
select
12
%
0
as
'NULL'
;
select
12
%
2
as
'0'
;
select
12
%
NULL
as
'NULL'
;
select
12
%
null
as
'NULL'
;
select
null
%
12
as
'NULL'
;
select
null
%
0
as
'NULL'
;
select
0
%
null
as
'NULL'
;
select
null
%
null
as
'NULL'
;
select
(
12
mod
0
)
<=>
null
as
'1'
;
select
(
12
mod
0
)
is
null
as
'1'
;
select
12
mod
0
as
'NULL'
;
select
12
mod
2
as
'0'
;
select
12
mod
null
as
'NULL'
;
select
null
mod
12
as
'NULL'
;
select
null
mod
0
as
'NULL'
;
select
0
mod
null
as
'NULL'
;
select
null
mod
null
as
'NULL'
;
select
mod
(
12.0
,
0
)
as
'NULL'
;
select
mod
(
12
,
0.0
)
as
'NULL'
;
select
mod
(
12
,
NULL
)
as
'NULL'
;
select
mod
(
12.0
,
NULL
)
as
'NULL'
;
select
mod
(
NULL
,
2
)
as
'NULL'
;
select
mod
(
NULL
,
2.0
)
as
'NULL'
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_func.cc
View file @
04d32c1d
...
@@ -96,7 +96,7 @@ Item_func::Item_func(THD *thd, Item_func *item)
...
@@ -96,7 +96,7 @@ Item_func::Item_func(THD *thd, Item_func *item)
/*
/*
Resolve references to table column for a function and it
'
s argument
Resolve references to table column for a function and its argument
SYNOPSIS:
SYNOPSIS:
fix_fields()
fix_fields()
...
@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int()
...
@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int()
void
Item_func_mod
::
fix_length_and_dec
()
void
Item_func_mod
::
fix_length_and_dec
()
{
{
Item_num_op
::
fix_length_and_dec
();
Item_num_op
::
fix_length_and_dec
();
maybe_null
=
1
;
}
}
...
...
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