summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index d2f91d51910..032e79c9289 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -25,7 +25,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "protocol.h"
#include "sql_class.h" // THD
@@ -86,7 +86,7 @@ bool Protocol_binary::net_store_data_cs(const uchar *from, size_t length,
{
uint dummy_errors;
/* Calculate maxumum possible result length */
- uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
+ size_t conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
if (conv_length > 250)
{
@@ -106,8 +106,8 @@ bool Protocol_binary::net_store_data_cs(const uchar *from, size_t length,
net_store_data((const uchar*) convert->ptr(), convert->length()));
}
- ulong packet_length= packet->length();
- ulong new_length= packet_length + conv_length + 1;
+ size_t packet_length= packet->length();
+ size_t new_length= packet_length + conv_length + 1;
if (new_length > packet->alloced_length() && packet->realloc(new_length))
return 1;
@@ -480,8 +480,9 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
- ulonglong for bigger numbers.
*/
-static uchar *net_store_length_fast(uchar *packet, uint length)
+static uchar *net_store_length_fast(uchar *packet, size_t length)
{
+ DBUG_ASSERT(length < UINT_MAX16);
if (length < 251)
{
*packet=(uchar) length;
@@ -661,7 +662,7 @@ void net_send_progress_packet(THD *thd)
{
uchar buff[200], *pos;
const char *proc_info= thd->proc_info ? thd->proc_info : "";
- uint length= strlen(proc_info);
+ size_t length= strlen(proc_info);
ulonglong progress;
DBUG_ENTER("net_send_progress_packet");
@@ -1015,7 +1016,7 @@ bool Protocol::store(const char *from, CHARSET_INFO *cs)
{
if (!from)
return store_null();
- uint length= strlen(from);
+ size_t length= strlen(from);
return store(from, length, cs);
}
@@ -1235,7 +1236,7 @@ bool Protocol_text::store(Field *field)
char buff[MAX_FIELD_WIDTH];
String str(buff,sizeof(buff), &my_charset_bin);
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
-#ifndef DBUG_OFF
+#ifdef DBUG_ASSERT_EXISTS
TABLE *table= field->table;
my_bitmap_map *old_map= 0;
if (table->file)
@@ -1243,7 +1244,7 @@ bool Protocol_text::store(Field *field)
#endif
field->val_str(&str);
-#ifndef DBUG_OFF
+#ifdef DBUG_ASSERT_EXISTS
if (old_map)
dbug_tmp_restore_column_map(table->read_set, old_map);
#endif