summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorunknown <guilhem@gbichot3.local>2007-01-30 22:48:05 +0100
committerunknown <guilhem@gbichot3.local>2007-01-30 22:48:05 +0100
commit7f028f6b03dc9bb01a2a631dfb1def842be35b30 (patch)
tree882f9a64d2c25aaf2e3c29ae0c6c167806bb794a /sql/protocol.cc
parent2f6812be61c380ae6a48f9d8351dde152cf3c36e (diff)
downloadmariadb-git-7f028f6b03dc9bb01a2a631dfb1def842be35b30.tar.gz
Mechanical class renaming:
Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary and also THD::protocol_simple->THD::protocol_text, THD::protocol_prep->THD::protocol_binary. Reason: the binary protocol is not bound to be used only with prepared statements long term (see WL#3559 "Decouple binary protocol from prepared statements"). Renaming now is pressing because the fix for BUG#735 "Prepared Statements: there is no support for Query Cache" will introduce a new member in class Query_cache_flags telling about the protocol's nature. Other reason: "simple" is less accurate than "text". Future patches for BUG#735 will rely on this cset. libmysqld/lib_sql.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/protocol.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/protocol.h: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/set_var.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_class.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_class.h: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_prepare.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc68
1 files changed, 34 insertions, 34 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index da46405dea2..9d313680582 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -33,7 +33,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err);
#ifndef EMBEDDED_LIBRARY
bool Protocol::net_store_data(const char *from, uint length)
#else
-bool Protocol_prep::net_store_data(const char *from, uint length)
+bool Protocol_binary::net_store_data(const char *from, uint length)
#endif
{
ulong packet_length=packet->length();
@@ -555,7 +555,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
Item *item;
char buff[80];
String tmp((char*) buff,sizeof(buff),&my_charset_bin);
- Protocol_simple prot(thd);
+ Protocol_text prot(thd);
String *local_packet= prot.storage_packet();
CHARSET_INFO *thd_charset= thd->variables.character_set_results;
DBUG_ENTER("send_fields");
@@ -758,7 +758,7 @@ bool Protocol::store(I_List<i_string>* str_list)
****************************************************************************/
#ifndef EMBEDDED_LIBRARY
-void Protocol_simple::prepare_for_resend()
+void Protocol_text::prepare_for_resend()
{
packet->length(0);
#ifndef DBUG_OFF
@@ -766,7 +766,7 @@ void Protocol_simple::prepare_for_resend()
#endif
}
-bool Protocol_simple::store_null()
+bool Protocol_text::store_null()
{
#ifndef DBUG_OFF
field_pos++;
@@ -799,7 +799,7 @@ bool Protocol::store_string_aux(const char *from, uint length,
}
-bool Protocol_simple::store(const char *from, uint length,
+bool Protocol_text::store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
#ifndef DBUG_OFF
@@ -815,7 +815,7 @@ bool Protocol_simple::store(const char *from, uint length,
}
-bool Protocol_simple::store(const char *from, uint length,
+bool Protocol_text::store(const char *from, uint length,
CHARSET_INFO *fromcs)
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
@@ -832,7 +832,7 @@ bool Protocol_simple::store(const char *from, uint length,
}
-bool Protocol_simple::store_tiny(longlong from)
+bool Protocol_text::store_tiny(longlong from)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY);
@@ -844,7 +844,7 @@ bool Protocol_simple::store_tiny(longlong from)
}
-bool Protocol_simple::store_short(longlong from)
+bool Protocol_text::store_short(longlong from)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -858,7 +858,7 @@ bool Protocol_simple::store_short(longlong from)
}
-bool Protocol_simple::store_long(longlong from)
+bool Protocol_text::store_long(longlong from)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -872,7 +872,7 @@ bool Protocol_simple::store_long(longlong from)
}
-bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag)
+bool Protocol_text::store_longlong(longlong from, bool unsigned_flag)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -887,7 +887,7 @@ bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag)
}
-bool Protocol_simple::store_decimal(const my_decimal *d)
+bool Protocol_text::store_decimal(const my_decimal *d)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -901,7 +901,7 @@ bool Protocol_simple::store_decimal(const my_decimal *d)
}
-bool Protocol_simple::store(float from, uint32 decimals, String *buffer)
+bool Protocol_text::store(float from, uint32 decimals, String *buffer)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -913,7 +913,7 @@ bool Protocol_simple::store(float from, uint32 decimals, String *buffer)
}
-bool Protocol_simple::store(double from, uint32 decimals, String *buffer)
+bool Protocol_text::store(double from, uint32 decimals, String *buffer)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -925,7 +925,7 @@ bool Protocol_simple::store(double from, uint32 decimals, String *buffer)
}
-bool Protocol_simple::store(Field *field)
+bool Protocol_text::store(Field *field)
{
if (field->is_null())
return store_null();
@@ -959,7 +959,7 @@ bool Protocol_simple::store(Field *field)
*/
-bool Protocol_simple::store(TIME *tm)
+bool Protocol_text::store(TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -982,7 +982,7 @@ bool Protocol_simple::store(TIME *tm)
}
-bool Protocol_simple::store_date(TIME *tm)
+bool Protocol_text::store_date(TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -1001,7 +1001,7 @@ bool Protocol_simple::store_date(TIME *tm)
we support 0-6 decimals for time.
*/
-bool Protocol_simple::store_time(TIME *tm)
+bool Protocol_text::store_time(TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -1041,7 +1041,7 @@ bool Protocol_simple::store_time(TIME *tm)
[..]..[[length]data] data
****************************************************************************/
-bool Protocol_prep::prepare_for_send(List<Item> *item_list)
+bool Protocol_binary::prepare_for_send(List<Item> *item_list)
{
Protocol::prepare_for_send(item_list);
bit_fields= (field_count+9)/8;
@@ -1052,7 +1052,7 @@ bool Protocol_prep::prepare_for_send(List<Item> *item_list)
}
-void Protocol_prep::prepare_for_resend()
+void Protocol_binary::prepare_for_resend()
{
packet->length(bit_fields+1);
bzero((char*) packet->ptr(), 1+bit_fields);
@@ -1060,21 +1060,21 @@ void Protocol_prep::prepare_for_resend()
}
-bool Protocol_prep::store(const char *from, uint length, CHARSET_INFO *fromcs)
+bool Protocol_binary::store(const char *from, uint length, CHARSET_INFO *fromcs)
{
CHARSET_INFO *tocs= thd->variables.character_set_results;
field_pos++;
return store_string_aux(from, length, fromcs, tocs);
}
-bool Protocol_prep::store(const char *from,uint length,
+bool Protocol_binary::store(const char *from,uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
field_pos++;
return store_string_aux(from, length, fromcs, tocs);
}
-bool Protocol_prep::store_null()
+bool Protocol_binary::store_null()
{
uint offset= (field_pos+2)/8+1, bit= (1 << ((field_pos+2) & 7));
/* Room for this as it's allocated in prepare_for_send */
@@ -1085,7 +1085,7 @@ bool Protocol_prep::store_null()
}
-bool Protocol_prep::store_tiny(longlong from)
+bool Protocol_binary::store_tiny(longlong from)
{
char buff[1];
field_pos++;
@@ -1094,7 +1094,7 @@ bool Protocol_prep::store_tiny(longlong from)
}
-bool Protocol_prep::store_short(longlong from)
+bool Protocol_binary::store_short(longlong from)
{
field_pos++;
char *to= packet->prep_append(2, PACKET_BUFFER_EXTRA_ALLOC);
@@ -1105,7 +1105,7 @@ bool Protocol_prep::store_short(longlong from)
}
-bool Protocol_prep::store_long(longlong from)
+bool Protocol_binary::store_long(longlong from)
{
field_pos++;
char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC);
@@ -1116,7 +1116,7 @@ bool Protocol_prep::store_long(longlong from)
}
-bool Protocol_prep::store_longlong(longlong from, bool unsigned_flag)
+bool Protocol_binary::store_longlong(longlong from, bool unsigned_flag)
{
field_pos++;
char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC);
@@ -1126,7 +1126,7 @@ bool Protocol_prep::store_longlong(longlong from, bool unsigned_flag)
return 0;
}
-bool Protocol_prep::store_decimal(const my_decimal *d)
+bool Protocol_binary::store_decimal(const my_decimal *d)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -1139,7 +1139,7 @@ bool Protocol_prep::store_decimal(const my_decimal *d)
return store(str.ptr(), str.length(), str.charset());
}
-bool Protocol_prep::store(float from, uint32 decimals, String *buffer)
+bool Protocol_binary::store(float from, uint32 decimals, String *buffer)
{
field_pos++;
char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC);
@@ -1150,7 +1150,7 @@ bool Protocol_prep::store(float from, uint32 decimals, String *buffer)
}
-bool Protocol_prep::store(double from, uint32 decimals, String *buffer)
+bool Protocol_binary::store(double from, uint32 decimals, String *buffer)
{
field_pos++;
char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC);
@@ -1161,7 +1161,7 @@ bool Protocol_prep::store(double from, uint32 decimals, String *buffer)
}
-bool Protocol_prep::store(Field *field)
+bool Protocol_binary::store(Field *field)
{
/*
We should not increment field_pos here as send_binary() will call another
@@ -1173,7 +1173,7 @@ bool Protocol_prep::store(Field *field)
}
-bool Protocol_prep::store(TIME *tm)
+bool Protocol_binary::store(TIME *tm)
{
char buff[12],*pos;
uint length;
@@ -1199,15 +1199,15 @@ bool Protocol_prep::store(TIME *tm)
return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC);
}
-bool Protocol_prep::store_date(TIME *tm)
+bool Protocol_binary::store_date(TIME *tm)
{
tm->hour= tm->minute= tm->second=0;
tm->second_part= 0;
- return Protocol_prep::store(tm);
+ return Protocol_binary::store(tm);
}
-bool Protocol_prep::store_time(TIME *tm)
+bool Protocol_binary::store_time(TIME *tm)
{
char buff[13], *pos;
uint length;