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
df1f7cab
Commit
df1f7cab
authored
Nov 27, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix decimal2longlong too
mysql-test/r/rpl_start_stop_slave.result: results updated
parent
87347253
Changes
2
Hide 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 @
df1f7cab
s
lave stop
;
s
top slave
;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset master;
reset slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
s
lave start
;
s
tart slave
;
stop slave;
stop slave;
create table t1(n int);
create table t1(n int);
start slave;
start slave;
...
...
strings/decimal.c
View file @
df1f7cab
...
@@ -532,7 +532,7 @@ int decimal2longlong(decimal *from, longlong *to)
...
@@ -532,7 +532,7 @@ int decimal2longlong(decimal *from, longlong *to)
{
{
dec1
*
buf
=
from
->
buf
;
dec1
*
buf
=
from
->
buf
;
longlong
x
=
0
;
longlong
x
=
0
;
int
intg
;
int
intg
,
frac
;
for
(
intg
=
from
->
intg
;
intg
>
0
;
intg
-=
DIG_PER_DEC1
)
for
(
intg
=
from
->
intg
;
intg
>
0
;
intg
-=
DIG_PER_DEC1
)
{
{
...
@@ -540,11 +540,11 @@ int decimal2longlong(decimal *from, longlong *to)
...
@@ -540,11 +540,11 @@ int decimal2longlong(decimal *from, longlong *to)
/*
/*
Attention: trick!
Attention: trick!
we're calculating -|from| instead of |from| here
we're calculating -|from| instead of |from| here
because |
MIN_LONGLONG| > MAX_LONGLONG
because |
LONGLONG_MIN| > LONGLONG_MAX
so we can convert -9223372036854775808 correctly
so we can convert -9223372036854775808 correctly
*/
*/
x
=
x
*
DIG_BASE
-
*
buf
++
;
x
=
x
*
DIG_BASE
-
*
buf
++
;
if
(
unlikely
(
x
>
y
))
if
(
unlikely
(
y
<
(
LONGLONG_MAX
/
DIG_BASE
)
||
x
>
y
))
{
{
*
to
=
from
->
sign
?
y
:
-
y
;
*
to
=
from
->
sign
?
y
:
-
y
;
return
E_DEC_OVERFLOW
;
return
E_DEC_OVERFLOW
;
...
@@ -558,7 +558,10 @@ int decimal2longlong(decimal *from, longlong *to)
...
@@ -558,7 +558,10 @@ int decimal2longlong(decimal *from, longlong *to)
}
}
*
to
=
from
->
sign
?
x
:
-
x
;
*
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