summaryrefslogtreecommitdiff
path: root/sql/protocol.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-05-16 19:20:00 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-05-16 19:20:00 +0400
commitdfbd777fd83d236cc559750048f0cabee87d93a0 (patch)
treefb6cb698aa6f12c54e5a3d67835b9112ea07291d /sql/protocol.h
parentddd3e261b253856720bd9dc2343a655ecc297e81 (diff)
parent404a1565bfe02e3ce06843f6c5bf243503a2fe99 (diff)
downloadmariadb-git-dfbd777fd83d236cc559750048f0cabee87d93a0.tar.gz
MWL#182: SHOW EXPLAIN: Merge 5.3->5.5
Diffstat (limited to 'sql/protocol.h')
-rw-r--r--sql/protocol.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/protocol.h b/sql/protocol.h
index d9bc48ce45d..3627e625c07 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -35,6 +35,7 @@ class Protocol
protected:
THD *thd;
String *packet;
+ /* Used by net_store_data() for charset conversions */
String *convert;
uint field_pos;
#ifndef DBUG_OFF
@@ -49,6 +50,10 @@ protected:
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
#endif
+ /*
+ The following two are low-level functions that are invoked from
+ higher-level store_xxx() funcs. The data is stored into this->packet.
+ */
bool net_store_data(const uchar *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
bool store_string_aux(const char *from, size_t length,
@@ -73,6 +78,20 @@ public:
virtual bool send_result_set_metadata(List<Item> *list, uint flags);
bool send_result_set_row(List<Item> *row_items);
+ void get_packet(const char **start, size_t *length)
+ {
+ *start= packet->ptr();
+ *length= packet->length();
+ }
+ void set_packet(const char *start, size_t len)
+ {
+ packet->length(0);
+ packet->append(start, len);
+#ifndef DBUG_OFF
+ field_pos= field_count - 1;
+#endif
+ }
+
bool store(I_List<i_string> *str_list);
bool store(const char *from, CHARSET_INFO *cs);
String *storage_packet() { return packet; }