[Commits] fd95cb0: postreview fix

Oleksandr Byelkin sanja at mariadb.com
Sat May 14 15:04:00 EEST 2016


revision-id: fd95cb0c68f4d559cf59a33ef6826e925c9849de (mariadb-10.2.0-21-gfd95cb0)
parent(s): 7e70658d1e88b4a255e3c28426f8259e5e596a85
committer: Oleksandr Byelkin
timestamp: 2016-05-14 14:03:59 +0200
message:

postreview fix

---
 sql/protocol.cc    | 12 ++++++------
 sql/protocol.h     |  2 +-
 sql/sql_error.cc   |  2 +-
 sql/sql_error.h    | 11 ++++++-----
 sql/sql_parse.cc   |  7 ++++---
 sql/sql_prepare.cc |  4 ++--
 6 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/sql/protocol.cc b/sql/protocol.cc
index 0bf2a05..6469581 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -209,7 +209,7 @@ bool
 net_send_ok(THD *thd,
             uint server_status, uint statement_warn_count,
             ulonglong affected_rows, ulonglong id, const char *message,
-            bool postpond_flush)
+            bool skip_flush)
 {
   NET *net= &thd->net;
   uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
@@ -251,7 +251,7 @@ net_send_ok(THD *thd,
   if (message && message[0])
     pos= net_store_data(pos, (uchar*) message, strlen(message));
   error= my_net_write(net, buff, (size_t) (pos-buff));
-  if (!error && !postpond_flush)
+  if (!error && !skip_flush)
     error= net_flush(net);
 
 
@@ -516,7 +516,7 @@ void Protocol::end_statement()
                    thd->get_stmt_da()->affected_rows(),
                    thd->get_stmt_da()->last_insert_id(),
                    thd->get_stmt_da()->message(),
-                   thd->get_stmt_da()->postpond_flush());
+                   thd->get_stmt_da()->skip_flush());
     break;
   case Diagnostics_area::DA_DISABLED:
     break;
@@ -524,7 +524,7 @@ void Protocol::end_statement()
   default:
     DBUG_ASSERT(0);
     error= send_ok(thd->server_status, 0, 0, 0, NULL,
-                   thd->get_stmt_da()->postpond_flush());
+                   thd->get_stmt_da()->skip_flush());
     break;
   }
   if (!error)
@@ -543,12 +543,12 @@ void Protocol::end_statement()
 
 bool Protocol::send_ok(uint server_status, uint statement_warn_count,
                        ulonglong affected_rows, ulonglong last_insert_id,
-                       const char *message, bool postpond_flush)
+                       const char *message, bool skip_flush)
 {
   DBUG_ENTER("Protocol::send_ok");
   const bool retval= 
     net_send_ok(thd, server_status, statement_warn_count,
-                affected_rows, last_insert_id, message, postpond_flush);
+                affected_rows, last_insert_id, message, skip_flush);
   DBUG_RETURN(retval);
 }
 
diff --git a/sql/protocol.h b/sql/protocol.h
index baac78d..6397e3d 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -62,7 +62,7 @@ class Protocol
 
   virtual bool send_ok(uint server_status, uint statement_warn_count,
                        ulonglong affected_rows, ulonglong last_insert_id,
-                       const char *message, bool postpond_flush);
+                       const char *message, bool skip_flush);
 
   virtual bool send_eof(uint server_status, uint statement_warn_count);
 
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index be5e664..1d234c5 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -347,7 +347,7 @@ void
 Diagnostics_area::reset_diagnostics_area()
 {
   DBUG_ENTER("reset_diagnostics_area");
-  m_postpond_flush= FALSE;
+  m_skip_flush= FALSE;
 #ifdef DBUG_OFF
   m_can_overwrite_status= FALSE;
   /** Don't take chances in production */
diff --git a/sql/sql_error.h b/sql/sql_error.h
index 98c8d77..8fb1aba 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -704,11 +704,11 @@ class Diagnostics_area
   const char *message() const
   { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK); return m_message; }
 
-  bool postpond_flush() const
-  { DBUG_ASSERT(m_status == DA_OK); return m_postpond_flush; }
+  bool skip_flush() const
+  { DBUG_ASSERT(m_status == DA_OK); return m_skip_flush; }
 
-  void set_postpond_flush()
-  { m_postpond_flush= TRUE; }
+  void set_skip_flush()
+  { m_skip_flush= TRUE; }
 
   uint sql_errno() const
   { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; }
@@ -863,7 +863,8 @@ class Diagnostics_area
   /** Set to make set_error_status after set_{ok,eof}_status possible. */
   bool m_can_overwrite_status;
 
-  bool m_postpond_flush;
+  /** Skip flushing network buffer after writing OK (for COM_MULTI) */
+  bool m_skip_flush;
 
   /** Message buffer. Can be used by OK or ERROR status. */
   char m_message[MYSQL_ERRMSG_SIZE];
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 25fa05d..0e49a3f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1636,7 +1636,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
                                 SERVER_MORE_RESULTS_EXISTS);
     thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
     if (is_com_multi)
-      thd->get_stmt_da()->set_postpond_flush();
+      thd->get_stmt_da()->set_skip_flush();
   }
 
   switch (command) {
@@ -1937,7 +1937,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
     {
       thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
       if (is_com_multi)
-        thd->get_stmt_da()->set_postpond_flush();
+        thd->get_stmt_da()->set_skip_flush();
     }
 
     lex_start(thd);
@@ -2273,6 +2273,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
 
 com_multi_end:
       /* release old buffer */
+      net_flush(net);
       DBUG_ASSERT(net->buff == net->write_pos); // nothing to send
       my_free(readbuff);
     }
@@ -7663,7 +7664,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
   {
     thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
     if (is_com_multi)
-      thd->get_stmt_da()->set_postpond_flush();
+      thd->get_stmt_da()->set_skip_flush();
   }
 
   if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 89e68dd..0c7e26c 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -277,7 +277,7 @@ class Protocol_local :public Protocol
 
   virtual bool send_ok(uint server_status, uint statement_warn_count,
                        ulonglong affected_rows, ulonglong last_insert_id,
-                       const char *message, bool postpond_flush);
+                       const char *message, bool skip_flush);
 
   virtual bool send_eof(uint server_status, uint statement_warn_count);
   virtual bool send_error(uint sql_errno, const char *err_msg, const char* sqlstate);
@@ -4877,7 +4877,7 @@ bool Protocol_local::send_out_parameters(List<Item_param> *sp_params)
 bool
 Protocol_local::send_ok(uint server_status, uint statement_warn_count,
                         ulonglong affected_rows, ulonglong last_insert_id,
-                        const char *message, bool postpond_flush)
+                        const char *message, bool skip_flush)
 {
   /*
     Just make sure nothing is sent to the client, we have grabbed


More information about the commits mailing list