diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-01-03 23:16:16 +0100 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-01-03 23:16:16 +0100 |
commit | b01348879d066c3207ac70aa630ed021a2552920 (patch) | |
tree | 44b64f886288ac8b8b5c49ae9a94fe574ddc7c5f /sql/protocol.h | |
parent | 7714496dc1c72d01fd214cb7737ca4216a982e0f (diff) | |
parent | ca020dfa9e8668ce52eaff92c157097bba671ec1 (diff) | |
download | mariadb-git-b01348879d066c3207ac70aa630ed021a2552920.tar.gz |
MWL#182: Explain running statements: merge with 5.3-main (needs fixing)
Diffstat (limited to 'sql/protocol.h')
-rw-r--r-- | sql/protocol.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/protocol.h b/sql/protocol.h index bd7462a1280..c74846755b0 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -31,6 +31,7 @@ class Protocol protected: THD *thd; String *packet; + /* Used by net_store_data() for charset conversions */ String *convert; uint field_pos; #ifndef DBUG_OFF @@ -45,6 +46,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, @@ -58,6 +63,20 @@ public: enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 }; virtual bool send_fields(List<Item> *list, uint flags); + 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; } |