18 #include "ndb_thd_ndb.h"
25 static const int MAX_TRANSACTIONS= 4;
29 Thd_ndb::seize(THD* thd)
31 DBUG_ENTER(
"seize_thd_ndb");
37 if (thd_ndb->ndb->
init(MAX_TRANSACTIONS) != 0)
39 DBUG_PRINT(
"error", (
"Ndb::init failed, eror: %d message: %s",
51 Thd_ndb::release(
Thd_ndb* thd_ndb)
53 DBUG_ENTER(
"release_thd_ndb");
60 Thd_ndb::recycle_ndb(THD* thd)
62 DBUG_ENTER(
"recycle_ndb");
63 DBUG_PRINT(
"enter", (
"ndb: 0x%lx", (
long)ndb));
65 DBUG_ASSERT(global_schema_lock_trans == NULL);
66 DBUG_ASSERT(trans == NULL);
69 if ((ndb=
new Ndb(connection,
"")) == NULL)
71 DBUG_PRINT(
"error",(
"failed to allocate Ndb object"));
75 if (ndb->
init(MAX_TRANSACTIONS) != 0)
79 DBUG_PRINT(
"error", (
"Ndb::init failed, %d message: %s",
89 Thd_ndb::valid_ndb(
void)
93 if (global_schema_lock_trans)
101 if (unlikely(m_connect_count != connection->get_connect_count()))
109 Thd_ndb::init_open_tables()