Loading BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ lenz@mysql.com magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi marty@linux.site mats@mysql.com matt@booty.(none) matt@mysql.com Loading mysql-test/r/func_str.result +9 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ tcx.se .se select concat(':',ltrim(' left '),':',rtrim(' right '),':'); concat(':',ltrim(' left '),':',rtrim(' right '),':') :left : right: select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':') :left : right: select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':') :left: right: Loading Loading @@ -703,3 +706,9 @@ NULL select trim('xyz' from null) as "must_be_null"; must_be_null NULL select trim(leading NULL from 'kate') as "must_be_null"; must_be_null NULL select trim(trailing NULL from 'xyz') as "must_be_null"; must_be_null NULL mysql-test/t/func_str.test +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx', select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1); select concat(':',ltrim(' left '),':',rtrim(' right '),':'); select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'); select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'); Loading Loading @@ -443,3 +444,5 @@ select quote(trim(concat(' ', 'a'))); # select trim(null from 'kate') as "must_be_null"; select trim('xyz' from null) as "must_be_null"; select trim(leading NULL from 'kate') as "must_be_null"; select trim(trailing NULL from 'xyz') as "must_be_null"; mysql-test/t/trigger.test +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ select @a; drop trigger t1.trg; drop table t1; --disable_ps_protocol # Before update trigger # (In future we will achieve this via proper error handling in triggers) create table t1 (aid int not null primary key, balance int not null default 0); Loading @@ -74,6 +75,7 @@ select * from t1| drop trigger t1.trg| drop table t1| delimiter ;| --enable_ps_protocol # After update trigger create table t1 (i int); Loading sql/ha_ndbcluster.cc +54 −31 Original line number Diff line number Diff line Loading @@ -212,6 +212,13 @@ Thd_ndb::~Thd_ndb() { if (ndb) delete ndb; ndb= 0; } inline Ndb *ha_ndbcluster::get_ndb() { return ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; } /* Loading Loading @@ -245,8 +252,9 @@ void ha_ndbcluster::records_update() info->no_uncommitted_rows_count)); // if (info->records == ~(ha_rows)0) { Ndb *ndb= get_ndb(); Uint64 rows; if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ info->records= rows; } } Loading Loading @@ -331,7 +339,8 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) switch (err.classification) { case NdbError::SchemaError: { NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); DBUG_PRINT("info", ("invalidateTable %s", m_tabname)); dict->invalidateTable(m_tabname); table->version=0L; /* Free when thread is ready */ Loading Loading @@ -361,7 +370,7 @@ bool ha_ndbcluster::get_error_message(int error, DBUG_ENTER("ha_ndbcluster::get_error_message"); DBUG_PRINT("enter", ("error: %d", error)); Ndb *ndb= ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; Ndb *ndb= get_ndb(); if (!ndb) DBUG_RETURN(FALSE); Loading Loading @@ -692,7 +701,8 @@ bool ha_ndbcluster::uses_blob_value(bool all_fields) int ha_ndbcluster::get_metadata(const char *path) { NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; int error; bool invalidating_ndb_table= FALSE; Loading Loading @@ -767,7 +777,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) static const char* unique_suffix= "$unique"; KEY* key_info= tab->key_info; const char **key_name= tab->keynames.type_names; NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("build_index_list"); // Save information about all known indexes Loading Loading @@ -1739,7 +1750,8 @@ int ha_ndbcluster::write_row(byte *record) if (table->primary_key == MAX_KEY) { // Table has hidden primary key Uint64 auto_value= m_ndb->getAutoIncrementValue((const NDBTAB *) m_table); Ndb *ndb= get_ndb(); Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table); if (set_hidden_key(op, table->fields, (const byte*)&auto_value)) ERR_RETURN(op->getNdbError()); } Loading Loading @@ -1816,11 +1828,12 @@ int ha_ndbcluster::write_row(byte *record) } if ((has_auto_increment) && (m_skip_auto_increment)) { Ndb *ndb= get_ndb(); Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1; DBUG_PRINT("info", ("Trying to set next auto increment value to %lu", (ulong) next_val)); if (m_ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) DBUG_PRINT("info", ("Setting next auto increment value to %u", next_val)); } Loading Loading @@ -2667,9 +2680,12 @@ void ha_ndbcluster::info(uint flag) } else { Uint64 rows= 100; if ((my_errno= check_ndb_connection())) DBUG_VOID_RETURN; Ndb *ndb= get_ndb(); Uint64 rows; if (current_thd->variables.ndb_use_exact_count) ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0); ndb_get_table_statistics(ndb, m_tabname, &rows, 0); records= rows; } } Loading Loading @@ -2998,6 +3014,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_RETURN(1); Thd_ndb *thd_ndb= (Thd_ndb*)thd->transaction.thd_ndb; Ndb *ndb= thd_ndb->ndb; DBUG_PRINT("enter", ("transaction.thd_ndb->lock_count: %d", thd_ndb->lock_count)); Loading @@ -3015,9 +3032,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_ASSERT(!thd->transaction.stmt.ndb_tid); DBUG_PRINT("trans",("Starting transaction stmt")); trans= m_ndb->startTransaction(); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } Loading @@ -3029,9 +3046,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) // A "master" transaction ha not been started yet DBUG_PRINT("trans",("starting transaction, all")); trans= m_ndb->startTransaction(); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); /* Loading Loading @@ -3081,7 +3098,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) m_retrieve_primary_key= FALSE; m_ops_pending= 0; { NDBDICT *dict= m_ndb->getDictionary(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; void *tab_info; if (!(tab= dict->getTable(m_tabname, &tab_info))) Loading @@ -3108,7 +3125,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) We must in this case close the transaction to release resources */ DBUG_PRINT("trans",("ending non-updating transaction")); m_ndb->closeTransaction(m_active_trans); ndb->closeTransaction(m_active_trans); thd->transaction.stmt.ndb_tid= 0; } } Loading Loading @@ -3154,16 +3171,17 @@ int ha_ndbcluster::start_stmt(THD *thd) NdbConnection *trans= (NdbConnection*)thd->transaction.stmt.ndb_tid; if (!trans){ Ndb *ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; DBUG_PRINT("trans",("Starting transaction stmt")); NdbConnection *tablock_trans= (NdbConnection*)thd->transaction.all.ndb_tid; DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); DBUG_ASSERT(tablock_trans); // trans= m_ndb->hupp(tablock_trans); trans= m_ndb->startTransaction(); // trans= ndb->hupp(tablock_trans); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } Loading Loading @@ -3550,7 +3568,8 @@ int ha_ndbcluster::create(const char *name, DBUG_RETURN(my_errno); // Create the table in NDB NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); if (dict->createTable(tab) != 0) { const NdbError err= dict->getNdbError(); Loading Loading @@ -3595,7 +3614,8 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info, bool unique) { NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); KEY_PART_INFO *key_part= key_info->key_part; KEY_PART_INFO *end= key_part + key_info->key_parts; Loading Loading @@ -3654,14 +3674,15 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); dict= ndb->getDictionary(); if (!(orig_tab= dict->getTable(m_tabname))) ERR_RETURN(dict->getNdbError()); m_table= (void *)orig_tab; // Change current database to that of target table set_dbname(to); m_ndb->setDatabaseName(m_dbname); ndb->setDatabaseName(m_dbname); if (!(result= alter_table_name(new_tabname))) { // Rename .ndb file Loading @@ -3678,7 +3699,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) int ha_ndbcluster::alter_table_name(const char *to) { NDBDICT * dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *orig_tab= (const NDBTAB *) m_table; int ret; DBUG_ENTER("alter_table_name_table"); Loading Loading @@ -3720,7 +3742,8 @@ int ha_ndbcluster::delete_table(const char *name) int ha_ndbcluster::drop_table() { NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("drop_table"); DBUG_PRINT("enter", ("Deleting %s", m_tabname)); Loading Loading @@ -3756,6 +3779,7 @@ ulonglong ha_ndbcluster::get_auto_increment() Uint64 auto_value; DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); Ndb *ndb= get_ndb(); cache_size= (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? m_rows_to_insert - m_rows_inserted Loading @@ -3764,8 +3788,8 @@ ulonglong ha_ndbcluster::get_auto_increment() : m_autoincrement_prefetch; auto_value= (m_skip_auto_increment) ? m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) : m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); ndb->readAutoIncrementValue((const NDBTAB *) m_table) : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); DBUG_RETURN((longlong)auto_value); } Loading @@ -3778,7 +3802,6 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): handler(table_arg), m_active_trans(NULL), m_active_cursor(NULL), m_ndb(NULL), m_table(NULL), m_table_info(NULL), m_table_flags(HA_REC_NOT_IN_SEQ | Loading Loading @@ -3909,7 +3932,6 @@ int ha_ndbcluster::close(void) DBUG_ENTER("close"); free_share(m_share); m_share= 0; release_metadata(); m_ndb= NULL; DBUG_RETURN(0); } Loading Loading @@ -3971,11 +3993,12 @@ Ndb* check_ndb_in_thd(THD* thd) int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; Ndb *ndb; DBUG_ENTER("check_ndb_connection"); if (!(m_ndb= check_ndb_in_thd(thd))) if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); m_ndb->setDatabaseName(m_dbname); ndb->setDatabaseName(m_dbname); DBUG_RETURN(0); } Loading Loading
BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ lenz@mysql.com magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi marty@linux.site mats@mysql.com matt@booty.(none) matt@mysql.com Loading
mysql-test/r/func_str.result +9 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ tcx.se .se select concat(':',ltrim(' left '),':',rtrim(' right '),':'); concat(':',ltrim(' left '),':',rtrim(' right '),':') :left : right: select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':') :left : right: select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':') :left: right: Loading Loading @@ -703,3 +706,9 @@ NULL select trim('xyz' from null) as "must_be_null"; must_be_null NULL select trim(leading NULL from 'kate') as "must_be_null"; must_be_null NULL select trim(trailing NULL from 'xyz') as "must_be_null"; must_be_null NULL
mysql-test/t/func_str.test +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx', select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1); select concat(':',ltrim(' left '),':',rtrim(' right '),':'); select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'); select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'); Loading Loading @@ -443,3 +444,5 @@ select quote(trim(concat(' ', 'a'))); # select trim(null from 'kate') as "must_be_null"; select trim('xyz' from null) as "must_be_null"; select trim(leading NULL from 'kate') as "must_be_null"; select trim(trailing NULL from 'xyz') as "must_be_null";
mysql-test/t/trigger.test +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ select @a; drop trigger t1.trg; drop table t1; --disable_ps_protocol # Before update trigger # (In future we will achieve this via proper error handling in triggers) create table t1 (aid int not null primary key, balance int not null default 0); Loading @@ -74,6 +75,7 @@ select * from t1| drop trigger t1.trg| drop table t1| delimiter ;| --enable_ps_protocol # After update trigger create table t1 (i int); Loading
sql/ha_ndbcluster.cc +54 −31 Original line number Diff line number Diff line Loading @@ -212,6 +212,13 @@ Thd_ndb::~Thd_ndb() { if (ndb) delete ndb; ndb= 0; } inline Ndb *ha_ndbcluster::get_ndb() { return ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; } /* Loading Loading @@ -245,8 +252,9 @@ void ha_ndbcluster::records_update() info->no_uncommitted_rows_count)); // if (info->records == ~(ha_rows)0) { Ndb *ndb= get_ndb(); Uint64 rows; if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ info->records= rows; } } Loading Loading @@ -331,7 +339,8 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) switch (err.classification) { case NdbError::SchemaError: { NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); DBUG_PRINT("info", ("invalidateTable %s", m_tabname)); dict->invalidateTable(m_tabname); table->version=0L; /* Free when thread is ready */ Loading Loading @@ -361,7 +370,7 @@ bool ha_ndbcluster::get_error_message(int error, DBUG_ENTER("ha_ndbcluster::get_error_message"); DBUG_PRINT("enter", ("error: %d", error)); Ndb *ndb= ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; Ndb *ndb= get_ndb(); if (!ndb) DBUG_RETURN(FALSE); Loading Loading @@ -692,7 +701,8 @@ bool ha_ndbcluster::uses_blob_value(bool all_fields) int ha_ndbcluster::get_metadata(const char *path) { NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; int error; bool invalidating_ndb_table= FALSE; Loading Loading @@ -767,7 +777,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) static const char* unique_suffix= "$unique"; KEY* key_info= tab->key_info; const char **key_name= tab->keynames.type_names; NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("build_index_list"); // Save information about all known indexes Loading Loading @@ -1739,7 +1750,8 @@ int ha_ndbcluster::write_row(byte *record) if (table->primary_key == MAX_KEY) { // Table has hidden primary key Uint64 auto_value= m_ndb->getAutoIncrementValue((const NDBTAB *) m_table); Ndb *ndb= get_ndb(); Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table); if (set_hidden_key(op, table->fields, (const byte*)&auto_value)) ERR_RETURN(op->getNdbError()); } Loading Loading @@ -1816,11 +1828,12 @@ int ha_ndbcluster::write_row(byte *record) } if ((has_auto_increment) && (m_skip_auto_increment)) { Ndb *ndb= get_ndb(); Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1; DBUG_PRINT("info", ("Trying to set next auto increment value to %lu", (ulong) next_val)); if (m_ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) DBUG_PRINT("info", ("Setting next auto increment value to %u", next_val)); } Loading Loading @@ -2667,9 +2680,12 @@ void ha_ndbcluster::info(uint flag) } else { Uint64 rows= 100; if ((my_errno= check_ndb_connection())) DBUG_VOID_RETURN; Ndb *ndb= get_ndb(); Uint64 rows; if (current_thd->variables.ndb_use_exact_count) ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0); ndb_get_table_statistics(ndb, m_tabname, &rows, 0); records= rows; } } Loading Loading @@ -2998,6 +3014,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_RETURN(1); Thd_ndb *thd_ndb= (Thd_ndb*)thd->transaction.thd_ndb; Ndb *ndb= thd_ndb->ndb; DBUG_PRINT("enter", ("transaction.thd_ndb->lock_count: %d", thd_ndb->lock_count)); Loading @@ -3015,9 +3032,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_ASSERT(!thd->transaction.stmt.ndb_tid); DBUG_PRINT("trans",("Starting transaction stmt")); trans= m_ndb->startTransaction(); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } Loading @@ -3029,9 +3046,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) // A "master" transaction ha not been started yet DBUG_PRINT("trans",("starting transaction, all")); trans= m_ndb->startTransaction(); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); /* Loading Loading @@ -3081,7 +3098,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) m_retrieve_primary_key= FALSE; m_ops_pending= 0; { NDBDICT *dict= m_ndb->getDictionary(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; void *tab_info; if (!(tab= dict->getTable(m_tabname, &tab_info))) Loading @@ -3108,7 +3125,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) We must in this case close the transaction to release resources */ DBUG_PRINT("trans",("ending non-updating transaction")); m_ndb->closeTransaction(m_active_trans); ndb->closeTransaction(m_active_trans); thd->transaction.stmt.ndb_tid= 0; } } Loading Loading @@ -3154,16 +3171,17 @@ int ha_ndbcluster::start_stmt(THD *thd) NdbConnection *trans= (NdbConnection*)thd->transaction.stmt.ndb_tid; if (!trans){ Ndb *ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; DBUG_PRINT("trans",("Starting transaction stmt")); NdbConnection *tablock_trans= (NdbConnection*)thd->transaction.all.ndb_tid; DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); DBUG_ASSERT(tablock_trans); // trans= m_ndb->hupp(tablock_trans); trans= m_ndb->startTransaction(); // trans= ndb->hupp(tablock_trans); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(m_ndb->getNdbError()); ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } Loading Loading @@ -3550,7 +3568,8 @@ int ha_ndbcluster::create(const char *name, DBUG_RETURN(my_errno); // Create the table in NDB NDBDICT *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); if (dict->createTable(tab) != 0) { const NdbError err= dict->getNdbError(); Loading Loading @@ -3595,7 +3614,8 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info, bool unique) { NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); KEY_PART_INFO *key_part= key_info->key_part; KEY_PART_INFO *end= key_part + key_info->key_parts; Loading Loading @@ -3654,14 +3674,15 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); dict= ndb->getDictionary(); if (!(orig_tab= dict->getTable(m_tabname))) ERR_RETURN(dict->getNdbError()); m_table= (void *)orig_tab; // Change current database to that of target table set_dbname(to); m_ndb->setDatabaseName(m_dbname); ndb->setDatabaseName(m_dbname); if (!(result= alter_table_name(new_tabname))) { // Rename .ndb file Loading @@ -3678,7 +3699,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) int ha_ndbcluster::alter_table_name(const char *to) { NDBDICT * dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); const NDBTAB *orig_tab= (const NDBTAB *) m_table; int ret; DBUG_ENTER("alter_table_name_table"); Loading Loading @@ -3720,7 +3742,8 @@ int ha_ndbcluster::delete_table(const char *name) int ha_ndbcluster::drop_table() { NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("drop_table"); DBUG_PRINT("enter", ("Deleting %s", m_tabname)); Loading Loading @@ -3756,6 +3779,7 @@ ulonglong ha_ndbcluster::get_auto_increment() Uint64 auto_value; DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); Ndb *ndb= get_ndb(); cache_size= (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? m_rows_to_insert - m_rows_inserted Loading @@ -3764,8 +3788,8 @@ ulonglong ha_ndbcluster::get_auto_increment() : m_autoincrement_prefetch; auto_value= (m_skip_auto_increment) ? m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) : m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); ndb->readAutoIncrementValue((const NDBTAB *) m_table) : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); DBUG_RETURN((longlong)auto_value); } Loading @@ -3778,7 +3802,6 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): handler(table_arg), m_active_trans(NULL), m_active_cursor(NULL), m_ndb(NULL), m_table(NULL), m_table_info(NULL), m_table_flags(HA_REC_NOT_IN_SEQ | Loading Loading @@ -3909,7 +3932,6 @@ int ha_ndbcluster::close(void) DBUG_ENTER("close"); free_share(m_share); m_share= 0; release_metadata(); m_ndb= NULL; DBUG_RETURN(0); } Loading Loading @@ -3971,11 +3993,12 @@ Ndb* check_ndb_in_thd(THD* thd) int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; Ndb *ndb; DBUG_ENTER("check_ndb_connection"); if (!(m_ndb= check_ndb_in_thd(thd))) if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); m_ndb->setDatabaseName(m_dbname); ndb->setDatabaseName(m_dbname); DBUG_RETURN(0); } Loading