summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.mysql.r18.ru>2002-12-17 19:33:25 +0400
committerunknown <hf@deer.mysql.r18.ru>2002-12-17 19:33:25 +0400
commit44d684d13ff261ff8acd9b40f6abde54c78efbfb (patch)
tree314906891e628c9c38154fc9618195971f885a7c /sql
parent8db300257b8e457f63a61d27c16ffeb4e23127b1 (diff)
downloadmariadb-git-44d684d13ff261ff8acd9b40f6abde54c78efbfb.tar.gz
Merging&testing
libmysqld/lib_sql.cc: Protocol::send_fields added sql/ha_berkeley.cc: set_nfields calls added sql/ha_myisam.cc: set_nfield call added sql/mysql_priv.h: embedded_send_row header changed sql/protocol.cc: Protocol::write edited for embedded case sql/protocol.h: n_fields member added sql/sql_table.cc: sen_nfields added
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_berkeley.cc2
-rw-r--r--sql/ha_myisam.cc1
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/protocol.cc18
-rw-r--r--sql/protocol.h9
-rw-r--r--sql/sql_table.cc1
6 files changed, 18 insertions, 15 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 1b8a2d9b3f8..07f367d7470 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -255,6 +255,7 @@ int berkeley_show_logs(Protocol *protocol)
/* Error is 0 here */
if (all_logs)
{
+ protocol->set_nfields(3);
for (a = all_logs, f = free_logs; *a; ++a)
{
protocol->prepare_for_resend();
@@ -2075,6 +2076,7 @@ static void print_msg(THD *thd, const char *table_name, const char *op_name,
msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia
DBUG_PRINT(msg_type,("message: %s",msgbuf));
+ protocol->set_nfields(4);
protocol->prepare_for_resend();
protocol->store(table_name);
protocol->store(op_name);
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 0680f13a7df..a3bc925a015 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -76,6 +76,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
}
length=(uint) (strxmov(name, param->db_name,".",param->table_name,NullS) -
name);
+ protocol->set_nfields(4);
protocol->prepare_for_resend();
protocol->store(name, length);
protocol->store(param->op_name);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index a489237a6e8..50b79949772 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -880,7 +880,7 @@ inline void mark_as_null_row(TABLE *table)
}
#ifdef EMBEDDED_LIBRARY
- int embedded_send_row(THD *thd, int n_fields, char *data, int data_len);
+ int embedded_send_row(THD *thd, int n_fields, const char *data, int data_len);
#define SEND_ROW(thd, n_fields, data, data_len)\
embedded_send_row(thd, n_fields, data, data_len)
#else
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ec7ced0e626..5ec51a42dc9 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -455,19 +455,6 @@ char *net_store_data(char *to,longlong from)
Function called by my_net_init() to set some check variables
*/
-extern "C" {
-void my_net_local_init(NET *net)
-{
- net->max_packet= (uint) global_system_variables.net_buffer_length;
- net->read_timeout= (uint) global_system_variables.net_read_timeout;
- net->write_timeout=(uint) global_system_variables.net_write_timeout;
- net->retry_count= (uint) global_system_variables.net_retry_count;
- net->max_packet_size= max(global_system_variables.net_buffer_length,
- global_system_variables.max_allowed_packet);
-}
-}
-
-
/*****************************************************************************
Default Protocol functions
*****************************************************************************/
@@ -504,6 +491,7 @@ void Protocol::init(THD *thd_arg)
1 Error (Note that in this case the error is not sent to the client)
*/
+#ifndef EMBEDDED_LIBRARY
bool Protocol::send_fields(List<Item> *list, uint flag)
{
List_iterator_fast<Item> it(*list);
@@ -586,11 +574,12 @@ err:
DBUG_RETURN(1); /* purecov: inspected */
}
+#endif
bool Protocol::write()
{
DBUG_ENTER("Protocol::write");
- DBUG_RETURN(my_net_write(&thd->net, packet->ptr(), packet->length()));
+ DBUG_RETURN(SEND_ROW(thd, n_fields, packet->ptr(), packet->length()));
}
@@ -828,6 +817,7 @@ bool Protocol_simple::store_time(TIME *tm)
bool Protocol_prep::prepare_for_send(List<Item> *item_list)
{
field_count=item_list->elements;
+ set_nfields(item_list->elements);
bit_fields= (field_count+3)/8;
if (packet->alloc(bit_fields))
return 1;
diff --git a/sql/protocol.h b/sql/protocol.h
index b3ab0a2b31d..cc20e158243 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -33,6 +33,9 @@ protected:
#ifndef DEBUG_OFF
enum enum_field_types *field_types;
#endif
+#ifdef EMBEDDED_LIBRARY
+ uint n_fields;
+#endif
public:
CONVERT *convert;
@@ -52,6 +55,12 @@ public:
{ return store_longlong((longlong) from, 0); }
inline bool store(ulonglong from)
{ return store_longlong((longlong) from, 1); }
+
+#ifdef EMBEDDED_LIBRARY
+ inline void set_nfields(uint fields_count) { n_fields= fields_count; }
+#else
+ inline void set_nfields(uint fields_count) {}
+#endif
virtual bool prepare_for_send(List<Item> *item_list) { return 0;}
virtual void prepare_for_resend()=0;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 49e84db62c9..b7aaeb89f25 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1032,6 +1032,7 @@ static int send_check_errmsg(THD *thd, TABLE_LIST* table,
{
Protocol *protocol= thd->protocol;
+ protocol->set_nfields(4);
protocol->prepare_for_resend();
protocol->store(table->alias);
protocol->store((char*) operator_name);