Commit aad26453 authored by unknown's avatar unknown

fixed typo (double ++ in assert)

removed all side effects from asserts for not to confuse casual reader

parent f42419e4
...@@ -719,7 +719,8 @@ bool Protocol_simple::store(const char *from, uint length) ...@@ -719,7 +719,8 @@ bool Protocol_simple::store(const char *from, uint length)
bool Protocol_simple::store_tiny(longlong from) bool Protocol_simple::store_tiny(longlong from)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || field_types[field_pos++] == MYSQL_TYPE_TINY); DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY);
field_pos++;
#endif #endif
char buff[20]; char buff[20];
return net_store_data((char*) buff, return net_store_data((char*) buff,
...@@ -731,7 +732,8 @@ bool Protocol_simple::store_short(longlong from) ...@@ -731,7 +732,8 @@ bool Protocol_simple::store_short(longlong from)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_SHORT); field_types[field_pos] == MYSQL_TYPE_SHORT);
field_pos++;
#endif #endif
char buff[20]; char buff[20];
return net_store_data((char*) buff, return net_store_data((char*) buff,
...@@ -743,8 +745,9 @@ bool Protocol_simple::store_long(longlong from) ...@@ -743,8 +745,9 @@ bool Protocol_simple::store_long(longlong from)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_INT24 || field_types[field_pos] == MYSQL_TYPE_INT24 ||
field_types[field_pos++] == MYSQL_TYPE_LONG); field_types[field_pos] == MYSQL_TYPE_LONG);
field_pos++;
#endif #endif
char buff[20]; char buff[20];
return net_store_data((char*) buff, return net_store_data((char*) buff,
...@@ -756,7 +759,8 @@ bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag) ...@@ -756,7 +759,8 @@ bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_LONGLONG); field_types[field_pos] == MYSQL_TYPE_LONGLONG);
field_pos++;
#endif #endif
char buff[22]; char buff[22];
return net_store_data((char*) buff, return net_store_data((char*) buff,
...@@ -770,7 +774,8 @@ bool Protocol_simple::store(float from, uint32 decimals, String *buffer) ...@@ -770,7 +774,8 @@ bool Protocol_simple::store(float from, uint32 decimals, String *buffer)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_FLOAT); field_types[field_pos] == MYSQL_TYPE_FLOAT);
field_pos++;
#endif #endif
buffer->set((double) from, decimals, thd->variables.thd_charset); buffer->set((double) from, decimals, thd->variables.thd_charset);
return net_store_data((char*) buffer->ptr(), buffer->length()); return net_store_data((char*) buffer->ptr(), buffer->length());
...@@ -781,7 +786,8 @@ bool Protocol_simple::store(double from, uint32 decimals, String *buffer) ...@@ -781,7 +786,8 @@ bool Protocol_simple::store(double from, uint32 decimals, String *buffer)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_DOUBLE); field_types[field_pos] == MYSQL_TYPE_DOUBLE);
field_pos++;
#endif #endif
buffer->set(from, decimals, thd->variables.thd_charset); buffer->set(from, decimals, thd->variables.thd_charset);
return net_store_data((char*) buffer->ptr(), buffer->length()); return net_store_data((char*) buffer->ptr(), buffer->length());
...@@ -829,7 +835,8 @@ bool Protocol_simple::store_date(TIME *tm) ...@@ -829,7 +835,8 @@ bool Protocol_simple::store_date(TIME *tm)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_DATE); field_types[field_pos] == MYSQL_TYPE_DATE);
field_pos++;
#endif #endif
char buff[40]; char buff[40];
uint length; uint length;
...@@ -845,7 +852,8 @@ bool Protocol_simple::store_time(TIME *tm) ...@@ -845,7 +852,8 @@ bool Protocol_simple::store_time(TIME *tm)
{ {
#ifndef DEBUG_OFF #ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 || DBUG_ASSERT(field_types == 0 ||
field_types[field_pos++] == MYSQL_TYPE_TIME); field_types[field_pos] == MYSQL_TYPE_TIME);
field_pos++;
#endif #endif
char buff[40]; char buff[40];
uint length; uint length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment