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
34c3ab70
Commit
34c3ab70
authored
Nov 27, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix decimal2longlong too
parent
246cf0d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
mysql-test/r/rpl_start_stop_slave.result
mysql-test/r/rpl_start_stop_slave.result
+2
-2
strings/decimal.c
strings/decimal.c
+7
-4
No files found.
mysql-test/r/rpl_start_stop_slave.result
View file @
34c3ab70
s
lave stop
;
s
top slave
;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
s
lave start
;
s
tart slave
;
stop slave;
create table t1(n int);
start slave;
...
...
strings/decimal.c
View file @
34c3ab70
...
...
@@ -532,7 +532,7 @@ int decimal2longlong(decimal *from, longlong *to)
{
dec1
*
buf
=
from
->
buf
;
longlong
x
=
0
;
int
intg
;
int
intg
,
frac
;
for
(
intg
=
from
->
intg
;
intg
>
0
;
intg
-=
DIG_PER_DEC1
)
{
...
...
@@ -540,11 +540,11 @@ int decimal2longlong(decimal *from, longlong *to)
/*
Attention: trick!
we're calculating -|from| instead of |from| here
because |
MIN_LONGLONG| > MAX_LONGLONG
because |
LONGLONG_MIN| > LONGLONG_MAX
so we can convert -9223372036854775808 correctly
*/
x
=
x
*
DIG_BASE
-
*
buf
++
;
if
(
unlikely
(
x
>
y
))
if
(
unlikely
(
y
<
(
LONGLONG_MAX
/
DIG_BASE
)
||
x
>
y
))
{
*
to
=
from
->
sign
?
y
:
-
y
;
return
E_DEC_OVERFLOW
;
...
...
@@ -558,7 +558,10 @@ int decimal2longlong(decimal *from, longlong *to)
}
*
to
=
from
->
sign
?
x
:
-
x
;
return
from
->
frac
?
E_DEC_TRUNCATED
:
E_DEC_OK
;
for
(
frac
=
from
->
frac
;
unlikely
(
frac
>
0
);
frac
-=
DIG_PER_DEC1
)
if
(
*
buf
++
)
return
E_DEC_TRUNCATED
;
return
E_DEC_OK
;
}
/*
...
...
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