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
30e7a0a8
Commit
30e7a0a8
authored
Jul 13, 2020
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23157 Remove redundant virtual Protocol::store()
parent
5967dfdb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
24 deletions
+9
-24
sql/protocol.cc
sql/protocol.cc
+8
-20
sql/protocol.h
sql/protocol.h
+1
-4
No files found.
sql/protocol.cc
View file @
30e7a0a8
...
@@ -1206,6 +1206,9 @@ bool Protocol_text::store(const char *from, size_t length,
...
@@ -1206,6 +1206,9 @@ bool Protocol_text::store(const char *from, size_t length,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
{
{
#ifndef DBUG_OFF
#ifndef DBUG_OFF
DBUG_PRINT
(
"info"
,
(
"Protocol_text::store field %u (%u): %.*b"
,
field_pos
,
field_count
,
(
int
)
length
,
(
length
==
0
?
""
:
from
)));
DBUG_ASSERT
(
field_handlers
==
0
||
field_pos
<
field_count
);
DBUG_ASSERT
(
valid_handler
(
field_pos
,
PROTOCOL_SEND_STRING
));
DBUG_ASSERT
(
valid_handler
(
field_pos
,
PROTOCOL_SEND_STRING
));
field_pos
++
;
field_pos
++
;
#endif
#endif
...
@@ -1213,18 +1216,11 @@ bool Protocol_text::store(const char *from, size_t length,
...
@@ -1213,18 +1216,11 @@ bool Protocol_text::store(const char *from, size_t length,
}
}
bool
Protocol
_text
::
store
(
const
char
*
from
,
size_t
length
,
bool
Protocol
::
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
)
CHARSET_INFO
*
fromcs
)
{
{
CHARSET_INFO
*
tocs
=
this
->
thd
->
variables
.
character_set_results
;
CHARSET_INFO
*
tocs
=
this
->
thd
->
variables
.
character_set_results
;
#ifndef DBUG_OFF
return
store
(
from
,
length
,
fromcs
,
tocs
);
DBUG_PRINT
(
"info"
,
(
"Protocol_text::store field %u (%u): %.*b"
,
field_pos
,
field_count
,
(
int
)
length
,
(
length
==
0
?
""
:
from
)));
DBUG_ASSERT
(
field_handlers
==
0
||
field_pos
<
field_count
);
DBUG_ASSERT
(
valid_handler
(
field_pos
,
PROTOCOL_SEND_STRING
));
field_pos
++
;
#endif
return
store_string_aux
(
from
,
length
,
fromcs
,
tocs
);
}
}
...
@@ -1455,14 +1451,6 @@ void Protocol_binary::prepare_for_resend()
...
@@ -1455,14 +1451,6 @@ void Protocol_binary::prepare_for_resend()
}
}
bool
Protocol_binary
::
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
)
{
CHARSET_INFO
*
tocs
=
thd
->
variables
.
character_set_results
;
field_pos
++
;
return
store_string_aux
(
from
,
length
,
fromcs
,
tocs
);
}
bool
Protocol_binary
::
store
(
const
char
*
from
,
size_t
length
,
bool
Protocol_binary
::
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
{
{
...
@@ -1526,11 +1514,11 @@ bool Protocol_binary::store_decimal(const my_decimal *d)
...
@@ -1526,11 +1514,11 @@ bool Protocol_binary::store_decimal(const my_decimal *d)
{
{
#ifndef DBUG_OFF
#ifndef DBUG_OFF
DBUG_ASSERT
(
0
);
// This method is not used yet
DBUG_ASSERT
(
0
);
// This method is not used yet
field_pos
++
;
#endif
#endif
StringBuffer
<
DECIMAL_MAX_STR_LENGTH
>
str
;
StringBuffer
<
DECIMAL_MAX_STR_LENGTH
>
str
;
(
void
)
d
->
to_string
(
&
str
);
(
void
)
d
->
to_string
(
&
str
);
return
store
(
str
.
ptr
(),
str
.
length
(),
str
.
charset
());
return
store
(
str
.
ptr
(),
str
.
length
(),
str
.
charset
(),
thd
->
variables
.
character_set_results
);
}
}
bool
Protocol_binary
::
store
(
float
from
,
uint32
decimals
,
String
*
buffer
)
bool
Protocol_binary
::
store
(
float
from
,
uint32
decimals
,
String
*
buffer
)
...
...
sql/protocol.h
View file @
30e7a0a8
...
@@ -120,7 +120,7 @@ class Protocol
...
@@ -120,7 +120,7 @@ class Protocol
virtual
bool
store_long
(
longlong
from
)
=
0
;
virtual
bool
store_long
(
longlong
from
)
=
0
;
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
)
=
0
;
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
)
=
0
;
virtual
bool
store_decimal
(
const
my_decimal
*
)
=
0
;
virtual
bool
store_decimal
(
const
my_decimal
*
)
=
0
;
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
cs
)
=
0
;
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
cs
)
;
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
=
0
;
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
=
0
;
bool
store_str
(
const
LEX_CSTRING
&
s
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
bool
store_str
(
const
LEX_CSTRING
&
s
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
)
...
@@ -178,7 +178,6 @@ class Protocol_text :public Protocol
...
@@ -178,7 +178,6 @@ class Protocol_text :public Protocol
virtual
bool
store_long
(
longlong
from
);
virtual
bool
store_long
(
longlong
from
);
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
);
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
);
virtual
bool
store_decimal
(
const
my_decimal
*
);
virtual
bool
store_decimal
(
const
my_decimal
*
);
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
cs
);
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
);
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
);
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
);
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
);
...
@@ -223,7 +222,6 @@ class Protocol_binary :public Protocol
...
@@ -223,7 +222,6 @@ class Protocol_binary :public Protocol
virtual
bool
store_long
(
longlong
from
);
virtual
bool
store_long
(
longlong
from
);
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
);
virtual
bool
store_longlong
(
longlong
from
,
bool
unsigned_flag
);
virtual
bool
store_decimal
(
const
my_decimal
*
);
virtual
bool
store_decimal
(
const
my_decimal
*
);
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
cs
);
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
virtual
bool
store
(
const
char
*
from
,
size_t
length
,
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
);
CHARSET_INFO
*
fromcs
,
CHARSET_INFO
*
tocs
);
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
);
virtual
bool
store
(
MYSQL_TIME
*
time
,
int
decimals
);
...
@@ -272,7 +270,6 @@ class Protocol_discard : public Protocol_text
...
@@ -272,7 +270,6 @@ class Protocol_discard : public Protocol_text
bool
store_long
(
longlong
)
{
return
false
;
}
bool
store_long
(
longlong
)
{
return
false
;
}
bool
store_longlong
(
longlong
,
bool
)
{
return
false
;
}
bool
store_longlong
(
longlong
,
bool
)
{
return
false
;
}
bool
store_decimal
(
const
my_decimal
*
)
{
return
false
;
}
bool
store_decimal
(
const
my_decimal
*
)
{
return
false
;
}
bool
store
(
const
char
*
,
size_t
,
CHARSET_INFO
*
)
{
return
false
;
}
bool
store
(
const
char
*
,
size_t
,
CHARSET_INFO
*
,
CHARSET_INFO
*
)
{
return
false
;
}
bool
store
(
const
char
*
,
size_t
,
CHARSET_INFO
*
,
CHARSET_INFO
*
)
{
return
false
;
}
bool
store
(
MYSQL_TIME
*
,
int
)
{
return
false
;
}
bool
store
(
MYSQL_TIME
*
,
int
)
{
return
false
;
}
bool
store_date
(
MYSQL_TIME
*
)
{
return
false
;
}
bool
store_date
(
MYSQL_TIME
*
)
{
return
false
;
}
...
...
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