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
e96f66b9
Commit
e96f66b9
authored
Jul 23, 2020
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23270 Remove a String parameter from Protocol::store(double/float)
parent
0ac8e2cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
32 deletions
+29
-32
sql/field.cc
sql/field.cc
+2
-2
sql/protocol.cc
sql/protocol.cc
+8
-8
sql/protocol.h
sql/protocol.h
+9
-8
sql/slave.cc
sql/slave.cc
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-4
sql/sql_profile.cc
sql/sql_profile.cc
+2
-4
sql/sql_show.cc
sql/sql_show.cc
+1
-3
sql/sql_type.cc
sql/sql_type.cc
+2
-2
No files found.
sql/field.cc
View file @
e96f66b9
...
...
@@ -4689,7 +4689,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
bool
Field_float
::
send_binary
(
Protocol
*
protocol
)
{
DBUG_ASSERT
(
marked_for_read
());
return
protocol
->
store
((
float
)
Field_float
::
val_real
(),
dec
,
(
String
*
)
0
);
return
protocol
->
store
_float
((
float
)
Field_float
::
val_real
(),
dec
);
}
...
...
@@ -4982,7 +4982,7 @@ String *Field_double::val_str(String *val_buffer,
bool
Field_double
::
send_binary
(
Protocol
*
protocol
)
{
return
protocol
->
store
((
double
)
Field_double
::
val_real
(),
dec
,
(
String
*
)
0
);
return
protocol
->
store
_double
(
Field_double
::
val_real
(),
dec
);
}
...
...
sql/protocol.cc
View file @
e96f66b9
...
...
@@ -1301,25 +1301,25 @@ bool Protocol_text::store_decimal(const my_decimal *d)
}
bool
Protocol_text
::
store
(
float
from
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_text
::
store
_float
(
float
from
,
uint32
decimals
)
{
#ifndef DBUG_OFF
DBUG_ASSERT
(
valid_handler
(
field_pos
,
PROTOCOL_SEND_FLOAT
));
field_pos
++
;
#endif
Float
(
from
).
to_string
(
buffer
,
decimals
);
return
store_numeric_string_aux
(
buffer
->
ptr
(),
buffer
->
length
());
Float
(
from
).
to_string
(
&
buffer
,
decimals
);
return
store_numeric_string_aux
(
buffer
.
ptr
(),
buffer
.
length
());
}
bool
Protocol_text
::
store
(
double
from
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_text
::
store
_double
(
double
from
,
uint32
decimals
)
{
#ifndef DBUG_OFF
DBUG_ASSERT
(
valid_handler
(
field_pos
,
PROTOCOL_SEND_DOUBLE
));
field_pos
++
;
#endif
buffer
->
set_real
(
from
,
decimals
,
thd
->
charset
());
return
store_numeric_string_aux
(
buffer
->
ptr
(),
buffer
->
length
());
buffer
.
set_real
(
from
,
decimals
,
thd
->
charset
());
return
store_numeric_string_aux
(
buffer
.
ptr
(),
buffer
.
length
());
}
...
...
@@ -1538,7 +1538,7 @@ bool Protocol_binary::store_decimal(const my_decimal *d)
thd
->
variables
.
character_set_results
);
}
bool
Protocol_binary
::
store
(
float
from
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_binary
::
store
_float
(
float
from
,
uint32
decimals
)
{
field_pos
++
;
char
*
to
=
packet
->
prep_append
(
4
,
PACKET_BUFFER_EXTRA_ALLOC
);
...
...
@@ -1549,7 +1549,7 @@ bool Protocol_binary::store(float from, uint32 decimals, String *buffer)
}
bool
Protocol_binary
::
store
(
double
from
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_binary
::
store
_double
(
double
from
,
uint32
decimals
)
{
field_pos
++
;
char
*
to
=
packet
->
prep_append
(
8
,
PACKET_BUFFER_EXTRA_ALLOC
);
...
...
sql/protocol.h
View file @
e96f66b9
...
...
@@ -141,8 +141,8 @@ class Protocol
CHARSET_INFO
*
fromcs
,
my_repertoire_t
from_repertoire
,
CHARSET_INFO
*
tocs
)
=
0
;
virtual
bool
store
(
float
from
,
uint32
decimals
,
String
*
buffer
)
=
0
;
virtual
bool
store
(
double
from
,
uint32
decimals
,
String
*
buffer
)
=
0
;
virtual
bool
store
_float
(
float
from
,
uint32
decimals
)
=
0
;
virtual
bool
store
_double
(
double
from
,
uint32
decimals
)
=
0
;
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
)
=
0
;
virtual
bool
store_date
(
MYSQL_TIME
*
time
)
=
0
;
virtual
bool
store_time
(
MYSQL_TIME
*
time
,
int
decimals
)
=
0
;
...
...
@@ -208,6 +208,7 @@ class Protocol
class
Protocol_text
final
:
public
Protocol
{
StringBuffer
<
FLOATING_POINT_BUFFER
>
buffer
;
bool
store_numeric_string_aux
(
const
char
*
from
,
size_t
length
);
public:
Protocol_text
(
THD
*
thd_arg
,
ulong
prealloc
=
0
)
...
...
@@ -230,8 +231,8 @@ class Protocol_text final :public Protocol
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
)
override
;
bool
store_date
(
MYSQL_TIME
*
time
)
override
;
bool
store_time
(
MYSQL_TIME
*
time
,
int
decimals
)
override
;
bool
store
(
float
nr
,
uint32
decimals
,
String
*
buffer
)
override
;
bool
store
(
double
from
,
uint32
decimals
,
String
*
buffer
)
override
;
bool
store
_float
(
float
nr
,
uint32
decimals
)
override
;
bool
store
_double
(
double
from
,
uint32
decimals
)
override
;
bool
store
(
Field
*
field
)
override
;
bool
send_out_parameters
(
List
<
Item_param
>
*
sp_params
)
override
;
...
...
@@ -276,8 +277,8 @@ class Protocol_binary final :public Protocol
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
)
override
;
bool
store_date
(
MYSQL_TIME
*
time
)
override
;
bool
store_time
(
MYSQL_TIME
*
time
,
int
decimals
)
override
;
bool
store
(
float
nr
,
uint32
decimals
,
String
*
buffer
)
override
;
bool
store
(
double
from
,
uint32
decimals
,
String
*
buffer
)
override
;
bool
store
_float
(
float
nr
,
uint32
decimals
)
override
;
bool
store
_double
(
double
from
,
uint32
decimals
)
override
;
bool
store
(
Field
*
field
)
override
;
bool
send_out_parameters
(
List
<
Item_param
>
*
sp_params
)
override
;
...
...
@@ -328,8 +329,8 @@ class Protocol_discard final : public Protocol
bool
store
(
MYSQL_TIME
*
,
int
)
override
{
return
false
;
}
bool
store_date
(
MYSQL_TIME
*
)
override
{
return
false
;
}
bool
store_time
(
MYSQL_TIME
*
,
int
)
override
{
return
false
;
}
bool
store
(
float
,
uint32
,
String
*
)
override
{
return
false
;
}
bool
store
(
double
,
uint32
,
String
*
)
override
{
return
false
;
}
bool
store
_float
(
float
,
uint32
)
override
{
return
false
;
}
bool
store
_double
(
double
,
uint32
)
override
{
return
false
;
}
bool
store
(
Field
*
)
override
{
return
false
;
}
enum
enum_protocol_type
type
()
override
{
return
PROTOCOL_DISCARD
;
};
};
...
...
sql/slave.cc
View file @
e96f66b9
...
...
@@ -3478,7 +3478,7 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
protocol
->
store
((
ulonglong
)
mi
->
rli
.
max_relay_log_size
);
protocol
->
store
(
mi
->
rli
.
executed_entries
);
protocol
->
store
((
uint32
)
mi
->
received_heartbeats
);
protocol
->
store
((
double
)
mi
->
heartbeat_period
,
3
,
&
tmp
);
protocol
->
store
_double
(
mi
->
heartbeat_period
,
3
);
protocol
->
store
(
gtid_pos
->
ptr
(),
gtid_pos
->
length
(),
&
my_charset_bin
);
}
...
...
sql/sql_prepare.cc
View file @
e96f66b9
...
...
@@ -269,8 +269,8 @@ class Protocol_local :public Protocol
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
);
virtual
bool
store_date
(
MYSQL_TIME
*
time
);
virtual
bool
store_time
(
MYSQL_TIME
*
time
,
int
decimals
);
virtual
bool
store
(
float
value
,
uint32
decimals
,
String
*
buffer
);
virtual
bool
store
(
double
value
,
uint32
decimals
,
String
*
buffer
);
virtual
bool
store
_float
(
float
value
,
uint32
decimals
);
virtual
bool
store
_double
(
double
value
,
uint32
decimals
);
virtual
bool
store
(
Field
*
field
);
virtual
bool
send_result_set_metadata
(
List
<
Item
>
*
list
,
uint
flags
);
...
...
@@ -5378,7 +5378,7 @@ bool Protocol_local::store_time(MYSQL_TIME *time, int decimals)
/* Store a floating point number, as is. */
bool
Protocol_local
::
store
(
float
value
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_local
::
store
_float
(
float
value
,
uint32
decimals
)
{
return
store_column
(
&
value
,
sizeof
(
float
));
}
...
...
@@ -5386,7 +5386,7 @@ bool Protocol_local::store(float value, uint32 decimals, String *buffer)
/* Store a double precision number, as is. */
bool
Protocol_local
::
store
(
double
value
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_local
::
store
_double
(
double
value
,
uint32
decimals
)
{
return
store_column
(
&
value
,
sizeof
(
double
));
}
...
...
sql/sql_profile.cc
View file @
e96f66b9
...
...
@@ -433,8 +433,6 @@ bool PROFILING::show_profiles()
{
prof
=
history
.
iterator_value
(
iterator
);
String
elapsed
;
double
query_time_usecs
=
prof
->
m_end_time_usecs
-
prof
->
m_start_time_usecs
;
if
(
unit
->
lim
.
check_offset
(
idx
))
...
...
@@ -444,8 +442,8 @@ bool PROFILING::show_profiles()
protocol
->
prepare_for_resend
();
protocol
->
store
((
uint32
)(
prof
->
profiling_query_id
));
protocol
->
store
((
double
)(
query_time_usecs
/
(
1000.0
*
1000
)
),
(
uint32
)
TIME_FLOAT_DIGITS
-
1
,
&
elapsed
);
protocol
->
store
_double
(
query_time_usecs
/
(
1000.0
*
1000
),
(
uint32
)
TIME_FLOAT_DIGITS
-
1
);
if
(
prof
->
query_source
!=
NULL
)
protocol
->
store
(
prof
->
query_source
,
strlen
(
prof
->
query_source
),
system_charset_info
);
...
...
sql/sql_show.cc
View file @
e96f66b9
...
...
@@ -2891,8 +2891,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
server_threads
.
iterate
(
list_callback
,
&
arg
);
ulonglong
now
=
microsecond_interval_timer
();
char
buff
[
20
];
// For progress
String
store_buffer
(
buff
,
sizeof
(
buff
),
system_charset_info
);
while
(
auto
thd_info
=
arg
.
thread_infos
.
get
())
{
...
...
@@ -2918,7 +2916,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
protocol
->
store_null
();
if
(
!
thd
->
variables
.
old_mode
&&
!
(
thd
->
variables
.
old_behavior
&
OLD_MODE_NO_PROGRESS_INFO
))
protocol
->
store
(
thd_info
->
progress
,
3
,
&
store_buffer
);
protocol
->
store
_double
(
thd_info
->
progress
,
3
);
if
(
protocol
->
write
())
break
;
/* purecov: inspected */
}
...
...
sql/sql_type.cc
View file @
e96f66b9
...
...
@@ -7348,7 +7348,7 @@ bool Type_handler::
{
float
nr
=
(
float
)
item
->
val_real
();
if
(
!
item
->
null_value
)
return
protocol
->
store
(
nr
,
item
->
decimals
,
&
buf
->
m_string
);
return
protocol
->
store
_float
(
nr
,
item
->
decimals
);
return
protocol
->
store_null
();
}
...
...
@@ -7358,7 +7358,7 @@ bool Type_handler::
{
double
nr
=
item
->
val_real
();
if
(
!
item
->
null_value
)
return
protocol
->
store
(
nr
,
item
->
decimals
,
&
buf
->
m_string
);
return
protocol
->
store
_double
(
nr
,
item
->
decimals
);
return
protocol
->
store_null
();
}
...
...
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