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
9bb3c7eb
Commit
9bb3c7eb
authored
Oct 15, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/PA/5.0-opt-31019
into gleb.loc:/home/uchum/work/bk/5.0-opt
parents
97a98ff5
60761a7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+6
-0
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+8
-0
strings/decimal.c
strings/decimal.c
+2
-1
No files found.
mysql-test/r/type_decimal.result
View file @
9bb3c7eb
...
@@ -799,3 +799,9 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
...
@@ -799,3 +799,9 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
ROUND(qty,3) dps ROUND(qty,dps)
ROUND(qty,3) dps ROUND(qty,dps)
1.133 3 1.133
1.133 3 1.133
DROP TABLE t1;
DROP TABLE t1;
SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
%
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
MOD()
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
mysql-test/t/type_decimal.test
View file @
9bb3c7eb
...
@@ -408,3 +408,11 @@ INSERT INTO t1 VALUES (1.1325,3);
...
@@ -408,3 +408,11 @@ INSERT INTO t1 VALUES (1.1325,3);
SELECT
ROUND
(
qty
,
3
),
dps
,
ROUND
(
qty
,
dps
)
FROM
t1
;
SELECT
ROUND
(
qty
,
3
),
dps
,
ROUND
(
qty
,
dps
)
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug#31019: MOD() function and operator crashes MySQL when
# divisor is very long and < 1
#
SELECT
1
%
.
123456789123456789123456789123456789123456789123456789123456789123456789123456789
AS
'%'
;
SELECT
MOD
(
1
,
.
123456789123456789123456789123456789123456789123456789123456789123456789123456789
)
AS
'MOD()'
;
strings/decimal.c
View file @
9bb3c7eb
...
@@ -2323,11 +2323,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
...
@@ -2323,11 +2323,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
}
}
if
(
unlikely
(
intg0
+
frac0
>
to
->
len
))
if
(
unlikely
(
intg0
+
frac0
>
to
->
len
))
{
{
stop1
-=
to
->
len
-
frac0
-
intg0
;
stop1
-=
frac0
+
intg0
-
to
->
len
;
frac0
=
to
->
len
-
intg0
;
frac0
=
to
->
len
-
intg0
;
to
->
frac
=
frac0
*
DIG_PER_DEC1
;
to
->
frac
=
frac0
*
DIG_PER_DEC1
;
error
=
E_DEC_TRUNCATED
;
error
=
E_DEC_TRUNCATED
;
}
}
DBUG_ASSERT
(
buf0
+
(
stop1
-
start1
)
<=
to
->
buf
+
to
->
len
);
while
(
start1
<
stop1
)
while
(
start1
<
stop1
)
*
buf0
++=*
start1
++
;
*
buf0
++=*
start1
++
;
}
}
...
...
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