Comment 4 for bug 714925

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

The issue seems to be that even though the structures are unlonglong and longlong is stored, the schema seems to be MYSQL_TYPE_LONG

  {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received", SKIP_OPEN_TABLE},
  {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent", SKIP_OPEN_TABLE},
  {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written", SKIP_OPEN_TABLE},

Also,

      table->field[6]->store((longlong)user_stats->bytes_received);
      table->field[7]->store((longlong)user_stats->bytes_sent);
      table->field[8]->store((longlong)user_stats->binlog_bytes_written);

So, MYSQL_TYPE_LONGLONG needs to used instead of MYSQL_TYPE_LONG and ulonglong instead of longlong in ->store()

Same for other fields and other similar tables.