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
b3a2a3d6
Commit
b3a2a3d6
authored
Apr 11, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for verification tests: truncation of post digits should not return an error
parent
44dcec99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
libmysql/libmysql.c
libmysql/libmysql.c
+5
-4
No files found.
libmysql/libmysql.c
View file @
b3a2a3d6
...
...
@@ -3656,6 +3656,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
}
}
#define MY_TRUNC(val) (val < 0 ? - floor(-val) : floor(val))
/*
Convert double/float column to supplied buffer of any type.
...
...
@@ -3688,7 +3689,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
*
buffer
=
(
uint8
)
value
;
else
*
buffer
=
(
int8
)
value
;
*
param
->
error
=
value
!=
(
param
->
is_unsigned
?
(
double
)
((
uint8
)
*
buffer
)
:
*
param
->
error
=
MY_TRUNC
(
value
)
!=
(
param
->
is_unsigned
?
(
double
)
((
uint8
)
*
buffer
)
:
(
double
)
((
int8
)
*
buffer
));
break
;
case
MYSQL_TYPE_SHORT
:
...
...
@@ -3702,7 +3703,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
short
data
=
(
short
)
value
;
shortstore
(
buffer
,
data
);
}
*
param
->
error
=
value
!=
(
param
->
is_unsigned
?
(
double
)
(
*
(
ushort
*
)
buffer
)
:
*
param
->
error
=
MY_TRUNC
(
value
)
!=
(
param
->
is_unsigned
?
(
double
)
(
*
(
ushort
*
)
buffer
)
:
(
double
)
(
*
(
short
*
)
buffer
));
break
;
case
MYSQL_TYPE_LONG
:
...
...
@@ -3716,7 +3717,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
int32
data
=
(
int32
)
value
;
longstore
(
buffer
,
data
);
}
*
param
->
error
=
value
!=
(
param
->
is_unsigned
?
(
double
)
(
*
(
uint32
*
)
buffer
)
:
*
param
->
error
=
MY_TRUNC
(
value
)
!=
(
param
->
is_unsigned
?
(
double
)
(
*
(
uint32
*
)
buffer
)
:
(
double
)
(
*
(
int32
*
)
buffer
));
break
;
case
MYSQL_TYPE_LONGLONG
:
...
...
@@ -3730,7 +3731,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
longlong
data
=
(
longlong
)
value
;
longlongstore
(
buffer
,
data
);
}
*
param
->
error
=
value
!=
(
param
->
is_unsigned
?
*
param
->
error
=
MY_TRUNC
(
value
)
!=
(
param
->
is_unsigned
?
ulonglong2double
(
*
(
ulonglong
*
)
buffer
)
:
(
double
)
(
*
(
longlong
*
)
buffer
));
break
;
...
...
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