2841 He Zhenxing 2008-09-29 [merge]
Merge BUG#35843
modified:
sql/log_event.cc
2840 Mattias Jonsson 2008-09-20 [merge]
manual null merge of backported fix (fixed two typos)
modified:
sql/ha_partition.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2008-09-05 13:39:08 +0000
+++ b/sql/log_event.cc 2008-09-29 13:41:17 +0000
@@ -8102,7 +8102,6 @@ Write_rows_log_event::do_before_row_oper
*/
}
- m_table->file->ha_start_bulk_insert(0);
/*
We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill
any TIMESTAMP column with data from the row but instead will use
@@ -8256,6 +8255,16 @@ Rows_log_event::write_row(const Relay_lo
// Temporary fix to find out why it fails [/Matz]
memcpy(m_table->write_set->bitmap, m_cols.bitmap,
(m_table->write_set->n_bits + 7) / 8);
+ if (m_curr_row == m_rows_buf)
+ {
+ /* this is the first row to be inserted, we estimate the rows with
+ the size of the first row and use that value to initialize
+ storage engine for bulk insertion */
+ ulong estimated_rows= (m_rows_end - m_curr_row) / (m_curr_row_end - m_curr_row);
+ m_table->file->ha_start_bulk_insert(estimated_rows);
+ }
+
+
#ifndef DBUG_OFF
DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
| Thread |
|---|
| • bzr push into mysql-6.0 branch (hezx:2840 to 2841) Bug#35843 | He Zhenxing | 30 Sep |