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
02d153c7
Commit
02d153c7
authored
Jun 26, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
str2decimal: don't return a negative zero
parent
4a3acbcf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+3
-2
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+5
-0
storage/tokudb/mysql-test/tokudb/r/type_decimal.result
storage/tokudb/mysql-test/tokudb/r/type_decimal.result
+0
-2
strings/decimal.c
strings/decimal.c
+2
-0
No files found.
mysql-test/r/type_decimal.result
View file @
02d153c7
...
...
@@ -221,7 +221,6 @@ drop table t1;
create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
...
...
@@ -280,7 +279,6 @@ drop table t1;
create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
...
...
@@ -1012,6 +1010,9 @@ SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE
COLUMN_NAME DATA_TYPE COLUMN_TYPE
a decimal decimal(10,2)/*old*/
DROP TABLE t1dec102;
select cast('-0.0' as decimal(5,1)) < 0;
cast('-0.0' as decimal(5,1)) < 0
0
#
# End of 5.5 tests
#
mysql-test/t/type_decimal.test
View file @
02d153c7
...
...
@@ -604,6 +604,11 @@ SHOW COLUMNS FROM t1dec102;
SELECT
COLUMN_NAME
,
DATA_TYPE
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
't1dec102'
;
DROP
TABLE
t1dec102
;
#
# MDEV-10552 equality operation on cast of the value "-0.0" to decimal not working
#
select
cast
(
'-0.0'
as
decimal
(
5
,
1
))
<
0
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
storage/tokudb/mysql-test/tokudb/r/type_decimal.result
View file @
02d153c7
...
...
@@ -222,7 +222,6 @@ drop table t1;
create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
...
...
@@ -281,7 +280,6 @@ drop table t1;
create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
...
...
strings/decimal.c
View file @
02d153c7
...
...
@@ -928,6 +928,8 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed)
error
=
decimal_shift
(
to
,
(
int
)
exponent
);
}
}
if
(
to
->
sign
&&
decimal_is_zero
(
to
))
to
->
sign
=
0
;
return
error
;
fatal_error:
...
...
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