--- Percona-Server-5.1.59-debug/sql/log.cc 2011-11-29 14:46:11.000000000 +0800 +++ Percona-Server-5.1.59/sql/log.cc 2011-10-16 22:16:03.000000000 +0800 @@ -2397,12 +2397,6 @@ bool MYSQL_QUERY_LOG::write(THD *thd, ul tmp_errno= errno; } /* For slow query log */ - ha_rows tmp_row_count = 0; - if (thd->row_count >= thd->orig_row_count) { - tmp_row_count = thd->row_count - thd->orig_row_count + 1; - } else { - tmp_row_count = thd->orig_row_count - thd->row_count + 1; - } sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0); sprintf(lock_time_buff, "%.6f", ulonglong2double(lock_utime)/1000000.0); if (my_b_printf(&log_file, @@ -2415,7 +2409,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, ul (ulong) thd->sent_row_count, (ulong) thd->examined_row_count, ((long) thd->row_count_func > 0 ) ? (ulong) thd->row_count_func : 0, - tmp_row_count, + thd->row_count - thd->orig_row_count + 1, (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old), (ulong) thd->tmp_tables_used, (ulong) thd->tmp_tables_disk_used,