Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-09 18:16:58+02:00, tomas@stripped +2 -0
post merge fixes for batched slave
sql/ha_ndbcluster.cc@stripped, 2007-05-09 18:16:56+02:00, tomas@stripped +27 -37
post merge fixes for batched slave
sql/ha_ndbcluster.h@stripped, 2007-05-09 18:16:56+02:00, tomas@stripped +1 -1
post merge fixes for batched slave
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: whalegate.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-telco-ndbrecord
--- 1.459/sql/ha_ndbcluster.cc 2007-05-09 16:59:14 +02:00
+++ 1.460/sql/ha_ndbcluster.cc 2007-05-09 18:16:56 +02:00
@@ -3312,7 +3312,8 @@
or the hidden primary key, but we always execute() in this case.
*/
bool uses_blobs= uses_blob_value(table->write_set);
- if ((m_rows_to_insert > 1 && !uses_blobs) || batched_update)
+ if ((m_rows_to_insert > 1 && !uses_blobs) || batched_update ||
+ (thd->options & OPTION_ALLOW_BATCH))
{
/* This sets row and need_flush (output parameters). */
error= batch_copy_row_to_buffer(record, row, need_flush);
@@ -3459,18 +3460,10 @@
m_rows_inserted++;
no_uncommitted_rows_update(1);
- if ((thd->options & OPTION_ALLOW_BATCH) == 0 ||
- (unsent > BATCH_FLUSH_SIZE) ||
+ if ((unsent > BATCH_FLUSH_SIZE) ||
need_flush || primary_key_update)
{
- // Send rows to NDB
- DBUG_PRINT("info", ("Sending inserts to NDB, "
- "rows_inserted: %d unsent bytes: %d",
- (int)m_rows_inserted, (int)unsent));
-
- thd_ndb->m_unsent_bytes= 0;
-
- int res= flush_bulk_insert();
+ int res= flush_bulk_insert(thd_ndb);
if (res != 0)
{
m_skip_auto_increment= TRUE;
@@ -3818,24 +3811,26 @@
no_uncommitted_rows_update(-1);
eventSetAnyValue(thd, op);
- }
- /*
- Poor approx. let delete ~ tabsize / 4
- */
- unsent+= 12 + m_bytes_per_write >> 2;
- if ((thd->options & OPTION_ALLOW_BATCH) == 0 ||
- (unsent > BATCH_FLUSH_SIZE))
- {
- thd_ndb->m_unsent_bytes = 0;
- // Execute delete operation
- if (execute_no_commit(this,trans,FALSE) != 0) {
- no_uncommitted_rows_execute_failure();
- DBUG_RETURN(ndb_err(trans));
+ /*
+ Poor approx. let delete ~ tabsize / 4
+ */
+ unsent+= 12 + m_bytes_per_write >> 2;
+ if ((thd->options & OPTION_ALLOW_BATCH) &&
+ (unsent <= BATCH_FLUSH_SIZE))
+ {
+ abort(); //ToDo store key record etc for batching
+ thd_ndb->m_unsent_bytes= unsent;
+ DBUG_RETURN(0);
}
- DBUG_RETURN(0);
}
- thd_ndb->m_unsent_bytes= unsent;
+
+ thd_ndb->m_unsent_bytes = 0;
+ // Execute delete operation
+ if (execute_no_commit(this,trans,FALSE) != 0) {
+ no_uncommitted_rows_execute_failure();
+ DBUG_RETURN(ndb_err(trans));
+ }
DBUG_RETURN(0);
}
@@ -4773,14 +4768,14 @@
*/
int
-ha_ndbcluster::flush_bulk_insert()
+ha_ndbcluster::flush_bulk_insert(Thd_ndb *thd_ndb)
{
NdbTransaction *trans= m_active_trans;
DBUG_ENTER("ha_ndbcluster::flush_bulk_insert");
- DBUG_PRINT("info", ("Sending inserts to NDB, rows_inserted: %d",
- (int)m_rows_inserted));
-
- m_bulk_insert_not_flushed= FALSE;
+ DBUG_PRINT("info", ("Sending inserts to NDB, "
+ "rows_inserted: %d unsent bytes: %d",
+ (int) m_rows_inserted, (int)thd_ndb->m_unsent_bytes));
+ thd_ndb->m_unsent_bytes= 0;
if (m_transaction_on)
{
if (execute_no_commit(this,trans,FALSE) != 0)
@@ -4851,12 +4846,7 @@
if ((thd->options & OPTION_ALLOW_BATCH) == 0 && thd_ndb->m_unsent_bytes)
{
- // Send rows to NDB
- DBUG_PRINT("info", ("Sending inserts to NDB, "
- "rows_inserted: %d unsent bytes: %d",
- (int) m_rows_inserted, (int)thd_ndb->m_unsent_bytes));
- thd_ndb->m_unsent_bytes= 0;
- error= flush_bulk_insert();
+ error= flush_bulk_insert(thd_ndb);
if (error != 0)
my_errno= error;
}
--- 1.179/sql/ha_ndbcluster.h 2007-05-09 16:49:12 +02:00
+++ 1.180/sql/ha_ndbcluster.h 2007-05-09 18:16:56 +02:00
@@ -447,7 +447,7 @@
uint key_len,
byte *buf);
int full_table_scan(byte * buf);
- int flush_bulk_insert();
+ int flush_bulk_insert(Thd_ndb *thd_ndb);
int ndb_write_row(byte *record, bool primary_key_update, bool batched_update);
int ndb_delete_row(const byte *record, bool primary_key_update);
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2510) | tomas | 9 May |