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
31a79ee3
Commit
31a79ee3
authored
Oct 17, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Item_func_abs::fix_length_and_dec() to set maybe_null properly. (Bug #14009)
parent
d10326a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+6
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+10
-0
sql/item_func.cc
sql/item_func.cc
+1
-0
No files found.
mysql-test/r/func_math.result
View file @
31a79ee3
...
@@ -145,3 +145,9 @@ insert into t1 values (1);
...
@@ -145,3 +145,9 @@ insert into t1 values (1);
select rand(i) from t1;
select rand(i) from t1;
ERROR HY000: Incorrect arguments to RAND
ERROR HY000: Incorrect arguments to RAND
drop table t1;
drop table t1;
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
insert into t1 values ('http://www.foo.com/', now());
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
a
http://www.foo.com/
drop table t1;
mysql-test/t/func_math.test
View file @
31a79ee3
...
@@ -86,4 +86,14 @@ insert into t1 values (1);
...
@@ -86,4 +86,14 @@ insert into t1 values (1);
select
rand
(
i
)
from
t1
;
select
rand
(
i
)
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #14009: use of abs() on null value causes problems with filesort
#
# InnoDB is required to reproduce the fault, but it is okay if we default to
# MyISAM when testing.
create
table
t1
(
a
varchar
(
90
),
ts
datetime
not
null
,
index
(
a
))
engine
=
innodb
default
charset
=
utf8
;
insert
into
t1
values
(
'http://www.foo.com/'
,
now
());
select
a
from
t1
where
a
=
'http://www.foo.com/'
order
by
abs
(
timediff
(
ts
,
0
));
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_func.cc
View file @
31a79ee3
...
@@ -766,6 +766,7 @@ void Item_func_abs::fix_length_and_dec()
...
@@ -766,6 +766,7 @@ void Item_func_abs::fix_length_and_dec()
hybrid_type
=
REAL_RESULT
;
hybrid_type
=
REAL_RESULT
;
if
(
args
[
0
]
->
result_type
()
==
INT_RESULT
)
if
(
args
[
0
]
->
result_type
()
==
INT_RESULT
)
hybrid_type
=
INT_RESULT
;
hybrid_type
=
INT_RESULT
;
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