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
5935e9ef
Commit
5935e9ef
authored
Sep 25, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: get_float convenience helper
more helpers like that can be added as needed
parent
04255c95
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
21 deletions
+16
-21
include/my_byteorder.h
include/my_byteorder.h
+9
-0
libmysqld/libmysql.c
libmysqld/libmysql.c
+1
-3
sql/field.cc
sql/field.cc
+2
-6
sql/log_event_client.cc
sql/log_event_client.cc
+1
-3
storage/heap/hp_hash.c
storage/heap/hp_hash.c
+1
-3
storage/maria/ma_key.c
storage/maria/ma_key.c
+1
-3
storage/myisam/mi_key.c
storage/myisam/mi_key.c
+1
-3
No files found.
include/my_byteorder.h
View file @
5935e9ef
...
...
@@ -16,6 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include <string.h>
/*
Macro for reading 32-bit integer from network byte order (big-endian)
...
...
@@ -51,4 +52,12 @@
#include "little_endian.h"
#endif
/* convenienve helpers */
static
inline
float
get_float
(
const
void
*
from
)
{
float
to
;
float4get
(
to
,
((
const
uchar
*
)
from
));
return
to
;
}
#endif
/* MY_BYTEORDER_INCLUDED */
libmysqld/libmysql.c
View file @
5935e9ef
...
...
@@ -3658,9 +3658,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
}
case
MYSQL_TYPE_FLOAT
:
{
float
value
;
float4get
(
value
,
*
row
);
fetch_float_with_conversion
(
param
,
field
,
value
,
MY_GCVT_ARG_FLOAT
);
fetch_float_with_conversion
(
param
,
field
,
get_float
(
*
row
),
MY_GCVT_ARG_FLOAT
);
*
row
+=
4
;
break
;
}
...
...
sql/field.cc
View file @
5935e9ef
...
...
@@ -4784,16 +4784,12 @@ int Field_float::store(longlong nr, bool unsigned_val)
double
Field_float
::
val_real
(
void
)
{
DBUG_ASSERT
(
marked_for_read
());
float
j
;
float4get
(
j
,
ptr
);
return
((
double
)
j
);
return
((
double
)
get_float
(
ptr
));
}
longlong
Field_float
::
val_int
(
void
)
{
float
j
;
float4get
(
j
,
ptr
);
return
Converter_double_to_longlong
(
j
,
false
).
result
();
return
Converter_double_to_longlong
(
get_float
(
ptr
),
false
).
result
();
}
...
...
sql/log_event_client.cc
View file @
5935e9ef
...
...
@@ -632,10 +632,8 @@ log_event_print_value(IO_CACHE *file, PRINT_EVENT_INFO *print_event_info,
if
(
!
ptr
)
goto
return_null
;
float
fl
;
float4get
(
fl
,
ptr
);
char
tmp
[
320
];
sprintf
(
tmp
,
"%-20g"
,
(
double
)
fl
);
sprintf
(
tmp
,
"%-20g"
,
(
double
)
get_float
(
ptr
)
);
my_b_printf
(
file
,
"%s"
,
tmp
);
/* my_snprintf doesn't support %-20g */
return
4
;
}
...
...
storage/heap/hp_hash.c
View file @
5935e9ef
...
...
@@ -635,9 +635,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
if
(
seg
->
type
==
HA_KEYTYPE_FLOAT
)
{
float
nr
;
float4get
(
nr
,
pos
);
if
(
isnan
(
nr
))
if
(
isnan
(
get_float
(
pos
)))
{
/* Replace NAN with zero */
bzero
(
key
,
length
);
...
...
storage/maria/ma_key.c
View file @
5935e9ef
...
...
@@ -284,9 +284,7 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr,
{
/* Numerical column */
if
(
type
==
HA_KEYTYPE_FLOAT
)
{
float
nr
;
float4get
(
nr
,
pos
);
if
(
isnan
(
nr
))
if
(
isnan
(
get_float
(
pos
)))
{
/* Replace NAN with zero */
bzero
(
key
,
length
);
...
...
storage/myisam/mi_key.c
View file @
5935e9ef
...
...
@@ -158,9 +158,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
{
/* Numerical column */
if
(
type
==
HA_KEYTYPE_FLOAT
)
{
float
nr
;
float4get
(
nr
,
pos
);
if
(
isnan
(
nr
))
if
(
isnan
(
get_float
(
pos
)))
{
/* Replace NAN with zero */
bzero
(
key
,
length
);
...
...
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