From: magnus.blaudd Date: June 7 2011 12:53pm Subject: bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4441 to 4445) List-Archive: http://lists.mysql.com/commits/138774 Message-Id: <20110607125334.83AC913406F@pilot> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4445 magnus.blaudd@stripped 2011-06-07 ndb - fix warning about conversion between different datatypes modified: storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp 4444 magnus.blaudd@stripped 2011-06-07 [merge] Merge modified: sql/ha_ndbcluster.cc sql/ha_ndbcluster.h 4443 magnus.blaudd@stripped 2011-06-07 ndb - move reset of m_is_bulk_delete flag to top of function, thus avoiding that it have to be reset in every if branch of the function modified: sql/ha_ndbcluster.cc 4442 magnus.blaudd@stripped 2011-06-07 [merge] Merge modified: storage/ndb/src/common/portlib/CMakeLists.txt storage/ndb/src/common/util/ndbzio.c 4441 Jan Wedvik 2011-06-07 This fix only applies to pushed queries (i.e. those using NdbQuery and the SPJ block). This commit fixes an error related to bushy scans where the right hand side (i.e. the scan that is executed several times for genrating a cross product) used pruning. The algoritm for couning how many fragments to scan only worked correctly for the first execution. The second execution would typically cause an assert. modified: storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-06-06 12:18:27 +0000 +++ b/sql/ha_ndbcluster.cc 2011-06-07 12:36:05 +0000 @@ -5007,6 +5007,8 @@ int ha_ndbcluster::end_bulk_delete() { DBUG_ENTER("end_bulk_delete"); assert(m_is_bulk_delete); // Don't allow end() without start() + m_is_bulk_delete = false; + if (m_thd_ndb->m_unsent_bytes && !thd_allow_batch(table->in_use) && !m_thd_ndb->m_handler) @@ -5017,13 +5019,11 @@ int ha_ndbcluster::end_bulk_delete() &ignore_count) != 0) { no_uncommitted_rows_execute_failure(); - m_is_bulk_delete = false; DBUG_RETURN(ndb_err(m_thd_ndb->trans)); } assert(m_rows_deleted >= ignore_count); m_rows_deleted-= ignore_count; } - m_is_bulk_delete = false; DBUG_RETURN(0); } @@ -8437,6 +8437,20 @@ int ha_ndbcluster::create(const char *na goto abort_return; } + // Save the table level storage media setting + switch(create_info->storage_media) + { + case HA_SM_DISK: + tab.setStorageType(NdbDictionary::Column::StorageTypeDisk); + break; + case HA_SM_DEFAULT: + tab.setStorageType(NdbDictionary::Column::StorageTypeDefault); + break; + case HA_SM_MEMORY: + tab.setStorageType(NdbDictionary::Column::StorageTypeMemory); + break; + } + DBUG_PRINT("info", ("Table %s is %s stored with tablespace %s", m_tabname, (use_disk) ? "disk" : "memory", @@ -10533,10 +10547,11 @@ int ndbcluster_find_all_files(THD *thd) DBUG_RETURN(-(skipped + unhandled)); } -int ndbcluster_find_files(handlerton *hton, THD *thd, - const char *db, - const char *path, - const char *wild, bool dir, List *files) + +static int +ndbcluster_find_files(handlerton *hton, THD *thd, + const char *db, const char *path, + const char *wild, bool dir, List *files) { DBUG_ENTER("ndbcluster_find_files"); DBUG_PRINT("enter", ("db: %s", db)); @@ -10902,7 +10917,7 @@ static int ndbcluster_init(void *p) ndbcluster_binlog_init_handlerton(); h->flags= HTON_CAN_RECREATE | HTON_TEMPORARY_NOT_SUPPORTED; h->discover= ndbcluster_discover; - h->find_files= ndbcluster_find_files; + h->find_files= ndbcluster_find_files; h->table_exists_in_engine= ndbcluster_table_exists_in_engine; } === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2011-04-29 09:06:21 +0000 +++ b/sql/ha_ndbcluster.h 2011-05-31 14:38:10 +0000 @@ -885,8 +885,6 @@ private: int ndbcluster_discover(THD* thd, const char* dbname, const char* name, const void** frmblob, uint* frmlen); -int ndbcluster_find_files(THD *thd,const char *db,const char *path, - const char *wild, bool dir, List *files); int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name); void ndbcluster_print_error(int error, const NdbOperation *error_op); === modified file 'storage/ndb/src/common/portlib/CMakeLists.txt' --- a/storage/ndb/src/common/portlib/CMakeLists.txt 2011-05-11 12:23:24 +0000 +++ b/storage/ndb/src/common/portlib/CMakeLists.txt 2011-05-25 06:52:33 +0000 @@ -40,5 +40,7 @@ TARGET_LINK_LIBRARIES(NdbDir-t ndbportli ADD_EXECUTABLE(NdbGetInAddr-t NdbTCP.cpp) SET_TARGET_PROPERTIES(NdbGetInAddr-t PROPERTIES COMPILE_FLAGS "-DTEST_NDBGETINADDR") +TARGET_LINK_LIBRARIES(NdbGetInAddr-t ${LIBSOCKET} ${LIBNSL}) + === modified file 'storage/ndb/src/common/util/ndbzio.c' --- a/storage/ndb/src/common/util/ndbzio.c 2011-04-18 14:15:23 +0000 +++ b/storage/ndb/src/common/util/ndbzio.c 2011-05-24 14:34:41 +0000 @@ -167,9 +167,11 @@ void ndbz_free(voidpf opaque, voidpf add } #ifdef _WIN32 -/* Windows doesn't define ENOTSUP, define it same as Solaris */ +#ifndef ENOTSUP +/* If Windows doesn't define ENOTSUP, define it same as Solaris */ #define ENOTSUP 48 #endif +#endif #ifndef HAVE_POSIX_MEMALIGN static inline int posix_memalign(void **memptr, size_t alignment, size_t size) === modified file 'storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp' --- a/storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp 2011-06-07 10:03:02 +0000 +++ b/storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp 2011-06-07 12:48:01 +0000 @@ -2212,7 +2212,7 @@ NdbIndexStatImpl::MemDefault::mem_free(v { Item* item = (Item*)ptr - 1; assert(item->m_magic == MemMagic); - Uint32 size = item->m_size; + size_t size = item->m_size; item->m_magic = 0; my_free(item, MYF(0)); assert(m_used >= size); No bundle (reason: useless for push emails).