diff options
author | unknown <mskold@mysql.com> | 2004-08-10 11:48:43 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2004-08-10 11:48:43 +0200 |
commit | 04cc2cc4d12b973c533cd35a6050932f82fb4ca3 (patch) | |
tree | bb02127efd31bb5412acc81f4311af0789100d06 /sql/ha_ndbcluster.cc | |
parent | 60abaef6b03c02c978d45b6fdc16f2b948806407 (diff) | |
parent | ce804e4c7bc514cb6823effb7ac396740be8f359 (diff) | |
download | mariadb-git-04cc2cc4d12b973c533cd35a6050932f82fb4ca3.tar.gz |
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/usr/local/home/marty/MySQL/mysql-4.1-ndb
mysql-test/r/ndb_alter_table.result:
Auto merged
mysql-test/r/ndb_basic.result:
Auto merged
mysql-test/r/ndb_lock.result:
Auto merged
mysql-test/t/ndb_alter_table.test:
Auto merged
mysql-test/t/ndb_basic.test:
Auto merged
mysql-test/t/ndb_lock.test:
Auto merged
ndb/src/ndbapi/Ndb.cpp:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a996b921536..cd2fb7f3eed 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -333,11 +333,11 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, - TODO allocate blob part aligned buffers */ -NdbBlob::ActiveHook get_ndb_blobs_value; +NdbBlob::ActiveHook g_get_ndb_blobs_value; -int get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg) +int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg) { - DBUG_ENTER("get_ndb_blobs_value [callback]"); + DBUG_ENTER("g_get_ndb_blobs_value"); if (ndb_blob->blobsNextBlob() != NULL) DBUG_RETURN(0); ha_ndbcluster *ha= (ha_ndbcluster *)arg; @@ -428,7 +428,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field, { // Set callback void *arg= (void *)this; - DBUG_RETURN(ndb_blob->setActiveHook(::get_ndb_blobs_value, arg) != 0); + DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0); } DBUG_RETURN(1); } @@ -554,7 +554,7 @@ int ha_ndbcluster::build_index_list() DBUG_ENTER("build_index_list"); // Save information about all known indexes - for (uint i= 0; i < table->keys; i++) + for (i= 0; i < table->keys; i++) { NDB_INDEX_TYPE idx_type= get_index_type_from_table(i); m_indextype[i]= idx_type; @@ -1946,11 +1946,25 @@ int ha_ndbcluster::rnd_init(bool scan) int ha_ndbcluster::close_scan() { NdbResultSet *cursor= m_active_cursor; + NdbConnection *trans= m_active_trans; DBUG_ENTER("close_scan"); if (!cursor) DBUG_RETURN(1); + + if (ops_pending) + { + /* + Take over any pending transactions to the + deleteing/updating transaction before closing the scan + */ + DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); + if (trans->execute(NoCommit) != 0) + DBUG_RETURN(ndb_err(trans)); + ops_pending= 0; + } + cursor->close(); m_active_cursor= NULL; DBUG_RETURN(0); |