summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
committerGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
commit6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch)
tree9648ff1fc677eebb60b278c2e2c13131934ed2a0 /sql/protocol.cc
parentffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff)
parent4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff)
downloadmariadb-git-shagalla-10.4.tar.gz
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 771fade489b..d29d2fe853d 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -285,7 +285,7 @@ net_send_ok(THD *thd,
DBUG_ASSERT(store.length() <= MAX_PACKET_LENGTH);
error= my_net_write(net, (const unsigned char*)store.ptr(), store.length());
- if (!error && (!skip_flush || is_eof))
+ if (likely(!error) && (!skip_flush || is_eof))
error= net_flush(net);
thd->server_status&= ~SERVER_SESSION_STATE_CHANGED;
@@ -349,7 +349,7 @@ net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{
thd->get_stmt_da()->set_overwrite_status(true);
error= write_eof_packet(thd, net, server_status, statement_warn_count);
- if (!error)
+ if (likely(!error))
error= net_flush(net);
thd->get_stmt_da()->set_overwrite_status(false);
DBUG_PRINT("info", ("EOF sent, so no more error sending allowed"));
@@ -393,7 +393,7 @@ static bool write_eof_packet(THD *thd, NET *net,
because if 'is_fatal_error' is set the server is not going to execute
other queries (see the if test in dispatch_command / COM_QUERY)
*/
- if (thd->is_fatal_error)
+ if (unlikely(thd->is_fatal_error))
server_status&= ~SERVER_MORE_RESULTS_EXISTS;
int2store(buff + 3, server_status);
error= my_net_write(net, buff, 5);
@@ -590,7 +590,7 @@ void Protocol::end_statement()
thd->get_stmt_da()->skip_flush());
break;
}
- if (!error)
+ if (likely(!error))
thd->get_stmt_da()->set_is_sent(true);
DBUG_VOID_RETURN;
}
@@ -990,7 +990,7 @@ bool Protocol::send_result_set_row(List<Item> *row_items)
DBUG_RETURN(TRUE);
}
/* Item::send() may generate an error. If so, abort the loop. */
- if (thd->is_error())
+ if (unlikely(thd->is_error()))
DBUG_RETURN(TRUE);
}