mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Whitespace fix for mysql_checksum_table function
This commit is contained in:
committed by
Sergei Golubchik
parent
1ba90cea25
commit
84b0ac6721
@ -9744,23 +9744,23 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
|||||||
if (!(check_opt->flags & T_EXTEND) &&
|
if (!(check_opt->flags & T_EXTEND) &&
|
||||||
(((t->file->ha_table_flags() & HA_HAS_OLD_CHECKSUM) && thd->variables.old_mode) ||
|
(((t->file->ha_table_flags() & HA_HAS_OLD_CHECKSUM) && thd->variables.old_mode) ||
|
||||||
((t->file->ha_table_flags() & HA_HAS_NEW_CHECKSUM) && !thd->variables.old_mode)))
|
((t->file->ha_table_flags() & HA_HAS_NEW_CHECKSUM) && !thd->variables.old_mode)))
|
||||||
protocol->store((ulonglong)t->file->checksum());
|
protocol->store((ulonglong)t->file->checksum());
|
||||||
else if (check_opt->flags & T_QUICK)
|
else if (check_opt->flags & T_QUICK)
|
||||||
protocol->store_null();
|
protocol->store_null();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* calculating table's checksum */
|
/* calculating table's checksum */
|
||||||
ha_checksum crc= 0;
|
ha_checksum crc= 0;
|
||||||
uchar null_mask=256 - (1 << t->s->last_null_bit_pos);
|
uchar null_mask=256 - (1 << t->s->last_null_bit_pos);
|
||||||
|
|
||||||
t->use_all_columns();
|
t->use_all_columns();
|
||||||
|
|
||||||
if (t->file->ha_rnd_init(1))
|
if (t->file->ha_rnd_init(1))
|
||||||
protocol->store_null();
|
protocol->store_null();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (thd->killed)
|
if (thd->killed)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -9771,7 +9771,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
|||||||
thd->protocol->remove_last_row();
|
thd->protocol->remove_last_row();
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ha_checksum row_crc= 0;
|
ha_checksum row_crc= 0;
|
||||||
int error= t->file->ha_rnd_next(t->record[0]);
|
int error= t->file->ha_rnd_next(t->record[0]);
|
||||||
if (unlikely(error))
|
if (unlikely(error))
|
||||||
{
|
{
|
||||||
@ -9779,21 +9779,21 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
|||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (t->s->null_bytes)
|
if (t->s->null_bytes)
|
||||||
{
|
{
|
||||||
/* fix undefined null bits */
|
/* fix undefined null bits */
|
||||||
t->record[0][t->s->null_bytes-1] |= null_mask;
|
t->record[0][t->s->null_bytes-1] |= null_mask;
|
||||||
if (!(t->s->db_create_options & HA_OPTION_PACK_RECORD))
|
if (!(t->s->db_create_options & HA_OPTION_PACK_RECORD))
|
||||||
t->record[0][0] |= 1;
|
t->record[0][0] |= 1;
|
||||||
|
|
||||||
row_crc= my_checksum(row_crc, t->record[0], t->s->null_bytes);
|
row_crc= my_checksum(row_crc, t->record[0], t->s->null_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
uchar *checksum_start= NULL;
|
uchar *checksum_start= NULL;
|
||||||
size_t checksum_length= 0;
|
size_t checksum_length= 0;
|
||||||
for (uint i= 0; i < t->s->fields; i++ )
|
for (uint i= 0; i < t->s->fields; i++ )
|
||||||
{
|
{
|
||||||
Field *f= t->field[i];
|
Field *f= t->field[i];
|
||||||
|
|
||||||
if (! thd->variables.old_mode && f->is_real_null(0))
|
if (! thd->variables.old_mode && f->is_real_null(0))
|
||||||
continue;
|
continue;
|
||||||
@ -9840,16 +9840,16 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
|||||||
checksum_length= f->pack_length();
|
checksum_length= f->pack_length();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (checksum_start)
|
if (checksum_start)
|
||||||
row_crc= my_checksum(row_crc, checksum_start, checksum_length);
|
row_crc= my_checksum(row_crc, checksum_start, checksum_length);
|
||||||
|
|
||||||
crc+= row_crc;
|
crc+= row_crc;
|
||||||
}
|
}
|
||||||
protocol->store((ulonglong)crc);
|
protocol->store((ulonglong)crc);
|
||||||
t->file->ha_rnd_end();
|
t->file->ha_rnd_end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
trans_rollback_stmt(thd);
|
trans_rollback_stmt(thd);
|
||||||
close_thread_tables(thd);
|
close_thread_tables(thd);
|
||||||
|
Reference in New Issue
Block a user