#include <NdbDictionaryImpl.hpp>
Collaboration diagram for NdbDictInterface:

Definition at line 425 of file NdbDictionaryImpl.hpp.
| NdbDictInterface::NdbDictInterface | ( | NdbError & | err | ) | [inline] |
Definition at line 427 of file NdbDictionaryImpl.hpp.
References m_masterNodeId, m_reference, m_transporter, and NULL.
00427 : m_error(err) { 00428 m_reference = 0; 00429 m_masterNodeId = 0; 00430 m_transporter= NULL; 00431 }
| NdbDictInterface::~NdbDictInterface | ( | ) |
| int NdbDictInterface::alterTable | ( | class Ndb & | ndb, | |
| NdbTableImpl & | ||||
| ) |
Definition at line 2365 of file NdbDictionaryImpl.cpp.
References createOrAlterTable(), DBUG_ENTER, DBUG_RETURN, and ndb.
Referenced by NdbDictionaryImpl::alterTableGlobal().
02367 { 02368 DBUG_ENTER("NdbDictInterface::alterTable"); 02369 DBUG_RETURN(createOrAlterTable(ndb, impl, true)); 02370 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::create_file | ( | const NdbFileImpl & | , | |
| const NdbFilegroupImpl & | , | |||
| bool | overwrite, | |||
| NdbDictObjectImpl * | ||||
| ) |
Definition at line 4493 of file NdbDictionaryImpl.cpp.
References abort(), CreateFileRef::Busy, BaseString::c_str(), CAST_PTR, data, DBDICT, DBUG_ENTER, DBUG_RETURN, dictSignal(), SimpleProperties::Eof, err, f, DictFilegroupInfo::FileMapping, DictFilegroupInfo::FileMappingSize, CreateFileReq::ForceCreateFile, UtilBuffer::get_data(), NdbApiSignal::getDataPtrSend(), GSN_CREATE_FILE_REQ, UtilBuffer::length(), m_buffer, NdbDictObjectImpl::m_id, NdbFileImpl::m_path, m_reference, NdbFileImpl::m_size, NdbDictObjectImpl::m_type, NdbDictObjectImpl::m_version, CreateFileRef::NotMaster, CreateFileReq::objType, LinearSectionPtr::p, SimpleProperties::pack(), CreateFileReq::requestInfo, CreateFileReq::senderData, CreateFileReq::senderRef, LinearSectionPtr::sz, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::createDatafile(), and NdbDictionaryImpl::createUndofile().
04497 { 04498 DBUG_ENTER("NdbDictInterface::create_file"); 04499 UtilBufferWriter w(m_buffer); 04500 DictFilegroupInfo::File f; f.init(); 04501 snprintf(f.FileName, sizeof(f.FileName), file.m_path.c_str()); 04502 f.FileType = file.m_type; 04503 f.FilegroupId = group.m_id; 04504 f.FilegroupVersion = group.m_version; 04505 f.FileSizeHi = (file.m_size >> 32); 04506 f.FileSizeLo = (file.m_size & 0xFFFFFFFF); 04507 04508 SimpleProperties::UnpackStatus s; 04509 s = SimpleProperties::pack(w, 04510 &f, 04511 DictFilegroupInfo::FileMapping, 04512 DictFilegroupInfo::FileMappingSize, true); 04513 04514 if(s != SimpleProperties::Eof){ 04515 abort(); 04516 } 04517 04518 NdbApiSignal tSignal(m_reference); 04519 tSignal.theReceiversBlockNumber = DBDICT; 04520 tSignal.theVerId_signalNumber = GSN_CREATE_FILE_REQ; 04521 tSignal.theLength = CreateFileReq::SignalLength; 04522 04523 CreateFileReq* req = CAST_PTR(CreateFileReq, tSignal.getDataPtrSend()); 04524 req->senderRef = m_reference; 04525 req->senderData = 0; 04526 req->objType = file.m_type; 04527 req->requestInfo = 0; 04528 if (overwrite) 04529 req->requestInfo |= CreateFileReq::ForceCreateFile; 04530 04531 LinearSectionPtr ptr[3]; 04532 ptr[0].p = (Uint32*)m_buffer.get_data(); 04533 ptr[0].sz = m_buffer.length() / 4; 04534 04535 int err[] = { CreateFileRef::Busy, CreateFileRef::NotMaster, 0}; 04536 /* 04537 Send signal without time-out since creating files can take a very long 04538 time if the file is very big. 04539 */ 04540 int ret = dictSignal(&tSignal, ptr, 1, 04541 0, // master 04542 WAIT_CREATE_INDX_REQ, 04543 -1, 100, 04544 err); 04545 04546 if (ret == 0 && obj) 04547 { 04548 Uint32* data = (Uint32*)m_buffer.get_data(); 04549 obj->m_id = data[0]; 04550 obj->m_version = data[1]; 04551 } 04552 04553 DBUG_RETURN(ret); 04554 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::create_filegroup | ( | const NdbFilegroupImpl & | , | |
| NdbDictObjectImpl * | ||||
| ) |
Definition at line 4623 of file NdbDictionaryImpl.cpp.
References abort(), CreateFilegroupRef::Busy, BaseString::c_str(), CAST_PTR, data, DBDICT, DBUG_ENTER, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), SimpleProperties::Eof, err, DictFilegroupInfo::Filegroup::FilegroupName, DictFilegroupInfo::Filegroup::FilegroupType, UtilBuffer::get_data(), get_filegroup(), NdbApiSignal::getDataPtrSend(), GSN_CREATE_FILEGROUP_REQ, DictFilegroupInfo::Filegroup::init(), UtilBuffer::length(), DictFilegroupInfo::Filegroup::LF_UndoBufferSize, DictTabInfo::LogfileGroup, NdbDictionary::Object::LogfileGroup, m_buffer, NdbFilegroupImpl::m_extent_size, NdbDictObjectImpl::m_id, NdbFilegroupImpl::m_logfile_group_id, NdbFilegroupImpl::m_logfile_group_name, NdbFilegroupImpl::m_logfile_group_version, NdbFilegroupImpl::m_name, m_reference, NdbDictObjectImpl::m_type, NdbFilegroupImpl::m_undo_buffer_size, NdbDictObjectImpl::m_version, DictFilegroupInfo::Mapping, DictFilegroupInfo::MappingSize, CreateFilegroupRef::NotMaster, CreateFilegroupReq::objType, LinearSectionPtr::p, SimpleProperties::pack(), CreateFilegroupReq::senderData, CreateFilegroupReq::senderRef, LinearSectionPtr::sz, DictTabInfo::Tablespace, NdbDictionary::Object::Tablespace, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, DictFilegroupInfo::Filegroup::TS_ExtentSize, DictFilegroupInfo::Filegroup::TS_LogfileGroupId, DictFilegroupInfo::Filegroup::TS_LogfileGroupVersion, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::createLogfileGroup(), and NdbDictionaryImpl::createTablespace().
04625 { 04626 DBUG_ENTER("NdbDictInterface::create_filegroup"); 04627 UtilBufferWriter w(m_buffer); 04628 DictFilegroupInfo::Filegroup fg; fg.init(); 04629 snprintf(fg.FilegroupName, sizeof(fg.FilegroupName), group.m_name.c_str()); 04630 switch(group.m_type){ 04631 case NdbDictionary::Object::Tablespace: 04632 { 04633 fg.FilegroupType = DictTabInfo::Tablespace; 04634 //fg.TS_DataGrow = group.m_grow_spec; 04635 fg.TS_ExtentSize = group.m_extent_size; 04636 04637 if(group.m_logfile_group_version != ~(Uint32)0) 04638 { 04639 fg.TS_LogfileGroupId = group.m_logfile_group_id; 04640 fg.TS_LogfileGroupVersion = group.m_logfile_group_version; 04641 } 04642 else 04643 { 04644 NdbLogfileGroupImpl tmp; 04645 if(get_filegroup(tmp, NdbDictionary::Object::LogfileGroup, 04646 group.m_logfile_group_name.c_str()) == 0) 04647 { 04648 fg.TS_LogfileGroupId = tmp.m_id; 04649 fg.TS_LogfileGroupVersion = tmp.m_version; 04650 } 04651 else // error set by get filegroup 04652 { 04653 DBUG_RETURN(-1); 04654 } 04655 } 04656 } 04657 break; 04658 case NdbDictionary::Object::LogfileGroup: 04659 fg.LF_UndoBufferSize = group.m_undo_buffer_size; 04660 fg.FilegroupType = DictTabInfo::LogfileGroup; 04661 //fg.LF_UndoGrow = group.m_grow_spec; 04662 break; 04663 default: 04664 abort(); 04665 DBUG_RETURN(-1); 04666 }; 04667 04668 SimpleProperties::UnpackStatus s; 04669 s = SimpleProperties::pack(w, 04670 &fg, 04671 DictFilegroupInfo::Mapping, 04672 DictFilegroupInfo::MappingSize, true); 04673 04674 if(s != SimpleProperties::Eof){ 04675 abort(); 04676 } 04677 04678 NdbApiSignal tSignal(m_reference); 04679 tSignal.theReceiversBlockNumber = DBDICT; 04680 tSignal.theVerId_signalNumber = GSN_CREATE_FILEGROUP_REQ; 04681 tSignal.theLength = CreateFilegroupReq::SignalLength; 04682 04683 CreateFilegroupReq* req = 04684 CAST_PTR(CreateFilegroupReq, tSignal.getDataPtrSend()); 04685 req->senderRef = m_reference; 04686 req->senderData = 0; 04687 req->objType = fg.FilegroupType; 04688 04689 LinearSectionPtr ptr[3]; 04690 ptr[0].p = (Uint32*)m_buffer.get_data(); 04691 ptr[0].sz = m_buffer.length() / 4; 04692 04693 int err[] = { CreateFilegroupRef::Busy, CreateFilegroupRef::NotMaster, 0}; 04694 int ret = dictSignal(&tSignal, ptr, 1, 04695 0, // master 04696 WAIT_CREATE_INDX_REQ, 04697 DICT_WAITFOR_TIMEOUT, 100, 04698 err); 04699 04700 if (ret == 0 && obj) 04701 { 04702 Uint32* data = (Uint32*)m_buffer.get_data(); 04703 obj->m_id = data[0]; 04704 obj->m_version = data[1]; 04705 } 04706 04707 DBUG_RETURN(ret); 04708 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::create_index_obj_from_table | ( | NdbIndexImpl ** | dst, | |
| NdbTableImpl * | index_table, | |||
| const NdbTableImpl * | primary_table | |||
| ) | [static] |
Definition at line 3032 of file NdbDictionaryImpl.cpp.
References BaseString::assign(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, Vector< T >::fill(), mySTL::fill(), NdbTableImpl::getColumn(), NdbDictionary::Column::getColumnNo(), NdbTableImpl::getName(), NdbDictionary::Table::getObjectId(), NdbDictionary::Table::getObjectVersion(), NdbDictionary::Column::getPrimaryKey(), NdbIndexImpl::m_columns, NdbTableImpl::m_columns, NdbColumnImpl::m_distributionKey, NdbTableImpl::m_externalName, NdbIndexImpl::m_externalName, NdbDictObjectImpl::m_id, NdbTableImpl::m_indexType, NdbIndexImpl::m_key_ids, NdbTableImpl::m_logging, NdbIndexImpl::m_logging, NdbTableImpl::m_noOfDistributionKeys, NdbTableImpl::m_noOfKeys, NdbDictObjectImpl::m_status, NdbIndexImpl::m_table_id, NdbIndexImpl::m_table_version, NdbIndexImpl::m_tableName, NdbDictObjectImpl::m_type, NdbDictObjectImpl::m_version, NdbDictionary::Object::OrderedIndex, Vector< T >::push_back(), and Vector< T >::size().
Referenced by BackupRestore::endOfTables(), and InitIndex::init().
03035 { 03036 DBUG_ENTER("NdbDictInterface::create_index_obj_from_table"); 03037 NdbIndexImpl *idx = new NdbIndexImpl(); 03038 idx->m_version = tab->m_version; 03039 idx->m_status = tab->m_status; 03040 idx->m_id = tab->m_id; 03041 idx->m_externalName.assign(tab->getName()); 03042 idx->m_tableName.assign(prim->m_externalName); 03043 NdbDictionary::Object::Type type = idx->m_type = tab->m_indexType; 03044 idx->m_logging = tab->m_logging; 03045 // skip last attribute (NDB$PK or NDB$TNODE) 03046 03047 const Uint32 distKeys = prim->m_noOfDistributionKeys; 03048 Uint32 keyCount = (distKeys ? distKeys : prim->m_noOfKeys); 03049 03050 unsigned i; 03051 for(i = 0; i+1<tab->m_columns.size(); i++){ 03052 NdbColumnImpl* org = tab->m_columns[i]; 03053 03054 NdbColumnImpl* col = new NdbColumnImpl; 03055 // Copy column definition 03056 *col = * org; 03057 idx->m_columns.push_back(col); 03058 03062 const NdbColumnImpl* primCol = prim->getColumn(col->getName()); 03063 int key_id = primCol->getColumnNo(); 03064 int fill = -1; 03065 idx->m_key_ids.fill(key_id, fill); 03066 idx->m_key_ids[key_id] = i; 03067 col->m_keyInfoPos = key_id; 03068 03069 if(type == NdbDictionary::Object::OrderedIndex && 03070 (primCol->m_distributionKey || 03071 (distKeys == 0 && primCol->getPrimaryKey()))) 03072 { 03073 keyCount--; 03074 org->m_distributionKey = 1; 03075 } 03076 } 03077 03078 if(keyCount == 0) 03079 { 03080 tab->m_noOfDistributionKeys = (distKeys ? distKeys : prim->m_noOfKeys); 03081 } 03082 else 03083 { 03084 for(i = 0; i+1<tab->m_columns.size(); i++) 03085 tab->m_columns[i]->m_distributionKey = 0; 03086 } 03087 03088 idx->m_table_id = prim->getObjectId(); 03089 idx->m_table_version = prim->getObjectVersion(); 03090 03091 * dst = idx; 03092 DBUG_PRINT("exit", ("m_id: %d m_version: %d", idx->m_id, idx->m_version)); 03093 DBUG_RETURN(0); 03094 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::createEvent | ( | class Ndb & | ndb, | |
| NdbEventImpl & | , | |||
| int | getFlag | |||
| ) |
Definition at line 3478 of file NdbDictionaryImpl.cpp.
References SimpleProperties::Writer::add(), BaseString::c_str(), CAST_PTR, CreateEvntReq::clearFlags(), NdbError::code, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), NdbDictionary::Event::ER_ALL, NdbDictionary::Event::ER_SUBSCRIBE, ERR_RETURN, UtilBuffer::get_data(), CreateEvntConf::getAttrListBitmask(), NdbApiSignal::getDataPtrSend(), CreateEvntConf::getEventId(), CreateEvntConf::getEventKey(), CreateEvntConf::getEventType(), getNdbError(), CreateEvntConf::getTableId(), CreateEvntConf::getTableVersion(), GSN_CREATE_EVNT_REQ, UtilBuffer::length(), NdbEventImpl::m_attrListBitmask, m_buffer, m_error, NdbEventImpl::m_eventId, NdbEventImpl::m_eventKey, NdbDictObjectImpl::m_id, NdbEventImpl::m_name, m_reference, NdbEventImpl::m_rep, NdbEventImpl::m_table_id, NdbEventImpl::m_table_version, NdbEventImpl::m_tableImpl, NdbEventImpl::m_tableName, NdbDictObjectImpl::m_version, MAX_TAB_NAME_SIZE, NdbEventImpl::mi_type, ndbout_c(), LinearSectionPtr::p, CreateEvntReq::RT_USER_CREATE, CreateEvntReq::RT_USER_GET, CreateEvntReq::setAttrListBitmask(), CreateEvntReq::setEventType(), CreateEvntReq::setReportAll(), CreateEvntReq::setReportSubscribe(), CreateEvntReq::setRequestType(), NdbEventImpl::setTable(), CreateEvntReq::setTableId(), CreateEvntReq::setTableVersion(), CreateEvntReq::setUserData(), CreateEvntReq::setUserRef(), SimpleProperties::StringValue, strlen(), LinearSectionPtr::sz, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::getEvent().
03481 { 03482 DBUG_ENTER("NdbDictInterface::createEvent"); 03483 DBUG_PRINT("enter",("getFlag=%d",getFlag)); 03484 03485 NdbApiSignal tSignal(m_reference); 03486 tSignal.theReceiversBlockNumber = DBDICT; 03487 tSignal.theVerId_signalNumber = GSN_CREATE_EVNT_REQ; 03488 if (getFlag) 03489 tSignal.theLength = CreateEvntReq::SignalLengthGet; 03490 else 03491 tSignal.theLength = CreateEvntReq::SignalLengthCreate; 03492 03493 CreateEvntReq * const req = CAST_PTR(CreateEvntReq, tSignal.getDataPtrSend()); 03494 03495 req->setUserRef(m_reference); 03496 req->setUserData(0); 03497 03498 if (getFlag) { 03499 // getting event from Dictionary 03500 req->setRequestType(CreateEvntReq::RT_USER_GET); 03501 } else { 03502 DBUG_PRINT("info",("tableId: %u tableVersion: %u", 03503 evnt.m_tableImpl->m_id, 03504 evnt.m_tableImpl->m_version)); 03505 // creating event in Dictionary 03506 req->setRequestType(CreateEvntReq::RT_USER_CREATE); 03507 req->setTableId(evnt.m_tableImpl->m_id); 03508 req->setTableVersion(evnt.m_tableImpl->m_version); 03509 req->setAttrListBitmask(evnt.m_attrListBitmask); 03510 req->setEventType(evnt.mi_type); 03511 req->clearFlags(); 03512 if (evnt.m_rep & NdbDictionary::Event::ER_ALL) 03513 req->setReportAll(); 03514 if (evnt.m_rep & NdbDictionary::Event::ER_SUBSCRIBE) 03515 req->setReportSubscribe(); 03516 } 03517 03518 UtilBufferWriter w(m_buffer); 03519 03520 const size_t len = strlen(evnt.m_name.c_str()) + 1; 03521 if(len > MAX_TAB_NAME_SIZE) { 03522 m_error.code= 4241; 03523 ERR_RETURN(getNdbError(), -1); 03524 } 03525 03526 w.add(SimpleProperties::StringValue, evnt.m_name.c_str()); 03527 03528 if (getFlag == 0) 03529 { 03530 const BaseString internal_tabname( 03531 ndb.internalize_table_name(evnt.m_tableName.c_str())); 03532 w.add(SimpleProperties::StringValue, 03533 internal_tabname.c_str()); 03534 } 03535 03536 LinearSectionPtr ptr[1]; 03537 ptr[0].p = (Uint32*)m_buffer.get_data(); 03538 ptr[0].sz = (m_buffer.length()+3) >> 2; 03539 03540 int ret = dictSignal(&tSignal,ptr, 1, 03541 0, // master 03542 WAIT_CREATE_INDX_REQ, 03543 DICT_WAITFOR_TIMEOUT, 100, 03544 0, -1); 03545 03546 if (ret) { 03547 ERR_RETURN(getNdbError(), ret); 03548 } 03549 03550 char *dataPtr = (char *)m_buffer.get_data(); 03551 unsigned int lenCreateEvntConf = *((unsigned int *)dataPtr); 03552 dataPtr += sizeof(lenCreateEvntConf); 03553 CreateEvntConf const * evntConf = (CreateEvntConf *)dataPtr; 03554 dataPtr += lenCreateEvntConf; 03555 03556 // NdbEventImpl *evntImpl = (NdbEventImpl *)evntConf->getUserData(); 03557 03558 evnt.m_eventId = evntConf->getEventId(); 03559 evnt.m_eventKey = evntConf->getEventKey(); 03560 evnt.m_table_id = evntConf->getTableId(); 03561 evnt.m_table_version = evntConf->getTableVersion(); 03562 03563 if (getFlag) { 03564 evnt.m_attrListBitmask = evntConf->getAttrListBitmask(); 03565 evnt.mi_type = evntConf->getEventType(); 03566 evnt.setTable(dataPtr); 03567 } else { 03568 if (evnt.m_tableImpl->m_id != evntConf->getTableId() || 03569 evnt.m_tableImpl->m_version != evntConf->getTableVersion() || 03570 //evnt.m_attrListBitmask != evntConf->getAttrListBitmask() || 03571 evnt.mi_type != evntConf->getEventType()) { 03572 ndbout_c("ERROR*************"); 03573 ERR_RETURN(getNdbError(), 1); 03574 } 03575 } 03576 03577 DBUG_RETURN(0); 03578 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::createIndex | ( | class Ndb & | ndb, | |
| const NdbIndexImpl & | , | |||
| const NdbTableImpl & | ||||
| ) |
Definition at line 3119 of file NdbDictionaryImpl.cpp.
References SimpleProperties::Writer::add(), CreateIndxRef::Busy, BaseString::c_str(), CAST_PTR, NdbSqlUtil::check_column_for_hash_index(), NdbSqlUtil::check_column_for_ordered_index(), NdbError::code, DBDICT, DICT_WAITFOR_TIMEOUT, dictSignal(), err, UtilBuffer::get_data(), NdbTableImpl::getColumn(), NdbApiSignal::getDataPtrSend(), getKernelConstant(), NdbIndexImpl::getName(), GSN_CREATE_INDX_REQ, Id_array< SZ >::id, indexTypeMapping, Ndb::internalize_index_name(), UtilBuffer::length(), m_buffer, NdbIndexImpl::m_columns, m_error, NdbIndexImpl::m_externalName, NdbDictObjectImpl::m_id, NdbIndexImpl::m_logging, m_reference, NdbDictObjectImpl::m_type, MAX_TAB_NAME_SIZE, ndb, CreateIndxRef::NotMaster, DictTabInfo::OrderedIndex, LinearSectionPtr::p, CreateIndxReq::RT_USER, CreateIndxReq::setConnectionPtr(), CreateIndxReq::setIndexType(), CreateIndxReq::setOnline(), CreateIndxReq::setRequestType(), CreateIndxReq::setTableId(), CreateIndxReq::setUserRef(), Vector< T >::size(), strlen(), LinearSectionPtr::sz, Id_array< SZ >::sz, DictTabInfo::TableLoggedFlag, DictTabInfo::TableName, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, DictTabInfo::UndefTableType, DictTabInfo::UniqueHashIndex, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::createIndex().
03122 { 03123 //validate(); 03124 //aggregate(); 03125 unsigned i, err; 03126 UtilBufferWriter w(m_buffer); 03127 const size_t len = strlen(impl.m_externalName.c_str()) + 1; 03128 if(len > MAX_TAB_NAME_SIZE) { 03129 m_error.code = 4241; 03130 return -1; 03131 } 03132 const BaseString internalName( 03133 ndb.internalize_index_name(&table, impl.getName())); 03134 w.add(DictTabInfo::TableName, internalName.c_str()); 03135 w.add(DictTabInfo::TableLoggedFlag, impl.m_logging); 03136 03137 NdbApiSignal tSignal(m_reference); 03138 tSignal.theReceiversBlockNumber = DBDICT; 03139 tSignal.theVerId_signalNumber = GSN_CREATE_INDX_REQ; 03140 tSignal.theLength = CreateIndxReq::SignalLength; 03141 03142 CreateIndxReq * const req = CAST_PTR(CreateIndxReq, tSignal.getDataPtrSend()); 03143 03144 req->setUserRef(m_reference); 03145 req->setConnectionPtr(0); 03146 req->setRequestType(CreateIndxReq::RT_USER); 03147 03148 Uint32 it = getKernelConstant(impl.m_type, 03149 indexTypeMapping, 03150 DictTabInfo::UndefTableType); 03151 03152 if(it == DictTabInfo::UndefTableType){ 03153 m_error.code = 4250; 03154 return -1; 03155 } 03156 req->setIndexType((DictTabInfo::TableType) it); 03157 03158 req->setTableId(table.m_id); 03159 req->setOnline(true); 03160 AttributeList attributeList; 03161 attributeList.sz = impl.m_columns.size(); 03162 for(i = 0; i<attributeList.sz; i++){ 03163 const NdbColumnImpl* col = 03164 table.getColumn(impl.m_columns[i]->m_name.c_str()); 03165 if(col == 0){ 03166 m_error.code = 4247; 03167 return -1; 03168 } 03169 // Copy column definition XXX must be wrong, overwrites 03170 *impl.m_columns[i] = *col; 03171 03172 // index key type check 03173 if (it == DictTabInfo::UniqueHashIndex && 03174 (err = NdbSqlUtil::check_column_for_hash_index(col->m_type, col->m_cs)) 03175 || 03176 it == DictTabInfo::OrderedIndex && 03177 (err = NdbSqlUtil::check_column_for_ordered_index(col->m_type, col->m_cs))) 03178 { 03179 m_error.code = err; 03180 return -1; 03181 } 03182 // API uses external column number to talk to DICT 03183 attributeList.id[i] = col->m_column_no; 03184 } 03185 LinearSectionPtr ptr[2]; 03186 ptr[0].p = (Uint32*)&attributeList; 03187 ptr[0].sz = 1 + attributeList.sz; 03188 ptr[1].p = (Uint32*)m_buffer.get_data(); 03189 ptr[1].sz = m_buffer.length() >> 2; //BUG? 03190 03191 int errCodes[] = { CreateIndxRef::Busy, CreateIndxRef::NotMaster, 0 }; 03192 return dictSignal(&tSignal, ptr, 2, 03193 0, // master 03194 WAIT_CREATE_INDX_REQ, 03195 DICT_WAITFOR_TIMEOUT, 100, 03196 errCodes); 03197 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::createOrAlterTable | ( | class Ndb & | ndb, | |
| NdbTableImpl & | , | |||
| bool | alter | |||
| ) |
Definition at line 2373 of file NdbDictionaryImpl.cpp.
References DictTabInfo::AllNodesSmallTable, UtilBuffer::assign(), BaseString::assign(), BaseString::c_str(), UtilBuffer::clear(), BaseString::clear(), NdbError::code, NdbTableImpl::computeAggregates(), DBUG_ENTER, DBUG_RETURN, DictTabInfo::Table::DefaultNoPartFlag, UtilBuffer::empty(), BaseString::empty(), err, DictTabInfo::Table::FragmentCount, DictTabInfo::Table::FragmentData, DictTabInfo::Table::FragmentDataLen, DictTabInfo::Table::FragmentType, fragmentTypeMapping, DictTabInfo::Table::FrmData, DictTabInfo::Table::FrmLen, UtilBuffer::get_data(), get_filegroup(), getKernelConstant(), NdbDictionary::Table::getNoOfPrimaryKeys(), DictTabInfo::Table::init(), Ndb::internalize_table_name(), UtilBuffer::length(), DictTabInfo::Table::LinearHashFlag, NdbTableImpl::m_changeMask, NdbTableImpl::m_columns, NdbTableImpl::m_default_no_part_flag, m_error, NdbTableImpl::m_externalName, NdbTableImpl::m_fd, NdbTableImpl::m_fragmentCount, NdbTableImpl::m_fragmentType, NdbTableImpl::m_frm, NdbDictObjectImpl::m_id, NdbTableImpl::m_internalName, NdbTableImpl::m_kvalue, NdbTableImpl::m_linear_flag, NdbTableImpl::m_logging, NdbTableImpl::m_max_rows, NdbTableImpl::m_maxLoadFactor, NdbTableImpl::m_min_rows, NdbTableImpl::m_minLoadFactor, NdbTableImpl::m_new_fd, NdbTableImpl::m_new_range, NdbTableImpl::m_new_ts, NdbTableImpl::m_new_ts_name, NdbTableImpl::m_newExternalName, NdbTableImpl::m_newFrm, NdbTableImpl::m_noOfDistributionKeys, NdbTableImpl::m_noOfKeys, NdbTableImpl::m_primaryTableId, NdbTableImpl::m_range, NdbTableImpl::m_row_checksum, NdbTableImpl::m_row_gci, NdbTableImpl::m_tablespace_id, NdbTableImpl::m_tablespace_name, NdbTableImpl::m_tablespace_version, NdbTableImpl::m_ts, NdbTableImpl::m_ts_name, NdbDictObjectImpl::m_version, MAX_FRM_DATA_SIZE, MAX_NDB_PARTITIONS, DictTabInfo::Table::MaxLoadFactor, DictTabInfo::Table::MaxRowsHigh, DictTabInfo::Table::MaxRowsLow, memcpy, DictTabInfo::Table::MinLoadFactor, DictTabInfo::Table::MinRowsHigh, DictTabInfo::Table::MinRowsLow, ndb, NDB_MAX_ATTRIBUTES_IN_TABLE, NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY, NDB_STORAGETYPE_DISK, NdbMem_Allocate(), NdbMem_Free(), DictTabInfo::Table::NoOfAttributes, NULL, DictTabInfo::Table::PrimaryTableId, DictTabInfo::Table::RangeListData, DictTabInfo::Table::RangeListDataLen, RNIL, DictTabInfo::Table::RowChecksumFlag, DictTabInfo::Table::RowGCIFlag, AlterTableReq::setFragDataFlag(), AlterTableReq::setFrmFlag(), AlterTableReq::setNameFlag(), AlterTableReq::setRangeListFlag(), AlterTableReq::setTsFlag(), AlterTableReq::setTsNameFlag(), Vector< T >::size(), BaseString::snprintf(), strlen(), DictTabInfo::Table::TableKValue, DictTabInfo::Table::TableLoggedFlag, DictTabInfo::Table::TableName, NdbDictionary::Object::Tablespace, DictTabInfo::Table::TablespaceData, DictTabInfo::Table::TablespaceDataLen, DictTabInfo::Table::TablespaceId, DictTabInfo::Table::TablespaceVersion, DictTabInfo::Table::TableType, DictTabInfo::Table::TableVersion, NdbTableImpl::updateMysqlName(), and DictTabInfo::UserTable.
Referenced by alterTable(), and createTable().
02376 { 02377 unsigned i, err; 02378 char *ts_names[MAX_NDB_PARTITIONS]; 02379 DBUG_ENTER("NdbDictInterface::createOrAlterTable"); 02380 02381 impl.computeAggregates(); 02382 02383 if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ 02384 m_error.code= 4317; 02385 DBUG_RETURN(-1); 02386 } 02387 unsigned sz = impl.m_columns.size(); 02388 if (sz > NDB_MAX_ATTRIBUTES_IN_TABLE){ 02389 m_error.code= 4318; 02390 DBUG_RETURN(-1); 02391 } 02392 02393 // Check if any changes for alter table 02394 02395 // Name change 02396 if (!impl.m_newExternalName.empty()) { 02397 if (alter) 02398 { 02399 AlterTableReq::setNameFlag(impl.m_changeMask, true); 02400 } 02401 impl.m_externalName.assign(impl.m_newExternalName); 02402 impl.m_newExternalName.clear(); 02403 } 02404 // Definition change (frm) 02405 if (!impl.m_newFrm.empty()) 02406 { 02407 if (alter) 02408 { 02409 AlterTableReq::setFrmFlag(impl.m_changeMask, true); 02410 } 02411 impl.m_frm.assign(impl.m_newFrm.get_data(), impl.m_newFrm.length()); 02412 impl.m_newFrm.clear(); 02413 } 02414 // Change FragmentData (fragment identity, state, tablespace id) 02415 if (!impl.m_new_fd.empty()) 02416 { 02417 if (alter) 02418 { 02419 AlterTableReq::setFragDataFlag(impl.m_changeMask, true); 02420 } 02421 impl.m_fd.assign(impl.m_new_fd.get_data(), impl.m_new_fd.length()); 02422 impl.m_new_fd.clear(); 02423 } 02424 // Change Tablespace Name Data 02425 if (!impl.m_new_ts_name.empty()) 02426 { 02427 if (alter) 02428 { 02429 AlterTableReq::setTsNameFlag(impl.m_changeMask, true); 02430 } 02431 impl.m_ts_name.assign(impl.m_new_ts_name.get_data(), 02432 impl.m_new_ts_name.length()); 02433 impl.m_new_ts_name.clear(); 02434 } 02435 // Change Range/List Data 02436 if (!impl.m_new_range.empty()) 02437 { 02438 if (alter) 02439 { 02440 AlterTableReq::setRangeListFlag(impl.m_changeMask, true); 02441 } 02442 impl.m_range.assign(impl.m_new_range.get_data(), 02443 impl.m_new_range.length()); 02444 impl.m_new_range.clear(); 02445 } 02446 // Change Tablespace Data 02447 if (!impl.m_new_ts.empty()) 02448 { 02449 if (alter) 02450 { 02451 AlterTableReq::setTsFlag(impl.m_changeMask, true); 02452 } 02453 impl.m_ts.assign(impl.m_new_ts.get_data(), 02454 impl.m_new_ts.length()); 02455 impl.m_new_ts.clear(); 02456 } 02457 02458 02459 /* 02460 TODO RONM: Here I need to insert checks for fragment array and 02461 range or list array 02462 */ 02463 02464 //validate(); 02465 //aggregate(); 02466 02467 const BaseString internalName( 02468 ndb.internalize_table_name(impl.m_externalName.c_str())); 02469 impl.m_internalName.assign(internalName); 02470 impl.updateMysqlName(); 02471 DictTabInfo::Table *tmpTab; 02472 02473 tmpTab = (DictTabInfo::Table*)NdbMem_Allocate(sizeof(DictTabInfo::Table)); 02474 if (!tmpTab) 02475 { 02476 m_error.code = 4000; 02477 DBUG_RETURN(-1); 02478 } 02479 tmpTab->init(); 02480 BaseString::snprintf(tmpTab->TableName, 02481 sizeof(tmpTab->TableName), 02482 internalName.c_str()); 02483 02484 Uint32 distKeys= 0; 02485 for(i = 0; i<sz; i++) { 02486 const NdbColumnImpl * col = impl.m_columns[i]; 02487 if (col == NULL) { 02488 m_error.code = 4272; 02489 NdbMem_Free((void*)tmpTab); 02490 DBUG_RETURN(-1); 02491 } 02492 if (col->m_distributionKey) 02493 { 02494 distKeys++; 02495 } 02496 } 02497 if (distKeys == impl.m_noOfKeys) 02498 distKeys= 0; 02499 impl.m_noOfDistributionKeys= distKeys; 02500 02501 02502 // Check max length of frm data 02503 if (impl.m_frm.length() > MAX_FRM_DATA_SIZE){ 02504 m_error.code= 1229; 02505 NdbMem_Free((void*)tmpTab); 02506 DBUG_RETURN(-1); 02507 } 02508 /* 02509 TODO RONM: This needs to change to dynamic arrays instead 02510 Frm Data, FragmentData, TablespaceData, RangeListData, TsNameData 02511 */ 02512 tmpTab->FrmLen = impl.m_frm.length(); 02513 memcpy(tmpTab->FrmData, impl.m_frm.get_data(), impl.m_frm.length()); 02514 02515 tmpTab->FragmentDataLen = impl.m_fd.length(); 02516 memcpy(tmpTab->FragmentData, impl.m_fd.get_data(), impl.m_fd.length()); 02517 02518 tmpTab->TablespaceDataLen = impl.m_ts.length(); 02519 memcpy(tmpTab->TablespaceData, impl.m_ts.get_data(), impl.m_ts.length()); 02520 02521 tmpTab->RangeListDataLen = impl.m_range.length(); 02522 memcpy(tmpTab->RangeListData, impl.m_range.get_data(), 02523 impl.m_range.length()); 02524 02525 memcpy(ts_names, impl.m_ts_name.get_data(), 02526 impl.m_ts_name.length()); 02527 02528 tmpTab->FragmentCount= impl.m_fragmentCount; 02529 tmpTab->TableLoggedFlag = impl.m_logging; 02530 tmpTab->RowGCIFlag = impl.m_row_gci; 02531 tmpTab->RowChecksumFlag = impl.m_row_checksum; 02532 tmpTab->TableKValue = impl.m_kvalue; 02533 tmpTab->MinLoadFactor = impl.m_minLoadFactor; 02534 tmpTab->MaxLoadFactor = impl.m_maxLoadFactor; 02535 tmpTab->TableType = DictTabInfo::UserTable; 02536 tmpTab->PrimaryTableId = impl.m_primaryTableId; 02537 tmpTab->NoOfAttributes = sz; 02538 tmpTab->MaxRowsHigh = (Uint32)(impl.m_max_rows >> 32); 02539 tmpTab->MaxRowsLow = (Uint32)(impl.m_max_rows & 0xFFFFFFFF); 02540 tmpTab->MinRowsHigh = (Uint32)(impl.m_min_rows >> 32); 02541 tmpTab->MinRowsLow = (Uint32)(impl.m_min_rows & 0xFFFFFFFF); 02542 tmpTab->DefaultNoPartFlag = impl.m_default_no_part_flag; 02543 tmpTab->LinearHashFlag = impl.m_linear_flag; 02544 02545 if (impl.m_ts_name.length()) 02546 { 02547 char **ts_name_ptr= (char**)ts_names; 02548 i= 0; 02549 do 02550 { 02551 NdbTablespaceImpl tmp; 02552 if (*ts_name_ptr) 02553 { 02554 if(get_filegroup(tmp, NdbDictionary::Object::Tablespace, 02555 (const char*)*ts_name_ptr) == 0) 02556 { 02557 tmpTab->TablespaceData[2*i] = tmp.m_id; 02558 tmpTab->TablespaceData[2*i + 1] = tmp.m_version; 02559 } 02560 else 02561 { 02562 NdbMem_Free((void*)tmpTab); 02563 DBUG_RETURN(-1); 02564 } 02565 } 02566 else 02567 { 02568 /* 02569 No tablespace used, set tablespace id to NULL 02570 */ 02571 tmpTab->TablespaceData[2*i] = RNIL; 02572 tmpTab->TablespaceData[2*i + 1] = 0; 02573 } 02574 ts_name_ptr++; 02575 } while (++i < tmpTab->FragmentCount); 02576 tmpTab->TablespaceDataLen= 4*i; 02577 } 02578 02579 tmpTab->FragmentType = getKernelConstant(impl.m_fragmentType, 02580 fragmentTypeMapping, 02581 DictTabInfo::AllNodesSmallTable); 02582 tmpTab->TableVersion = rand(); 02583 02584 const char *tablespace_name= impl.m_tablespace_name.c_str(); 02585 loop: 02586 if(impl.m_tablespace_id != ~(Uint32)0) 02587 { 02588 tmpTab->TablespaceId = impl.m_tablespace_id; 02589 tmpTab->TablespaceVersion = impl.m_tablespace_version; 02590 } 02591 else if(strlen(tablespace_name)) 02592 { 02593 NdbTablespaceImpl tmp; 02594 if(get_filegroup(tmp, NdbDictionary::Object::Tablespace, 02595 tablespace_name) == 0) 02596 { 02597 tmpTab->TablespaceId = tmp.m_id; 02598 tmpTab->TablespaceVersion = tmp.m_version; 02599 } 02600 else 02601 { 02602 // error set by get filegroup 02603 NdbMem_Free((void*)tmpTab); 02604 DBUG_RETURN(-1); 02605 } 02606 } 02607 else 02608 { 02609 for(i = 0; i<sz; i++) 02610 { 02611 if(impl.m_columns[i]->m_storageType == NDB_STORAGETYPE_DISK) 02612 { 02613 tablespace_name = "DEFAULT-TS"; 02614 goto loop; 02615 } 02616 } 02617 } 02618 02619 UtilBufferWriter w(m_buffer); 02620 SimpleProperties::UnpackStatus s; 02621 s = SimpleProperties::pack(w, 02622 tmpTab, 02623 DictTabInfo::TableMapping, 02624 DictTabInfo::TableMappingSize, true); 02625 02626 if(s != SimpleProperties::Eof){ 02627 abort(); 02628 } 02629 NdbMem_Free((void*)tmpTab); 02630 02631 DBUG_PRINT("info",("impl.m_noOfDistributionKeys: %d impl.m_noOfKeys: %d distKeys: %d", 02632 impl.m_noOfDistributionKeys, impl.m_noOfKeys, distKeys)); 02633 if (distKeys == impl.m_noOfKeys) 02634 distKeys= 0; 02635 impl.m_noOfDistributionKeys= distKeys; 02636 02637 for(i = 0; i<sz; i++){ 02638 const NdbColumnImpl * col = impl.m_columns[i]; 02639 if(col == 0) 02640 continue; 02641 02642 DBUG_PRINT("info",("column: %s(%d) col->m_distributionKey: %d", 02643 col->m_name.c_str(), i, col->m_distributionKey)); 02644 DictTabInfo::Attribute tmpAttr; tmpAttr.init(); 02645 BaseString::snprintf(tmpAttr.AttributeName, sizeof(tmpAttr.AttributeName), 02646 col->m_name.c_str()); 02647 tmpAttr.AttributeId = col->m_attrId; 02648 tmpAttr.AttributeKeyFlag = col->m_pk; 02649 tmpAttr.AttributeNullableFlag = col->m_nullable; 02650 tmpAttr.AttributeDKey = distKeys ? (bool)col->m_distributionKey : 0; 02651 02652 tmpAttr.AttributeExtType = (Uint32)col->m_type; 02653 tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF); 02654 tmpAttr.AttributeExtScale = col->m_scale; 02655 tmpAttr.AttributeExtLength = col->m_length; 02656 if(col->m_storageType == NDB_STORAGETYPE_DISK) 02657 tmpAttr.AttributeArrayType = NDB_ARRAYTYPE_FIXED; 02658 else 02659 tmpAttr.AttributeArrayType = col->m_arrayType; 02660 02661 if(col->m_pk) 02662 tmpAttr.AttributeStorageType = NDB_STORAGETYPE_MEMORY; 02663 else 02664 tmpAttr.AttributeStorageType = col->m_storageType; 02665 02666 if(col->getBlobType()) 02667 tmpAttr.AttributeStorageType = NDB_STORAGETYPE_MEMORY; 02668 02669 // check type and compute attribute size and array size 02670 if (! tmpAttr.translateExtType()) { 02671 m_error.code= 703; 02672 DBUG_RETURN(-1); 02673 } 02674 // charset is defined exactly for char types 02675 if (col->getCharType() != (col->m_cs != NULL)) { 02676 m_error.code= 703; 02677 DBUG_RETURN(-1); 02678 } 02679 // primary key type check 02680 if (col->m_pk && 02681 (err = NdbSqlUtil::check_column_for_pk(col->m_type, col->m_cs))) 02682 { 02683 m_error.code= err; 02684 DBUG_RETURN(-1); 02685 } 02686 // distribution key not supported for Char attribute 02687 if (distKeys && col->m_distributionKey && col->m_cs != NULL) { 02688 // we can allow this for non-var char where strxfrm does nothing 02689 if (col->m_type == NdbDictionary::Column::Char && 02690 (col->m_cs->state & MY_CS_BINSORT)) 02691 ; 02692 else { 02693 m_error.code= 745; 02694 DBUG_RETURN(-1); 02695 } 02696 } 02697 // charset in upper half of precision 02698 if (col->getCharType()) { 02699 tmpAttr.AttributeExtPrecision |= (col->m_cs->number << 16); 02700 } 02701 02702 tmpAttr.AttributeAutoIncrement = col->m_autoIncrement; 02703 BaseString::snprintf(tmpAttr.AttributeDefaultValue, 02704 sizeof(tmpAttr.AttributeDefaultValue), 02705 col->m_defaultValue.c_str()); 02706 s = SimpleProperties::pack(w, 02707 &tmpAttr, 02708 DictTabInfo::AttributeMapping, 02709 DictTabInfo::AttributeMappingSize, true); 02710 w.add(DictTabInfo::AttributeEnd, 1); 02711 } 02712 02713 int ret; 02714 02715 LinearSectionPtr ptr[1]; 02716 ptr[0].p = (Uint32*)m_buffer.get_data(); 02717 ptr[0].sz = m_buffer.length() / 4; 02718 NdbApiSignal tSignal(m_reference); 02719 tSignal.theReceiversBlockNumber = DBDICT; 02720 if (alter) { 02721 tSignal.theVerId_signalNumber = GSN_ALTER_TABLE_REQ; 02722 tSignal.theLength = AlterTableReq::SignalLength; 02723 02724 AlterTableReq * req = CAST_PTR(AlterTableReq, tSignal.getDataPtrSend()); 02725 02726 req->senderRef = m_reference; 02727 req->senderData = 0; 02728 req->changeMask = impl.m_changeMask; 02729 req->tableId = impl.m_id; 02730 req->tableVersion = impl.m_version;; 02731 02732 int errCodes[] = { AlterTableRef::NotMaster, AlterTableRef::Busy, 0 }; 02733 ret = dictSignal(&tSignal, ptr, 1, 02734 0, // master 02735 WAIT_ALTER_TAB_REQ, 02736 DICT_WAITFOR_TIMEOUT, 100, 02737 errCodes); 02738 02739 if(m_error.code == AlterTableRef::InvalidTableVersion) { 02740 // Clear caches and try again 02741 DBUG_RETURN(INCOMPATIBLE_VERSION); 02742 } 02743 } else { 02744 tSignal.theVerId_signalNumber = GSN_CREATE_TABLE_REQ; 02745 tSignal.theLength = CreateTableReq::SignalLength; 02746 02747 CreateTableReq * req = CAST_PTR(CreateTableReq, tSignal.getDataPtrSend()); 02748 req->senderRef = m_reference; 02749 req->senderData = 0; 02750 int errCodes[] = { CreateTableRef::Busy, CreateTableRef::NotMaster, 0 }; 02751 ret = dictSignal(&tSignal, ptr, 1, 02752 0, // master node 02753 WAIT_CREATE_INDX_REQ, 02754 DICT_WAITFOR_TIMEOUT, 100, 02755 errCodes); 02756 } 02757 02758 DBUG_RETURN(ret); 02759 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::createTable | ( | class Ndb & | ndb, | |
| NdbTableImpl & | ||||
| ) |
Definition at line 2319 of file NdbDictionaryImpl.cpp.
References createOrAlterTable(), DBUG_ENTER, DBUG_RETURN, and ndb.
Referenced by NdbDictionaryImpl::createTable().
02321 { 02322 DBUG_ENTER("NdbDictInterface::createTable"); 02323 DBUG_RETURN(createOrAlterTable(ndb, impl, false)); 02324 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::dictSignal | ( | NdbApiSignal * | signal, | |
| LinearSectionPtr | ptr[3], | |||
| int | secs, | |||
| int | nodeId, | |||
| WaitSignalType | wst, | |||
| int | timeout, | |||
| Uint32 | RETRIES, | |||
| const int * | errcodes = 0, |
|||
| int | temporaryMask = 0 | |||
| ) |
Definition at line 1704 of file NdbDictionaryImpl.cpp.
References UtilBuffer::clear(), NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, TransporterFacade::get_an_alive_node(), TransporterFacade::get_node_alive(), getNdbError(), m_buffer, m_error, m_masterNodeId, m_reference, NdbWaiter::m_state, m_transporter, m_waiter, refToBlock(), TransporterFacade::sendFragmentedSignal(), TransporterFacade::sendSignal(), sig(), NdbError::TemporaryError, PollGuard::wait_n_unlock(), and WST_WAIT_TIMEOUT.
Referenced by create_file(), create_filegroup(), createEvent(), createIndex(), drop_file(), drop_filegroup(), dropEvent(), dropIndex(), dropTable(), executeSubscribeEvent(), get_file(), get_filegroup(), getTable(), and stopSubscribeEvent().
01710 { 01711 DBUG_ENTER("NdbDictInterface::dictSignal"); 01712 DBUG_PRINT("enter", ("useMasterNodeId: %d", node_specification)); 01713 for(Uint32 i = 0; i<RETRIES; i++){ 01714 m_buffer.clear(); 01715 01716 // Protected area 01717 /* 01718 The PollGuard has an implicit call of unlock_and_signal through the 01719 ~PollGuard method. This method is called implicitly by the compiler 01720 in all places where the object is out of context due to a return, 01721 break, continue or simply end of statement block 01722 */ 01723 PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference)); 01724 Uint32 node; 01725 switch(node_specification){ 01726 case 0: 01727 node = (m_transporter->get_node_alive(m_masterNodeId) ? m_masterNodeId : 01728 (m_masterNodeId = m_transporter->get_an_alive_node())); 01729 break; 01730 case -1: 01731 node = m_transporter->get_an_alive_node(); 01732 break; 01733 default: 01734 node = node_specification; 01735 } 01736 DBUG_PRINT("info", ("node %d", node)); 01737 if(node == 0){ 01738 m_error.code= 4009; 01739 DBUG_RETURN(-1); 01740 } 01741 int res = (ptr ? 01742 m_transporter->sendFragmentedSignal(sig, node, ptr, secs): 01743 m_transporter->sendSignal(sig, node)); 01744 if(res != 0){ 01745 DBUG_PRINT("info", ("dictSignal failed to send signal")); 01746 continue; 01747 } 01748 01749 m_error.code= 0; 01750 int ret_val= poll_guard.wait_n_unlock(timeout, node, wst); 01751 // End of Protected area 01752 01753 if(ret_val == 0 && m_error.code == 0){ 01754 // Normal return 01755 DBUG_RETURN(0); 01756 } 01757 01761 if(ret_val == -2) //WAIT_NODE_FAILURE 01762 { 01763 continue; 01764 } 01765 if(m_waiter.m_state == WST_WAIT_TIMEOUT) 01766 { 01767 DBUG_PRINT("info", ("dictSignal caught time-out")); 01768 m_error.code = 4008; 01769 DBUG_RETURN(-1); 01770 } 01771 01772 if ( temporaryMask == -1) 01773 { 01774 const NdbError &error= getNdbError(); 01775 if (error.status == NdbError::TemporaryError) 01776 continue; 01777 } 01778 else if ( (temporaryMask & m_error.code) != 0 ) { 01779 continue; 01780 } 01781 DBUG_PRINT("info", ("dictSignal caught error= %d", m_error.code)); 01782 01783 if(m_error.code && errcodes) 01784 { 01785 int j; 01786 for(j = 0; errcodes[j] ; j++){ 01787 if(m_error.code == errcodes[j]){ 01788 break; 01789 } 01790 } 01791 if(errcodes[j]) // Accepted error code 01792 continue; 01793 } 01794 break; 01795 } 01796 DBUG_RETURN(-1); 01797 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::drop_file | ( | const NdbFileImpl & | ) |
Definition at line 4582 of file NdbDictionaryImpl.cpp.
References DropFileRef::Busy, CAST_PTR, DBDICT, DBUG_ENTER, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), err, DropFileReq::file_id, DropFileReq::file_version, NdbApiSignal::getDataPtrSend(), GSN_DROP_FILE_REQ, NdbDictObjectImpl::m_id, m_reference, NdbDictObjectImpl::m_version, DropFileRef::NotMaster, DropFileReq::senderData, DropFileReq::senderRef, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::dropDatafile(), and NdbDictionaryImpl::dropUndofile().
04583 { 04584 DBUG_ENTER("NdbDictInterface::drop_file"); 04585 NdbApiSignal tSignal(m_reference); 04586 tSignal.theReceiversBlockNumber = DBDICT; 04587 tSignal.theVerId_signalNumber = GSN_DROP_FILE_REQ; 04588 tSignal.theLength = DropFileReq::SignalLength; 04589 04590 DropFileReq* req = CAST_PTR(DropFileReq, tSignal.getDataPtrSend()); 04591 req->senderRef = m_reference; 04592 req->senderData = 0; 04593 req->file_id = file.m_id; 04594 req->file_version = file.m_version; 04595 04596 int err[] = { DropFileRef::Busy, DropFileRef::NotMaster, 0}; 04597 DBUG_RETURN(dictSignal(&tSignal, 0, 0, 04598 0, // master 04599 WAIT_CREATE_INDX_REQ, 04600 DICT_WAITFOR_TIMEOUT, 100, 04601 err)); 04602 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::drop_filegroup | ( | const NdbFilegroupImpl & | ) |
Definition at line 4735 of file NdbDictionaryImpl.cpp.
References DropFilegroupRef::Busy, CAST_PTR, DBDICT, DBUG_ENTER, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), err, DropFilegroupReq::filegroup_id, DropFilegroupReq::filegroup_version, NdbApiSignal::getDataPtrSend(), GSN_DROP_FILEGROUP_REQ, NdbDictObjectImpl::m_id, m_reference, NdbDictObjectImpl::m_version, DropFilegroupRef::NotMaster, DropFilegroupReq::senderData, DropFilegroupReq::senderRef, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::dropLogfileGroup(), and NdbDictionaryImpl::dropTablespace().
04736 { 04737 DBUG_ENTER("NdbDictInterface::drop_filegroup"); 04738 NdbApiSignal tSignal(m_reference); 04739 tSignal.theReceiversBlockNumber = DBDICT; 04740 tSignal.theVerId_signalNumber = GSN_DROP_FILEGROUP_REQ; 04741 tSignal.theLength = DropFilegroupReq::SignalLength; 04742 04743 DropFilegroupReq* req = CAST_PTR(DropFilegroupReq, tSignal.getDataPtrSend()); 04744 req->senderRef = m_reference; 04745 req->senderData = 0; 04746 req->filegroup_id = group.m_id; 04747 req->filegroup_version = group.m_version; 04748 04749 int err[] = { DropFilegroupRef::Busy, DropFilegroupRef::NotMaster, 0}; 04750 DBUG_RETURN(dictSignal(&tSignal, 0, 0, 04751 0, // master 04752 WAIT_CREATE_INDX_REQ, 04753 DICT_WAITFOR_TIMEOUT, 100, 04754 err)); 04755 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::dropEvent | ( | NdbApiSignal * | signal, | |
| LinearSectionPtr | ptr[3], | |||
| int | noLSP | |||
| ) |
| int NdbDictInterface::dropEvent | ( | const NdbEventImpl & | ) |
Definition at line 3988 of file NdbDictionaryImpl.cpp.
References SimpleProperties::Writer::add(), BaseString::c_str(), CAST_PTR, DBDICT, dictSignal(), UtilBuffer::get_data(), NdbApiSignal::getDataPtrSend(), GSN_DROP_EVNT_REQ, UtilBuffer::length(), m_buffer, NdbEventImpl::m_name, m_reference, LinearSectionPtr::p, DropEvntReq::setUserData(), DropEvntReq::setUserRef(), SimpleProperties::StringValue, LinearSectionPtr::sz, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::dropBlobEvents(), and NdbDictionaryImpl::dropEvent().
03989 { 03990 NdbApiSignal tSignal(m_reference); 03991 tSignal.theReceiversBlockNumber = DBDICT; 03992 tSignal.theVerId_signalNumber = GSN_DROP_EVNT_REQ; 03993 tSignal.theLength = DropEvntReq::SignalLength; 03994 03995 DropEvntReq * const req = CAST_PTR(DropEvntReq, tSignal.getDataPtrSend()); 03996 03997 req->setUserRef(m_reference); 03998 req->setUserData(0); 03999 04000 UtilBufferWriter w(m_buffer); 04001 04002 w.add(SimpleProperties::StringValue, evnt.m_name.c_str()); 04003 04004 LinearSectionPtr ptr[1]; 04005 ptr[0].p = (Uint32*)m_buffer.get_data(); 04006 ptr[0].sz = (m_buffer.length()+3) >> 2; 04007 04008 return dictSignal(&tSignal,ptr, 1, 04009 0 /*use masternode id*/, 04010 WAIT_CREATE_INDX_REQ, 04011 -1, 100, 04012 0, -1); 04013 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::dropIndex | ( | const NdbIndexImpl & | , | |
| const NdbTableImpl & | ||||
| ) |
Definition at line 3301 of file NdbDictionaryImpl.cpp.
References DropIndxRef::Busy, CAST_PTR, NdbError::code, DBDICT, DBUG_ENTER, DBUG_PRINT, DICT_WAITFOR_TIMEOUT, dictSignal(), ERR_RETURN, NdbApiSignal::getDataPtrSend(), GSN_DROP_INDX_REQ, INCOMPATIBLE_VERSION, DropIndxRef::InvalidIndexVersion, m_error, NdbDictObjectImpl::m_id, m_reference, NdbDictObjectImpl::m_version, DropIndxRef::NotMaster, DropIndxReq::RT_USER, DropIndxReq::setConnectionPtr(), DropIndxReq::setIndexId(), DropIndxReq::setIndexVersion(), DropIndxReq::setRequestType(), DropIndxReq::setTableId(), DropIndxReq::setUserRef(), SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_DROP_INDX_REQ.
Referenced by NdbDictionaryImpl::dropIndexGlobal().
03303 { 03304 DBUG_ENTER("NdbDictInterface::dropIndex"); 03305 DBUG_PRINT("enter", ("indexId: %d indexVersion: %d", 03306 timpl.m_id, timpl.m_version)); 03307 NdbApiSignal tSignal(m_reference); 03308 tSignal.theReceiversBlockNumber = DBDICT; 03309 tSignal.theVerId_signalNumber = GSN_DROP_INDX_REQ; 03310 tSignal.theLength = DropIndxReq::SignalLength; 03311 03312 DropIndxReq * const req = CAST_PTR(DropIndxReq, tSignal.getDataPtrSend()); 03313 req->setUserRef(m_reference); 03314 req->setConnectionPtr(0); 03315 req->setRequestType(DropIndxReq::RT_USER); 03316 req->setTableId(~0); // DICT overwrites 03317 req->setIndexId(timpl.m_id); 03318 req->setIndexVersion(timpl.m_version); 03319 03320 int errCodes[] = { DropIndxRef::Busy, DropIndxRef::NotMaster, 0 }; 03321 int r = dictSignal(&tSignal, 0, 0, 03322 0, // master 03323 WAIT_DROP_INDX_REQ, 03324 DICT_WAITFOR_TIMEOUT, 100, 03325 errCodes); 03326 if(m_error.code == DropIndxRef::InvalidIndexVersion) { 03327 // Clear caches and try again 03328 ERR_RETURN(m_error, INCOMPATIBLE_VERSION); 03329 } 03330 ERR_RETURN(m_error, r); 03331 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::dropTable | ( | const NdbTableImpl & | ) |
Definition at line 2951 of file NdbDictionaryImpl.cpp.
References DropTableRef::Busy, CAST_PTR, NdbError::code, DBDICT, DICT_WAITFOR_TIMEOUT, dictSignal(), NdbApiSignal::getDataPtrSend(), GSN_DROP_TABLE_REQ, INCOMPATIBLE_VERSION, DropTableRef::InvalidTableVersion, m_error, NdbDictObjectImpl::m_id, m_reference, NdbDictObjectImpl::m_version, DropTableRef::NoDropTableRecordAvailable, DropTableRef::NotMaster, DropTableReq::senderData, DropTableReq::senderRef, DropTableReq::tableId, DropTableReq::tableVersion, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_DROP_TAB_REQ.
Referenced by NdbDictionaryImpl::dropBlobTables(), and NdbDictionaryImpl::dropTableGlobal().
02952 { 02953 NdbApiSignal tSignal(m_reference); 02954 tSignal.theReceiversBlockNumber = DBDICT; 02955 tSignal.theVerId_signalNumber = GSN_DROP_TABLE_REQ; 02956 tSignal.theLength = DropTableReq::SignalLength; 02957 02958 DropTableReq * req = CAST_PTR(DropTableReq, tSignal.getDataPtrSend()); 02959 req->senderRef = m_reference; 02960 req->senderData = 0; 02961 req->tableId = impl.m_id; 02962 req->tableVersion = impl.m_version; 02963 02964 int errCodes[] = 02965 { DropTableRef::NoDropTableRecordAvailable, 02966 DropTableRef::NotMaster, 02967 DropTableRef::Busy, 0 }; 02968 int r = dictSignal(&tSignal, 0, 0, 02969 0, // master 02970 WAIT_DROP_TAB_REQ, 02971 DICT_WAITFOR_TIMEOUT, 100, 02972 errCodes); 02973 if(m_error.code == DropTableRef::InvalidTableVersion) { 02974 // Clear caches and try again 02975 return INCOMPATIBLE_VERSION; 02976 } 02977 return r; 02978 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execALTER_TABLE_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2785 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execALTER_TABLE_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2792 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, AlterTableRef::errorCode, m_error, m_masterNodeId, m_waiter, AlterTableRef::masterNodeId, NO_WAIT, sig(), and NdbWaiter::signal().
Referenced by execSignal().
02794 { 02795 const AlterTableRef * ref = CAST_CONSTPTR(AlterTableRef, sig->getDataPtr()); 02796 m_error.code= ref->errorCode; 02797 m_masterNodeId = ref->masterNodeId; 02798 m_waiter.signal(NO_WAIT); 02799 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_EVNT_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3783 of file NdbDictionaryImpl.cpp.
References UtilBuffer::append(), CAST_CONSTPTR, UtilBuffer::clear(), DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbApiSignal::getDataPtr(), CreateEvntConf::getEventId(), CreateEvntConf::getEventKey(), NdbApiSignal::getLength(), m_buffer, SignalHeader::m_noOfSections, m_waiter, NO_WAIT, p, refToNode(), NdbWaiter::signal(), strlen(), and SignalHeader::theSendersBlockRef.
Referenced by execSignal().
03785 { 03786 DBUG_ENTER("NdbDictInterface::execCREATE_EVNT_CONF"); 03787 03788 m_buffer.clear(); 03789 unsigned int len = signal->getLength() << 2; 03790 m_buffer.append((char *)&len, sizeof(len)); 03791 m_buffer.append(signal->getDataPtr(), len); 03792 03793 if (signal->m_noOfSections > 0) { 03794 m_buffer.append((char *)ptr[0].p, strlen((char *)ptr[0].p)+1); 03795 } 03796 03797 const CreateEvntConf * const createEvntConf= 03798 CAST_CONSTPTR(CreateEvntConf, signal->getDataPtr()); 03799 03800 Uint32 subscriptionId = createEvntConf->getEventId(); 03801 Uint32 subscriptionKey = createEvntConf->getEventKey(); 03802 03803 DBUG_PRINT("info",("nodeid=%d,subscriptionId=%d,subscriptionKey=%d", 03804 refToNode(signal->theSendersBlockRef), 03805 subscriptionId,subscriptionKey)); 03806 m_waiter.signal(NO_WAIT); 03807 DBUG_VOID_RETURN; 03808 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_EVNT_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3811 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbApiSignal::getDataPtr(), CreateEvntRef::getErrorCode(), CreateEvntRef::getErrorLine(), CreateEvntRef::getErrorNode(), CreateEvntRef::getMasterNode(), m_error, m_masterNodeId, m_waiter, NO_WAIT, CreateEvntRef::NotMaster, and NdbWaiter::signal().
Referenced by execSignal().
03813 { 03814 DBUG_ENTER("NdbDictInterface::execCREATE_EVNT_REF"); 03815 03816 const CreateEvntRef* const ref= 03817 CAST_CONSTPTR(CreateEvntRef, signal->getDataPtr()); 03818 m_error.code= ref->getErrorCode(); 03819 DBUG_PRINT("error",("error=%d,line=%d,node=%d",ref->getErrorCode(), 03820 ref->getErrorLine(),ref->getErrorNode())); 03821 if (m_error.code == CreateEvntRef::NotMaster) 03822 m_masterNodeId = ref->getMasterNode(); 03823 m_waiter.signal(NO_WAIT); 03824 DBUG_VOID_RETURN; 03825 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_FILE_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4557 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, data, CreateFileConf::fileId, CreateFileConf::fileVersion, UtilBuffer::get_data(), NdbApiSignal::getDataPtr(), UtilBuffer::grow(), m_buffer, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04559 { 04560 const CreateFileConf* conf= 04561 CAST_CONSTPTR(CreateFileConf, signal->getDataPtr()); 04562 m_buffer.grow(4 * 2); // 2 words 04563 Uint32* data = (Uint32*)m_buffer.get_data(); 04564 data[0] = conf->fileId; 04565 data[1] = conf->fileVersion; 04566 04567 m_waiter.signal(NO_WAIT); 04568 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_FILE_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4571 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, CreateFileRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_masterNodeId, m_waiter, CreateFileRef::masterNodeId, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04573 { 04574 const CreateFileRef* ref = 04575 CAST_CONSTPTR(CreateFileRef, signal->getDataPtr()); 04576 m_error.code = ref->errorCode; 04577 m_masterNodeId = ref->masterNodeId; 04578 m_waiter.signal(NO_WAIT); 04579 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_FILEGROUP_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4711 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, data, CreateFilegroupConf::filegroupId, CreateFilegroupConf::filegroupVersion, UtilBuffer::get_data(), NdbApiSignal::getDataPtr(), UtilBuffer::grow(), m_buffer, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04713 { 04714 const CreateFilegroupConf* conf= 04715 CAST_CONSTPTR(CreateFilegroupConf, signal->getDataPtr()); 04716 m_buffer.grow(4 * 2); // 2 words 04717 Uint32* data = (Uint32*)m_buffer.get_data(); 04718 data[0] = conf->filegroupId; 04719 data[1] = conf->filegroupVersion; 04720 m_waiter.signal(NO_WAIT); 04721 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_FILEGROUP_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4724 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, CreateFilegroupRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_masterNodeId, m_waiter, CreateFilegroupRef::masterNodeId, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04726 { 04727 const CreateFilegroupRef* ref = 04728 CAST_CONSTPTR(CreateFilegroupRef, signal->getDataPtr()); 04729 m_error.code = ref->errorCode; 04730 m_masterNodeId = ref->masterNodeId; 04731 m_waiter.signal(NO_WAIT); 04732 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_INDX_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3200 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_INDX_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3207 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, CreateIndxRef::getErrorCode(), m_error, m_masterNodeId, m_waiter, CreateIndxRef::masterNodeId, NO_WAIT, CreateIndxRef::NotMaster, sig(), and NdbWaiter::signal().
Referenced by execSignal().
03209 { 03210 const CreateIndxRef* ref = CAST_CONSTPTR(CreateIndxRef, sig->getDataPtr()); 03211 m_error.code = ref->getErrorCode(); 03212 if(m_error.code == ref->NotMaster) 03213 m_masterNodeId= ref->masterNodeId; 03214 m_waiter.signal(NO_WAIT); 03215 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_TABLE_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2762 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, data, UtilBuffer::get_data(), NdbApiSignal::getDataPtr(), UtilBuffer::grow(), m_buffer, m_waiter, NO_WAIT, NdbWaiter::signal(), CreateTableConf::tableId, and CreateTableConf::tableVersion.
Referenced by execSignal().
02764 { 02765 const CreateTableConf* const conf= 02766 CAST_CONSTPTR(CreateTableConf, signal->getDataPtr()); 02767 m_buffer.grow(4 * 2); // 2 words 02768 Uint32* data = (Uint32*)m_buffer.get_data(); 02769 data[0] = conf->tableId; 02770 data[1] = conf->tableVersion; 02771 m_waiter.signal(NO_WAIT); 02772 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execCREATE_TABLE_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2775 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, CreateTableRef::errorCode, m_error, m_masterNodeId, m_waiter, CreateTableRef::masterNodeId, NO_WAIT, sig(), and NdbWaiter::signal().
Referenced by execSignal().
02777 { 02778 const CreateTableRef* ref = CAST_CONSTPTR(CreateTableRef, sig->getDataPtr()); 02779 m_error.code= ref->errorCode; 02780 m_masterNodeId = ref->masterNodeId; 02781 m_waiter.signal(NO_WAIT); 02782 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_EVNT_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4016 of file NdbDictionaryImpl.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04018 { 04019 DBUG_ENTER("NdbDictInterface::execDROP_EVNT_CONF"); 04020 m_waiter.signal(NO_WAIT); 04021 DBUG_VOID_RETURN; 04022 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_EVNT_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4025 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbApiSignal::getDataPtr(), DropEvntRef::getErrorCode(), DropEvntRef::getErrorLine(), DropEvntRef::getErrorNode(), DropEvntRef::getMasterNode(), m_error, m_masterNodeId, m_waiter, NO_WAIT, DropEvntRef::NotMaster, and NdbWaiter::signal().
Referenced by execSignal().
04027 { 04028 DBUG_ENTER("NdbDictInterface::execDROP_EVNT_REF"); 04029 const DropEvntRef* const ref= 04030 CAST_CONSTPTR(DropEvntRef, signal->getDataPtr()); 04031 m_error.code= ref->getErrorCode(); 04032 04033 DBUG_PRINT("info",("ErrorCode=%u Errorline=%u ErrorNode=%u", 04034 ref->getErrorCode(), ref->getErrorLine(), ref->getErrorNode())); 04035 if (m_error.code == DropEvntRef::NotMaster) 04036 m_masterNodeId = ref->getMasterNode(); 04037 m_waiter.signal(NO_WAIT); 04038 DBUG_VOID_RETURN; 04039 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_FILE_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4605 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_FILE_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4612 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DropFileRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_masterNodeId, m_waiter, DropFileRef::masterNodeId, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04614 { 04615 const DropFileRef* ref = 04616 CAST_CONSTPTR(DropFileRef, signal->getDataPtr()); 04617 m_error.code = ref->errorCode; 04618 m_masterNodeId = ref->masterNodeId; 04619 m_waiter.signal(NO_WAIT); 04620 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_FILEGROUP_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4758 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_FILEGROUP_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4765 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DropFilegroupRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_masterNodeId, m_waiter, DropFilegroupRef::masterNodeId, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04767 { 04768 const DropFilegroupRef* ref = 04769 CAST_CONSTPTR(DropFilegroupRef, signal->getDataPtr()); 04770 m_error.code = ref->errorCode; 04771 m_masterNodeId = ref->masterNodeId; 04772 m_waiter.signal(NO_WAIT); 04773 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_INDX_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3334 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_INDX_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3341 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, NdbApiSignal::getDataPtr(), DropIndxRef::getErrorCode(), m_error, m_masterNodeId, m_waiter, DropIndxRef::masterNodeId, NO_WAIT, DropIndxRef::NotMaster, and NdbWaiter::signal().
Referenced by execSignal().
03343 { 03344 const DropIndxRef* ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr()); 03345 m_error.code = ref->getErrorCode(); 03346 if(m_error.code == ref->NotMaster) 03347 m_masterNodeId= ref->masterNodeId; 03348 m_waiter.signal(NO_WAIT); 03349 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_TABLE_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2981 of file NdbDictionaryImpl.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
02983 { 02984 DBUG_ENTER("NdbDictInterface::execDROP_TABLE_CONF"); 02985 //DropTableConf* const conf = CAST_CONSTPTR(DropTableConf, signal->getDataPtr()); 02986 02987 m_waiter.signal(NO_WAIT); 02988 DBUG_VOID_RETURN; 02989 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execDROP_TABLE_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 2992 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_VOID_RETURN, DropTableRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_masterNodeId, m_waiter, DropTableRef::masterNodeId, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
02994 { 02995 DBUG_ENTER("NdbDictInterface::execDROP_TABLE_REF"); 02996 const DropTableRef* ref = CAST_CONSTPTR(DropTableRef, signal->getDataPtr()); 02997 m_error.code= ref->errorCode; 02998 m_masterNodeId = ref->masterNodeId; 02999 m_waiter.signal(NO_WAIT); 03000 DBUG_VOID_RETURN; 03001 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execGET_TABINFO_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 1893 of file NdbDictionaryImpl.cpp.
References abort(), UtilBuffer::append(), CAST_CONSTPTR, NdbApiSignal::getDataPtr(), NdbApiSignal::getFragmentId(), UtilBuffer::grow(), NdbApiSignal::isFirstFragment(), NdbApiSignal::isLastFragment(), m_buffer, m_fragmentId, m_waiter, NO_WAIT, p, NdbWaiter::signal(), and GetTabInfoConf::totalLen.
Referenced by execSignal().
01895 { 01896 const GetTabInfoConf* conf = CAST_CONSTPTR(GetTabInfoConf, signal->getDataPtr()); 01897 if(signal->isFirstFragment()){ 01898 m_fragmentId = signal->getFragmentId(); 01899 m_buffer.grow(4 * conf->totalLen); 01900 } else { 01901 if(m_fragmentId != signal->getFragmentId()){ 01902 abort(); 01903 } 01904 } 01905 01906 const Uint32 i = GetTabInfoConf::DICT_TAB_INFO; 01907 m_buffer.append(ptr[i].p, 4 * ptr[i].sz); 01908 01909 if(!signal->isLastFragment()){ 01910 return; 01911 } 01912 01913 m_waiter.signal(NO_WAIT); 01914 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execGET_TABINFO_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 1917 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, GetTabInfoRef::errorCode, NdbApiSignal::getDataPtr(), m_error, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
01919 { 01920 const GetTabInfoRef* ref = CAST_CONSTPTR(GetTabInfoRef, 01921 signal->getDataPtr()); 01922 01923 m_error.code= ref->errorCode; 01924 m_waiter.signal(NO_WAIT); 01925 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execLIST_TABLES_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4195 of file NdbDictionaryImpl.cpp.
References UtilBuffer::append(), NdbApiSignal::getDataPtr(), NdbApiSignal::getLength(), m_buffer, m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04197 { 04198 const unsigned off = ListTablesConf::HeaderLength; 04199 const unsigned len = (signal->getLength() - off); 04200 m_buffer.append(signal->getDataPtr() + off, len << 2); 04201 if (signal->getLength() < ListTablesConf::SignalLength) { 04202 // last signal has less than full length 04203 m_waiter.signal(NO_WAIT); 04204 } 04205 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execNodeStatus | ( | void * | dictImpl, | |
| Uint32 | , | |||
| bool | alive, | |||
| bool | nfCompleted | |||
| ) | [static, private] |
Definition at line 1689 of file NdbDictionaryImpl.cpp.
References m_waiter, and NdbWaiter::nodeFail().
Referenced by Ndb::statusMessage().
01691 { 01692 NdbDictInterface * tmp = (NdbDictInterface*)dictImpl; 01693 01694 if(!alive && !nfCompleted){ 01695 return; 01696 } 01697 01698 if (!alive && nfCompleted){ 01699 tmp->m_waiter.nodeFail(aNode); 01700 } 01701 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execSignal | ( | void * | dictImpl, | |
| class NdbApiSignal * | signal, | |||
| struct LinearSectionPtr | ptr[3] | |||
| ) | [static, private] |
Definition at line 1582 of file NdbDictionaryImpl.cpp.
References abort(), execALTER_TABLE_CONF(), execALTER_TABLE_REF(), execCREATE_EVNT_CONF(), execCREATE_EVNT_REF(), execCREATE_FILE_CONF(), execCREATE_FILE_REF(), execCREATE_FILEGROUP_CONF(), execCREATE_FILEGROUP_REF(), execCREATE_INDX_CONF(), execCREATE_INDX_REF(), execCREATE_TABLE_CONF(), execCREATE_TABLE_REF(), execDROP_EVNT_CONF(), execDROP_EVNT_REF(), execDROP_FILE_CONF(), execDROP_FILE_REF(), execDROP_FILEGROUP_CONF(), execDROP_FILEGROUP_REF(), execDROP_INDX_CONF(), execDROP_INDX_REF(), execDROP_TABLE_CONF(), execDROP_TABLE_REF(), execGET_TABINFO_CONF(), execGET_TABINFO_REF(), execLIST_TABLES_CONF(), execSUB_START_CONF(), execSUB_START_REF(), execSUB_STOP_CONF(), execSUB_STOP_REF(), execWAIT_GCP_CONF(), execWAIT_GCP_REF(), GSN_ALTER_TABLE_CONF, GSN_ALTER_TABLE_REF, GSN_CREATE_EVNT_CONF, GSN_CREATE_EVNT_REF, GSN_CREATE_FILE_CONF, GSN_CREATE_FILE_REF, GSN_CREATE_FILEGROUP_CONF, GSN_CREATE_FILEGROUP_REF, GSN_CREATE_INDX_CONF, GSN_CREATE_INDX_REF, GSN_CREATE_TABLE_CONF, GSN_CREATE_TABLE_REF, GSN_DROP_EVNT_CONF, GSN_DROP_EVNT_REF, GSN_DROP_FILE_CONF, GSN_DROP_FILE_REF, GSN_DROP_FILEGROUP_CONF, GSN_DROP_FILEGROUP_REF, GSN_DROP_INDX_CONF, GSN_DROP_INDX_REF, GSN_DROP_TABLE_CONF, GSN_DROP_TABLE_REF, GSN_GET_TABINFO_CONF, GSN_GET_TABINFOREF, GSN_LIST_TABLES_CONF, GSN_SUB_START_CONF, GSN_SUB_START_REF, GSN_SUB_STOP_CONF, GSN_SUB_STOP_REF, GSN_WAIT_GCP_CONF, and GSN_WAIT_GCP_REF.
Referenced by Ndb::handleReceivedSignal().
01585 { 01586 NdbDictInterface * tmp = (NdbDictInterface*)dictImpl; 01587 01588 const Uint32 gsn = signal->readSignalNumber(); 01589 switch(gsn){ 01590 case GSN_GET_TABINFOREF: 01591 tmp->execGET_TABINFO_REF(signal, ptr); 01592 break; 01593 case GSN_GET_TABINFO_CONF: 01594 tmp->execGET_TABINFO_CONF(signal, ptr); 01595 break; 01596 case GSN_CREATE_TABLE_REF: 01597 tmp->execCREATE_TABLE_REF(signal, ptr); 01598 break; 01599 case GSN_CREATE_TABLE_CONF: 01600 tmp->execCREATE_TABLE_CONF(signal, ptr); 01601 break; 01602 case GSN_DROP_TABLE_REF: 01603 tmp->execDROP_TABLE_REF(signal, ptr); 01604 break; 01605 case GSN_DROP_TABLE_CONF: 01606 tmp->execDROP_TABLE_CONF(signal, ptr); 01607 break; 01608 case GSN_ALTER_TABLE_REF: 01609 tmp->execALTER_TABLE_REF(signal, ptr); 01610 break; 01611 case GSN_ALTER_TABLE_CONF: 01612 tmp->execALTER_TABLE_CONF(signal, ptr); 01613 break; 01614 case GSN_CREATE_INDX_REF: 01615 tmp->execCREATE_INDX_REF(signal, ptr); 01616 break; 01617 case GSN_CREATE_INDX_CONF: 01618 tmp->execCREATE_INDX_CONF(signal, ptr); 01619 break; 01620 case GSN_DROP_INDX_REF: 01621 tmp->execDROP_INDX_REF(signal, ptr); 01622 break; 01623 case GSN_DROP_INDX_CONF: 01624 tmp->execDROP_INDX_CONF(signal, ptr); 01625 break; 01626 case GSN_CREATE_EVNT_REF: 01627 tmp->execCREATE_EVNT_REF(signal, ptr); 01628 break; 01629 case GSN_CREATE_EVNT_CONF: 01630 tmp->execCREATE_EVNT_CONF(signal, ptr); 01631 break; 01632 case GSN_SUB_START_CONF: 01633 tmp->execSUB_START_CONF(signal, ptr); 01634 break; 01635 case GSN_SUB_START_REF: 01636 tmp->execSUB_START_REF(signal, ptr); 01637 break; 01638 case GSN_SUB_STOP_CONF: 01639 tmp->execSUB_STOP_CONF(signal, ptr); 01640 break; 01641 case GSN_SUB_STOP_REF: 01642 tmp->execSUB_STOP_REF(signal, ptr); 01643 break; 01644 case GSN_DROP_EVNT_REF: 01645 tmp->execDROP_EVNT_REF(signal, ptr); 01646 break; 01647 case GSN_DROP_EVNT_CONF: 01648 tmp->execDROP_EVNT_CONF(signal, ptr); 01649 break; 01650 case GSN_LIST_TABLES_CONF: 01651 tmp->execLIST_TABLES_CONF(signal, ptr); 01652 break; 01653 case GSN_CREATE_FILEGROUP_REF: 01654 tmp->execCREATE_FILEGROUP_REF(signal, ptr); 01655 break; 01656 case GSN_CREATE_FILEGROUP_CONF: 01657 tmp->execCREATE_FILEGROUP_CONF(signal, ptr); 01658 break; 01659 case GSN_CREATE_FILE_REF: 01660 tmp->execCREATE_FILE_REF(signal, ptr); 01661 break; 01662 case GSN_CREATE_FILE_CONF: 01663 tmp->execCREATE_FILE_CONF(signal, ptr); 01664 break; 01665 case GSN_DROP_FILEGROUP_REF: 01666 tmp->execDROP_FILEGROUP_REF(signal, ptr); 01667 break; 01668 case GSN_DROP_FILEGROUP_CONF: 01669 tmp->execDROP_FILEGROUP_CONF(signal, ptr); 01670 break; 01671 case GSN_DROP_FILE_REF: 01672 tmp->execDROP_FILE_REF(signal, ptr); 01673 break; 01674 case GSN_DROP_FILE_CONF: 01675 tmp->execDROP_FILE_CONF(signal, ptr); 01676 break; 01677 case GSN_WAIT_GCP_CONF: 01678 tmp->execWAIT_GCP_CONF(signal, ptr); 01679 break; 01680 case GSN_WAIT_GCP_REF: 01681 tmp->execWAIT_GCP_REF(signal, ptr); 01682 break; 01683 default: 01684 abort(); 01685 } 01686 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execSUB_START_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3867 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbApiSignal::getDataPtr(), m_error, m_waiter, SubscriptionData::MetaData, NO_WAIT, SubStartConf::part, NdbWaiter::signal(), SubStartConf::subscriberData, SubStartConf::subscriptionId, SubStartConf::subscriptionKey, and SubscriptionData::TableData.
Referenced by execSignal().
03869 { 03870 DBUG_ENTER("NdbDictInterface::execSUB_START_CONF"); 03871 const SubStartConf * const subStartConf= 03872 CAST_CONSTPTR(SubStartConf, signal->getDataPtr()); 03873 03874 Uint32 subscriptionId = subStartConf->subscriptionId; 03875 Uint32 subscriptionKey = subStartConf->subscriptionKey; 03876 SubscriptionData::Part part = 03877 (SubscriptionData::Part)subStartConf->part; 03878 Uint32 subscriberData = subStartConf->subscriberData; 03879 03880 switch(part) { 03881 case SubscriptionData::MetaData: { 03882 DBUG_PRINT("error",("SubscriptionData::MetaData")); 03883 m_error.code= 1; 03884 break; 03885 } 03886 case SubscriptionData::TableData: { 03887 DBUG_PRINT("info",("SubscriptionData::TableData")); 03888 break; 03889 } 03890 default: { 03891 DBUG_PRINT("error",("wrong data")); 03892 m_error.code= 2; 03893 break; 03894 } 03895 } 03896 DBUG_PRINT("info",("subscriptionId=%d,subscriptionKey=%d,subscriberData=%d", 03897 subscriptionId,subscriptionKey,subscriberData)); 03898 m_waiter.signal(NO_WAIT); 03899 DBUG_VOID_RETURN; 03900 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execSUB_START_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3903 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_VOID_RETURN, SubStartRef::errorCode, NdbApiSignal::getDataPtr(), m_error, SubStartRef::m_masterNodeId, m_masterNodeId, m_waiter, NO_WAIT, SubStartRef::NotMaster, and NdbWaiter::signal().
Referenced by execSignal().
03905 { 03906 DBUG_ENTER("NdbDictInterface::execSUB_START_REF"); 03907 const SubStartRef * const subStartRef= 03908 CAST_CONSTPTR(SubStartRef, signal->getDataPtr()); 03909 m_error.code= subStartRef->errorCode; 03910 if (m_error.code == SubStartRef::NotMaster) 03911 m_masterNodeId = subStartRef->m_masterNodeId; 03912 m_waiter.signal(NO_WAIT); 03913 DBUG_VOID_RETURN; 03914 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execSUB_STOP_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3828 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbApiSignal::getDataPtr(), m_waiter, NO_WAIT, NdbWaiter::signal(), SubStopConf::subscriberData, SubStopConf::subscriptionId, and SubStopConf::subscriptionKey.
Referenced by execSignal().
03830 { 03831 DBUG_ENTER("NdbDictInterface::execSUB_STOP_CONF"); 03832 const SubStopConf * const subStopConf= 03833 CAST_CONSTPTR(SubStopConf, signal->getDataPtr()); 03834 03835 Uint32 subscriptionId = subStopConf->subscriptionId; 03836 Uint32 subscriptionKey = subStopConf->subscriptionKey; 03837 Uint32 subscriberData = subStopConf->subscriberData; 03838 03839 DBUG_PRINT("info",("subscriptionId=%d,subscriptionKey=%d,subscriberData=%d", 03840 subscriptionId,subscriptionKey,subscriberData)); 03841 m_waiter.signal(NO_WAIT); 03842 DBUG_VOID_RETURN; 03843 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execSUB_STOP_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 3846 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, SubStopRef::errorCode, NdbApiSignal::getDataPtr(), m_error, SubStopRef::m_masterNodeId, m_masterNodeId, m_waiter, NO_WAIT, SubStopRef::NotMaster, NdbWaiter::signal(), SubStopRef::subscriberData, SubStopRef::subscriptionId, and SubStopRef::subscriptionKey.
Referenced by execSignal().
03848 { 03849 DBUG_ENTER("NdbDictInterface::execSUB_STOP_REF"); 03850 const SubStopRef * const subStopRef= 03851 CAST_CONSTPTR(SubStopRef, signal->getDataPtr()); 03852 03853 Uint32 subscriptionId = subStopRef->subscriptionId; 03854 Uint32 subscriptionKey = subStopRef->subscriptionKey; 03855 Uint32 subscriberData = subStopRef->subscriberData; 03856 m_error.code= subStopRef->errorCode; 03857 03858 DBUG_PRINT("error",("subscriptionId=%d,subscriptionKey=%d,subscriberData=%d,error=%d", 03859 subscriptionId,subscriptionKey,subscriberData,m_error.code)); 03860 if (m_error.code == SubStopRef::NotMaster) 03861 m_masterNodeId = subStopRef->m_masterNodeId; 03862 m_waiter.signal(NO_WAIT); 03863 DBUG_VOID_RETURN; 03864 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::executeSubscribeEvent | ( | class Ndb & | ndb, | |
| NdbEventOperationImpl & | ||||
| ) |
Definition at line 3588 of file NdbDictionaryImpl.cpp.
References CAST_PTR, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dictSignal(), NdbApiSignal::getDataPtrSend(), GSN_SUB_START_REQ, NdbEventImpl::m_eventId, NdbEventOperationImpl::m_eventImpl, NdbEventImpl::m_eventKey, NdbEventOperationImpl::m_oid, m_reference, NULL, SubStartReq::part, SubStartReq::subscriberData, SubStartReq::subscriberRef, SubStartReq::subscriptionId, SubStartReq::subscriptionKey, SubscriptionData::TableData, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::executeSubscribeEvent().
03590 { 03591 DBUG_ENTER("NdbDictInterface::executeSubscribeEvent"); 03592 NdbApiSignal tSignal(m_reference); 03593 tSignal.theReceiversBlockNumber = DBDICT; 03594 tSignal.theVerId_signalNumber = GSN_SUB_START_REQ; 03595 tSignal.theLength = SubStartReq::SignalLength2; 03596 03597 SubStartReq * req = CAST_PTR(SubStartReq, tSignal.getDataPtrSend()); 03598 03599 req->subscriptionId = ev_op.m_eventImpl->m_eventId; 03600 req->subscriptionKey = ev_op.m_eventImpl->m_eventKey; 03601 req->part = SubscriptionData::TableData; 03602 req->subscriberData = ev_op.m_oid; 03603 req->subscriberRef = m_reference; 03604 03605 DBUG_PRINT("info",("GSN_SUB_START_REQ subscriptionId=%d,subscriptionKey=%d," 03606 "subscriberData=%d",req->subscriptionId, 03607 req->subscriptionKey,req->subscriberData)); 03608 03609 DBUG_RETURN(dictSignal(&tSignal,NULL,0, 03610 0 /*use masternode id*/, 03611 WAIT_CREATE_INDX_REQ /*WAIT_CREATE_EVNT_REQ*/, 03612 -1, 100, 03613 0, -1)); 03614 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execWAIT_GCP_CONF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4250 of file NdbDictionaryImpl.cpp.
References CAST_CONSTPTR, NdbApiSignal::getDataPtr(), m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
04252 { 04253 const WaitGCPConf * const conf= 04254 CAST_CONSTPTR(WaitGCPConf, signal->getDataPtr()); 04255 m_waiter.signal(NO_WAIT); 04256 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbDictInterface::execWAIT_GCP_REF | ( | NdbApiSignal * | , | |
| LinearSectionPtr | ptr[3] | |||
| ) | [private] |
Definition at line 4259 of file NdbDictionaryImpl.cpp.
References m_waiter, NO_WAIT, and NdbWaiter::signal().
Referenced by execSignal().
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::forceGCPWait | ( | ) |
Definition at line 4214 of file NdbDictionaryImpl.cpp.
References CAST_PTR, NdbError::code, WaitGCPReq::CompleteForceStart, DBDIH, DICT_WAITFOR_TIMEOUT, TransporterFacade::get_an_alive_node(), NdbApiSignal::getDataPtrSend(), GSN_WAIT_GCP_REQ, TransporterFacade::lock_mutex(), m_error, NdbWaiter::m_node, m_reference, NdbWaiter::m_state, m_transporter, m_waiter, WaitGCPReq::requestType, WaitGCPReq::senderData, WaitGCPReq::senderRef, TransporterFacade::sendSignal(), SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, TransporterFacade::unlock_mutex(), NdbWaiter::wait(), and WAIT_LIST_TABLES_CONF.
Referenced by NdbDictionaryImpl::forceGCPWait().
04215 { 04216 NdbApiSignal tSignal(m_reference); 04217 WaitGCPReq* const req = CAST_PTR(WaitGCPReq, tSignal.getDataPtrSend()); 04218 req->senderRef = m_reference; 04219 req->senderData = 0; 04220 req->requestType = WaitGCPReq::CompleteForceStart; 04221 tSignal.theReceiversBlockNumber = DBDIH; 04222 tSignal.theVerId_signalNumber = GSN_WAIT_GCP_REQ; 04223 tSignal.theLength = WaitGCPReq::SignalLength; 04224 04225 const Uint32 RETRIES = 100; 04226 for (Uint32 i = 0; i < RETRIES; i++) 04227 { 04228 m_transporter->lock_mutex(); 04229 Uint16 aNodeId = m_transporter->get_an_alive_node(); 04230 if (aNodeId == 0) { 04231 m_error.code= 4009; 04232 m_transporter->unlock_mutex(); 04233 return -1; 04234 } 04235 if (m_transporter->sendSignal(&tSignal, aNodeId) != 0) { 04236 m_transporter->unlock_mutex(); 04237 continue; 04238 } 04239 m_error.code= 0; 04240 m_waiter.m_node = aNodeId; 04241 m_waiter.m_state = WAIT_LIST_TABLES_CONF; 04242 m_waiter.wait(DICT_WAITFOR_TIMEOUT); 04243 m_transporter->unlock_mutex(); 04244 return 0; 04245 } 04246 return -1; 04247 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::get_file | ( | NdbFileImpl & | , | |
| NdbDictionary::Object::Type | , | |||
| int | , | |||
| const char * | ||||
| ) |
Definition at line 4932 of file NdbDictionaryImpl.cpp.
References UtilBuffer::append(), BaseString::assign(), CAST_PTR, UtilBuffer::clear(), NdbError::code, NdbDictionary::Object::Datafile, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), UtilBuffer::get_data(), get_filegroup(), NdbApiSignal::getDataPtrSend(), NdbTablespaceImpl::getImpl(), NdbLogfileGroupImpl::getImpl(), GSN_GET_TABINFOREQ, UtilBuffer::length(), NdbDictionary::Object::LogfileGroup, GetTabInfoReq::LongSignalConf, m_buffer, m_error, NdbFileImpl::m_filegroup_id, NdbFileImpl::m_filegroup_name, NdbFileImpl::m_free, m_reference, NdbDictObjectImpl::m_type, LinearSectionPtr::p, TaoCrypt::pad, parseFileInfo(), GetTabInfoReq::RequestByName, GetTabInfoReq::requestType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, strlen(), LinearSectionPtr::sz, GetTabInfoReq::tableNameLen, GetTabInfoRef::TableNotDefined, NdbDictionary::Object::Tablespace, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, NdbDictionary::Object::Undofile, and WAIT_GET_TAB_INFO_REQ.
04935 { 04936 DBUG_ENTER("NdbDictInterface::get_file"); 04937 NdbApiSignal tSignal(m_reference); 04938 GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend()); 04939 04940 size_t strLen = strlen(name) + 1; 04941 04942 req->senderRef = m_reference; 04943 req->senderData = 0; 04944 req->requestType = 04945 GetTabInfoReq::RequestByName | GetTabInfoReq::LongSignalConf; 04946 req->tableNameLen = strLen; 04947 tSignal.theReceiversBlockNumber = DBDICT; 04948 tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ; 04949 tSignal.theLength = GetTabInfoReq::SignalLength; 04950 04951 LinearSectionPtr ptr[1]; 04952 ptr[0].p = (Uint32*)name; 04953 ptr[0].sz = (strLen + 3)/4; 04954 04955 #ifndef IGNORE_VALGRIND_WARNINGS 04956 if (strLen & 3) 04957 { 04958 Uint32 pad = 0; 04959 m_buffer.clear(); 04960 m_buffer.append(name, strLen); 04961 m_buffer.append(&pad, 4); 04962 ptr[0].p = (Uint32*)m_buffer.get_data(); 04963 } 04964 #endif 04965 04966 int r = dictSignal(&tSignal, ptr, 1, 04967 node, 04968 WAIT_GET_TAB_INFO_REQ, 04969 DICT_WAITFOR_TIMEOUT, 100); 04970 if (r) 04971 { 04972 DBUG_PRINT("info", ("get_file failed dictSignal")); 04973 DBUG_RETURN(-1); 04974 } 04975 04976 m_error.code = parseFileInfo(dst, 04977 (Uint32*)m_buffer.get_data(), 04978 m_buffer.length() / 4); 04979 04980 if(m_error.code) 04981 { 04982 DBUG_PRINT("info", ("get_file failed parseFileInfo %d", 04983 m_error.code)); 04984 DBUG_RETURN(m_error.code); 04985 } 04986 04987 if(dst.m_type == NdbDictionary::Object::Undofile) 04988 { 04989 NdbDictionary::LogfileGroup tmp; 04990 get_filegroup(NdbLogfileGroupImpl::getImpl(tmp), 04991 NdbDictionary::Object::LogfileGroup, 04992 dst.m_filegroup_id); 04993 dst.m_filegroup_name.assign(tmp.getName()); 04994 } 04995 else if(dst.m_type == NdbDictionary::Object::Datafile) 04996 { 04997 NdbDictionary::Tablespace tmp; 04998 get_filegroup(NdbTablespaceImpl::getImpl(tmp), 04999 NdbDictionary::Object::Tablespace, 05000 dst.m_filegroup_id); 05001 dst.m_filegroup_name.assign(tmp.getName()); 05002 dst.m_free *= tmp.getExtentSize(); 05003 } 05004 else 05005 dst.m_filegroup_name.assign("Not Yet Implemented"); 05006 05007 if(dst.m_type == type) 05008 { 05009 DBUG_RETURN(0); 05010 } 05011 DBUG_PRINT("info", ("get_file failed no such file")); 05012 DBUG_RETURN(m_error.code = GetTabInfoRef::TableNotDefined); 05013 }
Here is the call graph for this function:

| int NdbDictInterface::get_file | ( | NdbFileImpl & | , | |
| NdbDictionary::Object::Type | , | |||
| int | , | |||
| int | ||||
| ) |
Referenced by NdbDictionary::Dictionary::getDatafile(), and NdbDictionary::Dictionary::getUndofile().
Here is the caller graph for this function:

| int NdbDictInterface::get_filegroup | ( | NdbFilegroupImpl & | , | |
| NdbDictionary::Object::Type | , | |||
| const char * | ||||
| ) |
Definition at line 4777 of file NdbDictionaryImpl.cpp.
References UtilBuffer::append(), BaseString::assign(), CAST_PTR, UtilBuffer::clear(), NdbError::code, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), UtilBuffer::get_data(), get_filegroup(), NdbApiSignal::getDataPtrSend(), NdbLogfileGroupImpl::getImpl(), GSN_GET_TABINFOREQ, UtilBuffer::length(), NdbDictionary::Object::LogfileGroup, GetTabInfoReq::LongSignalConf, m_buffer, m_error, NdbDictObjectImpl::m_id, NdbFilegroupImpl::m_logfile_group_id, NdbFilegroupImpl::m_logfile_group_name, m_reference, NdbDictObjectImpl::m_type, NdbDictObjectImpl::m_version, LinearSectionPtr::p, TaoCrypt::pad, parseFilegroupInfo(), GetTabInfoReq::RequestByName, GetTabInfoReq::requestType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, strlen(), LinearSectionPtr::sz, GetTabInfoReq::tableNameLen, GetTabInfoRef::TableNotDefined, NdbDictionary::Object::Tablespace, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_GET_TAB_INFO_REQ.
04779 { 04780 DBUG_ENTER("NdbDictInterface::get_filegroup"); 04781 NdbApiSignal tSignal(m_reference); 04782 GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend()); 04783 04784 size_t strLen = strlen(name) + 1; 04785 04786 req->senderRef = m_reference; 04787 req->senderData = 0; 04788 req->requestType = 04789 GetTabInfoReq::RequestByName | GetTabInfoReq::LongSignalConf; 04790 req->tableNameLen = strLen; 04791 tSignal.theReceiversBlockNumber = DBDICT; 04792 tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ; 04793 tSignal.theLength = GetTabInfoReq::SignalLength; 04794 04795 LinearSectionPtr ptr[1]; 04796 ptr[0].p = (Uint32*)name; 04797 ptr[0].sz = (strLen + 3)/4; 04798 04799 #ifndef IGNORE_VALGRIND_WARNINGS 04800 if (strLen & 3) 04801 { 04802 Uint32 pad = 0; 04803 m_buffer.clear(); 04804 m_buffer.append(name, strLen); 04805 m_buffer.append(&pad, 4); 04806 ptr[0].p = (Uint32*)m_buffer.get_data(); 04807 } 04808 #endif 04809 04810 int r = dictSignal(&tSignal, ptr, 1, 04811 -1, // any node 04812 WAIT_GET_TAB_INFO_REQ, 04813 DICT_WAITFOR_TIMEOUT, 100); 04814 if (r) 04815 { 04816 dst.m_id = -1; 04817 dst.m_version = ~0; 04818 04819 DBUG_PRINT("info", ("get_filegroup failed dictSignal")); 04820 DBUG_RETURN(-1); 04821 } 04822 04823 m_error.code = parseFilegroupInfo(dst, 04824 (Uint32*)m_buffer.get_data(), 04825 m_buffer.length() / 4); 04826 04827 if(m_error.code) 04828 { 04829 DBUG_PRINT("info", ("get_filegroup failed parseFilegroupInfo %d", 04830 m_error.code)); 04831 DBUG_RETURN(m_error.code); 04832 } 04833 04834 if(dst.m_type == NdbDictionary::Object::Tablespace) 04835 { 04836 NdbDictionary::LogfileGroup tmp; 04837 get_filegroup(NdbLogfileGroupImpl::getImpl(tmp), 04838 NdbDictionary::Object::LogfileGroup, 04839 dst.m_logfile_group_id); 04840 dst.m_logfile_group_name.assign(tmp.getName()); 04841 } 04842 04843 if(dst.m_type == type) 04844 { 04845 DBUG_RETURN(0); 04846 } 04847 DBUG_PRINT("info", ("get_filegroup failed no such filegroup")); 04848 DBUG_RETURN(m_error.code = GetTabInfoRef::TableNotDefined); 04849 }
Here is the call graph for this function:

| int NdbDictInterface::get_filegroup | ( | NdbFilegroupImpl & | , | |
| NdbDictionary::Object::Type | , | |||
| Uint32 | ||||
| ) |
Definition at line 4886 of file NdbDictionaryImpl.cpp.
References CAST_PTR, NdbError::code, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DICT_WAITFOR_TIMEOUT, dictSignal(), UtilBuffer::get_data(), NdbApiSignal::getDataPtrSend(), GSN_GET_TABINFOREQ, UtilBuffer::length(), GetTabInfoReq::LongSignalConf, m_buffer, m_error, m_reference, NdbDictObjectImpl::m_type, NULL, parseFilegroupInfo(), GetTabInfoReq::RequestById, GetTabInfoReq::requestType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, GetTabInfoReq::tableId, GetTabInfoRef::TableNotDefined, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_GET_TAB_INFO_REQ.
Referenced by create_filegroup(), NdbDictionaryImpl::createDatafile(), createOrAlterTable(), NdbDictionaryImpl::createUndofile(), get_file(), get_filegroup(), NdbDictionary::Dictionary::getLogfileGroup(), and NdbDictionary::Dictionary::getTablespace().
04888 { 04889 DBUG_ENTER("NdbDictInterface::get_filegroup"); 04890 NdbApiSignal tSignal(m_reference); 04891 GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend()); 04892 04893 req->senderRef = m_reference; 04894 req->senderData = 0; 04895 req->requestType = 04896 GetTabInfoReq::RequestById | GetTabInfoReq::LongSignalConf; 04897 req->tableId = id; 04898 tSignal.theReceiversBlockNumber = DBDICT; 04899 tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ; 04900 tSignal.theLength = GetTabInfoReq::SignalLength; 04901 04902 int r = dictSignal(&tSignal, NULL, 1, 04903 -1, // any node 04904 WAIT_GET_TAB_INFO_REQ, 04905 DICT_WAITFOR_TIMEOUT, 100); 04906 if (r) 04907 { 04908 DBUG_PRINT("info", ("get_filegroup failed dictSignal")); 04909 DBUG_RETURN(-1); 04910 } 04911 04912 m_error.code = parseFilegroupInfo(dst, 04913 (Uint32*)m_buffer.get_data(), 04914 m_buffer.length() / 4); 04915 04916 if(m_error.code) 04917 { 04918 DBUG_PRINT("info", ("get_filegroup failed parseFilegroupInfo %d", 04919 m_error.code)); 04920 DBUG_RETURN(m_error.code); 04921 } 04922 04923 if(dst.m_type == type) 04924 { 04925 DBUG_RETURN(0); 04926 } 04927 DBUG_PRINT("info", ("get_filegroup failed no such filegroup")); 04928 DBUG_RETURN(m_error.code = GetTabInfoRef::TableNotDefined); 04929 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const NdbError & NdbDictInterface::getNdbError | ( | ) | const |
Definition at line 86 of file Ndberr.cpp.
References m_error, and update.
Referenced by createEvent(), and dictSignal().
Here is the caller graph for this function:

| NdbTableImpl * NdbDictInterface::getTable | ( | class NdbApiSignal * | signal, | |
| LinearSectionPtr | ptr[3], | |||
| Uint32 | noOfSections, | |||
| bool | fullyQualifiedNames | |||
| ) |
Definition at line 1868 of file NdbDictionaryImpl.cpp.
References NdbTableImpl::buildColumnHash(), GetTabInfoRef::Busy, NdbError::code, DICT_WAITFOR_TIMEOUT, dictSignal(), UtilBuffer::get_data(), UtilBuffer::length(), m_buffer, m_error, parseTableInfo(), and WAIT_GET_TAB_INFO_REQ.
01871 { 01872 int errCodes[] = {GetTabInfoRef::Busy, 0 }; 01873 int r = dictSignal(signal, ptr, noOfSections, 01874 -1, // any node 01875 WAIT_GET_TAB_INFO_REQ, 01876 DICT_WAITFOR_TIMEOUT, 100, errCodes); 01877 01878 if (r) 01879 return 0; 01880 01881 NdbTableImpl * rt = 0; 01882 m_error.code = parseTableInfo(&rt, 01883 (Uint32*)m_buffer.get_data(), 01884 m_buffer.length() / 4, 01885 fullyQualifiedNames); 01886 if(rt) 01887 rt->buildColumnHash(); 01888 01889 return rt; 01890 }
Here is the call graph for this function:

| NdbTableImpl * NdbDictInterface::getTable | ( | const BaseString & | name, | |
| bool | fullyQualifiedNames | |||
| ) |
Definition at line 1832 of file NdbDictionaryImpl.cpp.
References UtilBuffer::append(), CAST_PTR, UtilBuffer::clear(), DBDICT, UtilBuffer::get_data(), NdbApiSignal::getDataPtrSend(), getTable(), UtilBuffer::grow(), GSN_GET_TABINFOREQ, GetTabInfoReq::LongSignalConf, m_buffer, m_reference, name, LinearSectionPtr::p, TaoCrypt::pad, GetTabInfoReq::RequestByName, GetTabInfoReq::requestType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, LinearSectionPtr::sz, GetTabInfoReq::tableNameLen, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, and SignalHeader::theVerId_signalNumber.
01833 { 01834 NdbApiSignal tSignal(m_reference); 01835 GetTabInfoReq* const req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend()); 01836 01837 const Uint32 namelen= name.length() + 1; // NULL terminated 01838 const Uint32 namelen_words= (namelen + 3) >> 2; // Size in words 01839 01840 req->senderRef= m_reference; 01841 req->senderData= 0; 01842 req->requestType= 01843 GetTabInfoReq::RequestByName | GetTabInfoReq::LongSignalConf; 01844 req->tableNameLen= namelen; 01845 tSignal.theReceiversBlockNumber= DBDICT; 01846 tSignal.theVerId_signalNumber= GSN_GET_TABINFOREQ; 01847 tSignal.theLength= GetTabInfoReq::SignalLength; 01848 01849 // Copy name to m_buffer to get a word sized buffer 01850 m_buffer.clear(); 01851 m_buffer.grow(namelen_words*4+4); 01852 m_buffer.append(name.c_str(), namelen); 01853 01854 #ifndef IGNORE_VALGRIND_WARNINGS 01855 Uint32 pad = 0; 01856 m_buffer.append(&pad, 4); 01857 #endif 01858 01859 LinearSectionPtr ptr[1]; 01860 ptr[0].p= (Uint32*)m_buffer.get_data(); 01861 ptr[0].sz= namelen_words; 01862 01863 return getTable(&tSignal, ptr, 1, fullyQualifiedNames); 01864 }
Here is the call graph for this function:

| NdbTableImpl * NdbDictInterface::getTable | ( | int | tableId, | |
| bool | fullyQualifiedNames | |||
| ) |
Definition at line 1806 of file NdbDictionaryImpl.cpp.
References CAST_PTR, DBDICT, NdbApiSignal::getDataPtrSend(), GSN_GET_TABINFOREQ, GetTabInfoReq::LongSignalConf, m_reference, GetTabInfoReq::RequestById, GetTabInfoReq::requestType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, GetTabInfoReq::tableId, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, and SignalHeader::theVerId_signalNumber.
Referenced by NdbDictionaryImpl::createTable(), NdbDictionaryImpl::fetchGlobalTableImplRef(), NdbDictionaryImpl::getBlobTable(), NdbDictionaryImpl::getBlobTables(), and getTable().
01807 { 01808 NdbApiSignal tSignal(m_reference); 01809 GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend()); 01810 01811 req->senderRef = m_reference; 01812 req->senderData = 0; 01813 req->requestType = 01814 GetTabInfoReq::RequestById | GetTabInfoReq::LongSignalConf; 01815 req->tableId = tableId; 01816 tSignal.theReceiversBlockNumber = DBDICT; 01817 tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ; 01818 tSignal.theLength = GetTabInfoReq::SignalLength; 01819 01820 return getTable(&tSignal, 0, 0, fullyQualifiedNames); 01821 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::listObjects | ( | NdbApiSignal * | signal | ) |
Definition at line 4160 of file NdbDictionaryImpl.cpp.
References UtilBuffer::clear(), NdbError::code, DICT_WAITFOR_TIMEOUT, TransporterFacade::get_an_alive_node(), m_buffer, m_error, m_reference, m_transporter, m_waiter, refToBlock(), TransporterFacade::sendSignal(), WAIT_LIST_TABLES_CONF, and PollGuard::wait_n_unlock().
04161 { 04162 const Uint32 RETRIES = 100; 04163 for (Uint32 i = 0; i < RETRIES; i++) { 04164 m_buffer.clear(); 04165 // begin protected 04166 /* 04167 The PollGuard has an implicit call of unlock_and_signal through the 04168 ~PollGuard method. This method is called implicitly by the compiler 04169 in all places where the object is out of context due to a return, 04170 break, continue or simply end of statement block 04171 */ 04172 PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference)); 04173 Uint16 aNodeId = m_transporter->get_an_alive_node(); 04174 if (aNodeId == 0) { 04175 m_error.code= 4009; 04176 return -1; 04177 } 04178 if (m_transporter->sendSignal(signal, aNodeId) != 0) { 04179 continue; 04180 } 04181 m_error.code= 0; 04182 int ret_val= poll_guard.wait_n_unlock(DICT_WAITFOR_TIMEOUT, 04183 aNodeId, WAIT_LIST_TABLES_CONF); 04184 // end protected 04185 if (ret_val == 0 && m_error.code == 0) 04186 return 0; 04187 if (ret_val == -2) //WAIT_NODE_FAILURE 04188 continue; 04189 return -1; 04190 } 04191 return -1; 04192 }
Here is the call graph for this function:

| int NdbDictInterface::listObjects | ( | NdbDictionary::Dictionary::List & | list, | |
| Uint32 | requestData, | |||
| bool | fullyQualifiedNames | |||
| ) |
Definition at line 4066 of file NdbDictionaryImpl.cpp.
References BaseString::c_str(), CAST_PTR, NdbError::code, count, data, NdbDictionary::Dictionary::List::Element::database, DBDICT, Ndb::externalizeIndexName(), Ndb::externalizeTableName(), UtilBuffer::get_data(), getApiConstant(), Ndb::getDatabaseFromInternalName(), NdbApiSignal::getDataPtrSend(), Ndb::getSchemaFromInternalName(), ListTablesConf::getTableId(), ListTablesConf::getTableState(), ListTablesConf::getTableStore(), ListTablesConf::getTableType(), GSN_LIST_TABLES_REQ, NdbDictionary::Dictionary::List::Element::id, BaseString::length(), UtilBuffer::length(), list(), m_buffer, m_error, m_reference, memcpy, n, NdbDictionary::Dictionary::List::Element::name, objectStateMapping, objectStoreMapping, objectTypeMapping, ok(), NdbDictionary::Object::OrderedIndex, pos(), ListTablesReq::requestData, NdbDictionary::Dictionary::List::Element::schema, ListTablesReq::senderData, ListTablesReq::senderRef, NdbDictionary::Dictionary::List::Element::state, NdbDictionary::Dictionary::List::Element::store, NdbDictionary::Object::SystemTable, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, NdbDictionary::Dictionary::List::Element::type, NdbDictionary::Object::UniqueHashIndex, and NdbDictionary::Object::UserTable.
Referenced by NdbDictionaryImpl::listIndexes(), and NdbDictionaryImpl::listObjects().
04068 { 04069 NdbApiSignal tSignal(m_reference); 04070 ListTablesReq* const req = CAST_PTR(ListTablesReq, tSignal.getDataPtrSend()); 04071 req->senderRef = m_reference; 04072 req->senderData = 0; 04073 req->requestData = requestData; 04074 tSignal.theReceiversBlockNumber = DBDICT; 04075 tSignal.theVerId_signalNumber = GSN_LIST_TABLES_REQ; 04076 tSignal.theLength = ListTablesReq::SignalLength; 04077 if (listObjects(&tSignal) != 0) 04078 return -1; 04079 // count 04080 const Uint32* data = (const Uint32*)m_buffer.get_data(); 04081 const unsigned length = m_buffer.length() / 4; 04082 list.count = 0; 04083 bool ok = true; 04084 unsigned pos, count; 04085 pos = count = 0; 04086 while (pos < length) { 04087 // table id - name length - name 04088 pos++; 04089 if (pos >= length) { 04090 ok = false; 04091 break; 04092 } 04093 Uint32 n = (data[pos++] + 3) >> 2; 04094 pos += n; 04095 if (pos > length) { 04096 ok = false; 04097 break; 04098 } 04099 count++; 04100 } 04101 if (! ok) { 04102 // bad signal data 04103 m_error.code= 4213; 04104 return -1; 04105 } 04106 list.count = count; 04107 list.elements = new NdbDictionary::Dictionary::List::Element[count]; 04108 pos = count = 0; 04109 while (pos < length) { 04110 NdbDictionary::Dictionary::List::Element& element = list.elements[count]; 04111 Uint32 d = data[pos++]; 04112 element.id = ListTablesConf::getTableId(d); 04113 element.type = (NdbDictionary::Object::Type) 04114 getApiConstant(ListTablesConf::getTableType(d), objectTypeMapping, 0); 04115 element.state = (NdbDictionary::Object::State) 04116 getApiConstant(ListTablesConf::getTableState(d), objectStateMapping, 0); 04117 element.store = (NdbDictionary::Object::Store) 04118 getApiConstant(ListTablesConf::getTableStore(d), objectStoreMapping, 0); 04119 // table or index name 04120 Uint32 n = (data[pos++] + 3) >> 2; 04121 BaseString databaseName; 04122 BaseString schemaName; 04123 BaseString objectName; 04124 if ((element.type == NdbDictionary::Object::UniqueHashIndex) || 04125 (element.type == NdbDictionary::Object::OrderedIndex)) { 04126 char * indexName = new char[n << 2]; 04127 memcpy(indexName, &data[pos], n << 2); 04128 databaseName = Ndb::getDatabaseFromInternalName(indexName); 04129 schemaName = Ndb::getSchemaFromInternalName(indexName); 04130 objectName = BaseString(Ndb::externalizeIndexName(indexName, fullyQualifiedNames)); 04131 delete [] indexName; 04132 } else if ((element.type == NdbDictionary::Object::SystemTable) || 04133 (element.type == NdbDictionary::Object::UserTable)) { 04134 char * tableName = new char[n << 2]; 04135 memcpy(tableName, &data[pos], n << 2); 04136 databaseName = Ndb::getDatabaseFromInternalName(tableName); 04137 schemaName = Ndb::getSchemaFromInternalName(tableName); 04138 objectName = BaseString(Ndb::externalizeTableName(tableName, fullyQualifiedNames)); 04139 delete [] tableName; 04140 } 04141 else { 04142 char * otherName = new char[n << 2]; 04143 memcpy(otherName, &data[pos], n << 2); 04144 objectName = BaseString(otherName); 04145 delete [] otherName; 04146 } 04147 element.database = new char[databaseName.length() + 1]; 04148 strcpy(element.database, databaseName.c_str()); 04149 element.schema = new char[schemaName.length() + 1]; 04150 strcpy(element.schema, schemaName.c_str()); 04151 element.name = new char[objectName.length() + 1]; 04152 strcpy(element.name, objectName.c_str()); 04153 pos += n; 04154 count++; 04155 } 04156 return 0; 04157 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::parseFilegroupInfo | ( | NdbFilegroupImpl & | dst, | |
| const Uint32 * | data, | |||
| Uint32 | len | |||
| ) | [static] |
Definition at line 4852 of file NdbDictionaryImpl.cpp.
References BaseString::assign(), SimpleProperties::Eof, DictFilegroupInfo::Filegroup::FilegroupId, DictFilegroupInfo::Filegroup::FilegroupName, DictFilegroupInfo::Filegroup::FilegroupType, DictFilegroupInfo::Filegroup::FilegroupVersion, DictFilegroupInfo::Filegroup::init(), CreateFilegroupRef::InvalidFormat, DictFilegroupInfo::Filegroup::LF_UndoBufferSize, DictFilegroupInfo::Filegroup::LF_UndoFreeWordsHi, DictFilegroupInfo::Filegroup::LF_UndoFreeWordsLo, NdbFilegroupImpl::m_extent_size, NdbDictObjectImpl::m_id, NdbFilegroupImpl::m_logfile_group_id, NdbFilegroupImpl::m_logfile_group_version, NdbFilegroupImpl::m_name, NdbDictObjectImpl::m_status, NdbDictObjectImpl::m_type, NdbFilegroupImpl::m_undo_buffer_size, NdbFilegroupImpl::m_undo_free_words, NdbDictObjectImpl::m_version, DictFilegroupInfo::Mapping, DictFilegroupInfo::MappingSize, NdbDictionary::Object::Retrieved, status, DictFilegroupInfo::Filegroup::TS_ExtentSize, DictFilegroupInfo::Filegroup::TS_LogfileGroupId, DictFilegroupInfo::Filegroup::TS_LogfileGroupVersion, and SimpleProperties::unpack().
Referenced by get_filegroup(), and RestoreMetaData::readMetaTableDesc().
04855 { 04856 SimplePropertiesLinearReader it(data, len); 04857 04858 SimpleProperties::UnpackStatus status; 04859 DictFilegroupInfo::Filegroup fg; fg.init(); 04860 status = SimpleProperties::unpack(it, &fg, 04861 DictFilegroupInfo::Mapping, 04862 DictFilegroupInfo::MappingSize, 04863 true, true); 04864 04865 if(status != SimpleProperties::Eof){ 04866 return CreateFilegroupRef::InvalidFormat; 04867 } 04868 04869 dst.m_id = fg.FilegroupId; 04870 dst.m_version = fg.FilegroupVersion; 04871 dst.m_type = (NdbDictionary::Object::Type)fg.FilegroupType; 04872 dst.m_status = NdbDictionary::Object::Retrieved; 04873 04874 dst.m_name.assign(fg.FilegroupName); 04875 dst.m_extent_size = fg.TS_ExtentSize; 04876 dst.m_undo_buffer_size = fg.LF_UndoBufferSize; 04877 dst.m_logfile_group_id = fg.TS_LogfileGroupId; 04878 dst.m_logfile_group_version = fg.TS_LogfileGroupVersion; 04879 dst.m_undo_free_words= ((Uint64)fg.LF_UndoFreeWordsHi << 32) 04880 | (fg.LF_UndoFreeWordsLo); 04881 04882 return 0; 04883 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::parseFileInfo | ( | NdbFileImpl & | dst, | |
| const Uint32 * | data, | |||
| Uint32 | len | |||
| ) | [static] |
Definition at line 5016 of file NdbDictionaryImpl.cpp.
References BaseString::assign(), SimpleProperties::Eof, f, DictFilegroupInfo::FileMapping, DictFilegroupInfo::FileMappingSize, CreateFilegroupRef::InvalidFormat, NdbFileImpl::m_filegroup_id, NdbFileImpl::m_filegroup_version, NdbFileImpl::m_free, NdbDictObjectImpl::m_id, NdbFileImpl::m_path, NdbFileImpl::m_size, NdbDictObjectImpl::m_type, NdbDictObjectImpl::m_version, status, and SimpleProperties::unpack().
Referenced by get_file(), and RestoreMetaData::readMetaTableDesc().
05018 { 05019 SimplePropertiesLinearReader it(data, len); 05020 05021 SimpleProperties::UnpackStatus status; 05022 DictFilegroupInfo::File f; f.init(); 05023 status = SimpleProperties::unpack(it, &f, 05024 DictFilegroupInfo::FileMapping, 05025 DictFilegroupInfo::FileMappingSize, 05026 true, true); 05027 05028 if(status != SimpleProperties::Eof){ 05029 return CreateFilegroupRef::InvalidFormat; 05030 } 05031 05032 dst.m_type= (NdbDictionary::Object::Type)f.FileType; 05033 dst.m_id= f.FileId; 05034 dst.m_version = f.FileVersion; 05035 05036 dst.m_size= ((Uint64)f.FileSizeHi << 32) | (f.FileSizeLo); 05037 dst.m_path.assign(f.FileName); 05038 05039 dst.m_filegroup_id= f.FilegroupId; 05040 dst.m_filegroup_version= f.FilegroupVersion; 05041 dst.m_free= f.FileFreeExtents; 05042 return 0; 05043 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbDictInterface::parseTableInfo | ( | NdbTableImpl ** | dst, | |
| const Uint32 * | data, | |||
| Uint32 | len, | |||
| bool | fullyQualifiedNames, | |||
| Uint32 | version = 0xFFFFFFFF | |||
| ) | [static] |
Definition at line 2023 of file NdbDictionaryImpl.cpp.
References UtilBuffer::assign(), BaseString::assign(), DictTabInfo::Attribute::AttributeArraySize, DictTabInfo::Attribute::AttributeArrayType, DictTabInfo::Attribute::AttributeAutoIncrement, DictTabInfo::Attribute::AttributeDefaultValue, DictTabInfo::Attribute::AttributeDKey, DictTabInfo::Attribute::AttributeExtLength, DictTabInfo::Attribute::AttributeExtPrecision, DictTabInfo::Attribute::AttributeExtScale, DictTabInfo::Attribute::AttributeExtType, DictTabInfo::Attribute::AttributeId, DictTabInfo::Attribute::AttributeKeyFlag, DictTabInfo::AttributeMapping, DictTabInfo::AttributeMappingSize, DictTabInfo::Attribute::AttributeName, DictTabInfo::Attribute::AttributeNullableFlag, DictTabInfo::Attribute::AttributeSize, DictTabInfo::Attribute::AttributeStorageType, SimpleProperties::Break, NdbTableImpl::computeAggregates(), DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DictTabInfo::Table::DefaultNoPartFlag, Ndb::externalizeTableName(), DictTabInfo::Table::FragmentCount, DictTabInfo::Table::FragmentData, DictTabInfo::Table::FragmentDataLen, DictTabInfo::Table::FragmentType, fragmentTypeMapping, NdbDictionary::Object::FragUndefined, DictTabInfo::Table::FrmData, DictTabInfo::Table::FrmLen, get_charset(), getApiConstant(), NdbColumnImpl::getCharType(), indexTypeMapping, DictTabInfo::Table::init(), DictTabInfo::Table::LinearHashFlag, NdbColumnImpl::m_arraySize, NdbColumnImpl::m_arrayType, NdbColumnImpl::m_attrId, NdbColumnImpl::m_attrSize, NdbColumnImpl::m_autoIncrement, NdbColumnImpl::m_autoIncrementInitialValue, NdbColumnImpl::m_column_no, NdbTableImpl::m_columns, NdbColumnImpl::m_cs, NdbTableImpl::m_default_no_part_flag, NdbColumnImpl::m_defaultValue, NdbColumnImpl::m_distributionKey, NdbTableImpl::m_externalName, NdbTableImpl::m_fd, NdbTableImpl::m_fragmentCount, NdbTableImpl::m_fragments, NdbTableImpl::m_fragmentType, NdbTableImpl::m_frm, NdbTableImpl::m_hashpointerValue, NdbTableImpl::m_hashValueMask, NdbDictObjectImpl::m_id, NdbTableImpl::m_indexType, NdbTableImpl::m_internalName, NdbTableImpl::m_kvalue, NdbColumnImpl::m_length, NdbTableImpl::m_linear_flag, NdbTableImpl::m_logging, NdbTableImpl::m_max_rows, NdbTableImpl::m_maxLoadFactor, NdbTableImpl::m_min_rows, NdbTableImpl::m_minLoadFactor, NdbColumnImpl::m_nullable, NdbColumnImpl::m_pk, NdbColumnImpl::m_precision, NdbTableImpl::m_primaryTable, NdbTableImpl::m_range, NdbTableImpl::m_replicaCount, NdbTableImpl::m_row_checksum, NdbTableImpl::m_row_gci, NdbColumnImpl::m_scale, NdbDictObjectImpl::m_status, NdbColumnImpl::m_storageType, NdbTableImpl::m_tablespace_id, NdbTableImpl::m_tablespace_version, NdbColumnImpl::m_type, NdbDictObjectImpl::m_version, MAKE_VERSION, DictTabInfo::Table::MaxLoadFactor, DictTabInfo::Table::MaxRowsHigh, DictTabInfo::Table::MaxRowsLow, DictTabInfo::Table::MinLoadFactor, DictTabInfo::Table::MinRowsHigh, DictTabInfo::Table::MinRowsLow, MYF, NdbMem_Allocate(), NdbMem_Free(), SimpleProperties::Reader::next(), DictTabInfo::Table::NoOfAttributes, NULL, DictTabInfo::Table::PrimaryTable, Vector< T >::push_back(), DictTabInfo::Table::RangeListData, DictTabInfo::Table::RangeListDataLen, DictTabInfo::Table::ReplicaData, DictTabInfo::Table::ReplicaDataLen, NdbDictionary::Object::Retrieved, DictTabInfo::Table::RowChecksumFlag, DictTabInfo::Table::RowGCIFlag, NdbDictionary::Column::setName(), Vector< T >::size(), DictTabInfo::Table::TableId, DictTabInfo::Table::TableKValue, DictTabInfo::Table::TableLoggedFlag, DictTabInfo::TableMapping, DictTabInfo::TableMappingSize, DictTabInfo::Table::TableName, DictTabInfo::Table::TablespaceId, DictTabInfo::Table::TablespaceVersion, DictTabInfo::Table::TableType, DictTabInfo::Table::TableVersion, DictTabInfo::Attribute::translateExtType(), NdbDictionary::Object::TypeUndefined, SimpleProperties::unpack(), and NdbTableImpl::updateMysqlName().
Referenced by getTable(), RestoreMetaData::parseTableDescriptor(), and NdbEventOperationImpl::receive_event().
02027 { 02028 SimplePropertiesLinearReader it(data, len); 02029 DictTabInfo::Table *tableDesc; 02030 SimpleProperties::UnpackStatus s; 02031 DBUG_ENTER("NdbDictInterface::parseTableInfo"); 02032 02033 tableDesc = (DictTabInfo::Table*)NdbMem_Allocate(sizeof(DictTabInfo::Table)); 02034 if (!tableDesc) 02035 { 02036 DBUG_RETURN(4000); 02037 } 02038 tableDesc->init(); 02039 s = SimpleProperties::unpack(it, tableDesc, 02040 DictTabInfo::TableMapping, 02041 DictTabInfo::TableMappingSize, 02042 true, true); 02043 02044 if(s != SimpleProperties::Break){ 02045 NdbMem_Free((void*)tableDesc); 02046 DBUG_RETURN(703); 02047 } 02048 const char * internalName = tableDesc->TableName; 02049 const char * externalName = Ndb::externalizeTableName(internalName, fullyQualifiedNames); 02050 02051 NdbTableImpl * impl = new NdbTableImpl(); 02052 impl->m_id = tableDesc->TableId; 02053 impl->m_version = tableDesc->TableVersion; 02054 impl->m_status = NdbDictionary::Object::Retrieved; 02055 impl->m_internalName.assign(internalName); 02056 impl->updateMysqlName(); 02057 impl->m_externalName.assign(externalName); 02058 02059 impl->m_frm.assign(tableDesc->FrmData, tableDesc->FrmLen); 02060 impl->m_fd.assign(tableDesc->FragmentData, tableDesc->FragmentDataLen); 02061 impl->m_range.assign(tableDesc->RangeListData, tableDesc->RangeListDataLen); 02062 impl->m_fragmentCount = tableDesc->FragmentCount; 02063 02064 /* 02065 We specifically don't get tablespace data and range/list arrays here 02066 since those are known by the MySQL Server through analysing the 02067 frm file. 02068 Fragment Data contains the real node group mapping and the fragment 02069 identities used for each fragment. At the moment we have no need for 02070 this. 02071 Frm file is needed for autodiscovery. 02072 */ 02073 02074 impl->m_fragmentType = (NdbDictionary::Object::FragmentType) 02075 getApiConstant(tableDesc->FragmentType, 02076 fragmentTypeMapping, 02077 (Uint32)NdbDictionary::Object::FragUndefined); 02078 02079 Uint64 max_rows = ((Uint64)tableDesc->MaxRowsHigh) << 32; 02080 max_rows += tableDesc->MaxRowsLow; 02081 impl->m_max_rows = max_rows; 02082 Uint64 min_rows = ((Uint64)tableDesc->MinRowsHigh) << 32; 02083 min_rows += tableDesc->MinRowsLow; 02084 impl->m_min_rows = min_rows; 02085 impl->m_default_no_part_flag = tableDesc->DefaultNoPartFlag; 02086 impl->m_linear_flag = tableDesc->LinearHashFlag; 02087 impl->m_logging = tableDesc->TableLoggedFlag; 02088 impl->m_row_gci = tableDesc->RowGCIFlag; 02089 impl->m_row_checksum = tableDesc->RowChecksumFlag; 02090 impl->m_kvalue = tableDesc->TableKValue; 02091 impl->m_minLoadFactor = tableDesc->MinLoadFactor; 02092 impl->m_maxLoadFactor = tableDesc->MaxLoadFactor; 02093 02094 impl->m_indexType = (NdbDictionary::Object::Type) 02095 getApiConstant(tableDesc->TableType, 02096 indexTypeMapping, 02097 NdbDictionary::Object::TypeUndefined); 02098 02099 if(impl->m_indexType == NdbDictionary::Object::TypeUndefined){ 02100 } else { 02101 const char * externalPrimary = 02102 Ndb::externalizeTableName(tableDesc->PrimaryTable, fullyQualifiedNames); 02103 impl->m_primaryTable.assign(externalPrimary); 02104 } 02105 02106 Uint32 i; 02107 for(i = 0; i < tableDesc->NoOfAttributes; i++) { 02108 DictTabInfo::Attribute attrDesc; attrDesc.init(); 02109 s = SimpleProperties::unpack(it, 02110 &attrDesc, 02111 DictTabInfo::AttributeMapping, 02112 DictTabInfo::AttributeMappingSize, 02113 true, true); 02114 if(s != SimpleProperties::Break){ 02115 delete impl; 02116 NdbMem_Free((void*)tableDesc); 02117 DBUG_RETURN(703); 02118 } 02119 02120 NdbColumnImpl * col = new NdbColumnImpl(); 02121 col->m_attrId = attrDesc.AttributeId; 02122 col->setName(attrDesc.AttributeName); 02123 02124 // check type and compute attribute size and array size 02125 if (! attrDesc.translateExtType()) { 02126 delete impl; 02127 NdbMem_Free((void*)tableDesc); 02128 DBUG_RETURN(703); 02129 } 02130 col->m_type = (NdbDictionary::Column::Type)attrDesc.AttributeExtType; 02131 col->m_precision = (attrDesc.AttributeExtPrecision & 0xFFFF); 02132 col->m_scale = attrDesc.AttributeExtScale; 02133 col->m_length = attrDesc.AttributeExtLength; 02134 // charset in upper half of precision 02135 unsigned cs_number = (attrDesc.AttributeExtPrecision >> 16); 02136 // charset is defined exactly for char types 02137 if (col->getCharType() != (cs_number != 0)) { 02138 delete impl; 02139 NdbMem_Free((void*)tableDesc); 02140 DBUG_RETURN(703); 02141 } 02142 if (col->getCharType()) { 02143 col->m_cs = get_charset(cs_number, MYF(0)); 02144 if (col->m_cs == NULL) { 02145 delete impl; 02146 NdbMem_Free((void*)tableDesc); 02147 DBUG_RETURN(743); 02148 } 02149 } 02150 col->m_attrSize = (1 << attrDesc.AttributeSize) / 8; 02151 col->m_arraySize = attrDesc.AttributeArraySize; 02152 col->m_arrayType = attrDesc.AttributeArrayType; 02153 if(attrDesc.AttributeSize == 0) 02154 { 02155 col->m_attrSize = 4; 02156 col->m_arraySize = (attrDesc.AttributeArraySize + 31) >> 5; 02157 } 02158 col->m_storageType = attrDesc.AttributeStorageType; 02159 02160 col->m_pk = attrDesc.AttributeKeyFlag; 02161 col->m_distributionKey = attrDesc.AttributeDKey ? 2 : 0; 02162 col->m_nullable = attrDesc.AttributeNullableFlag; 02163 col->m_autoIncrement = (attrDesc.AttributeAutoIncrement ? true : false); 02164 col->m_autoIncrementInitialValue = ~0; 02165 col->m_defaultValue.assign(attrDesc.AttributeDefaultValue); 02166 02167 col->m_column_no = impl->m_columns.size(); 02168 impl->m_columns.push_back(col); 02169 it.next(); 02170 } 02171 02172 impl->computeAggregates(); 02173 02174 if(tableDesc->ReplicaDataLen > 0) 02175 { 02176 Uint16 replicaCount = ntohs(tableDesc->ReplicaData[0]); 02177 Uint16 fragCount = ntohs(tableDesc->ReplicaData[1]); 02178 02179 impl->m_replicaCount = replicaCount; 02180 impl->m_fragmentCount = fragCount; 02181 DBUG_PRINT("info", ("replicaCount=%x , fragCount=%x",replicaCount,fragCount)); 02182 for(i = 0; i < (Uint32) (fragCount*replicaCount); i++) 02183 { 02184 impl->m_fragments.push_back(ntohs(tableDesc->ReplicaData[i+2])); 02185 } 02186 02187 Uint32 topBit = (1 << 31); 02188 for(; topBit && !(fragCount & topBit); ){ 02189 topBit >>= 1; 02190 } 02191 impl->m_hashValueMask = topBit - 1; 02192 impl->m_hashpointerValue = fragCount - (impl->m_hashValueMask + 1); 02193 } 02194 else 02195 { 02196 impl->m_fragmentCount = tableDesc->FragmentCount; 02197 impl->m_replicaCount = 0; 02198 impl->m_hashValueMask = 0; 02199 impl->m_hashpointerValue = 0; 02200 } 02201 02202 impl->m_tablespace_id = tableDesc->TablespaceId; 02203 impl->m_tablespace_version = tableDesc->TablespaceVersion; 02204 02205 * ret = impl; 02206 02207 NdbMem_Free((void*)tableDesc); 02208 if (version < MAKE_VERSION(5,1,3)) 02209 { 02210 ; 02211 } 02212 else 02213 { 02214 DBUG_ASSERT(impl->m_fragmentCount > 0); 02215 } 02216 DBUG_RETURN(0); 02217 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool NdbDictInterface::setTransporter | ( | class TransporterFacade * | tf | ) |
| bool NdbDictInterface::setTransporter | ( | class Ndb * | ndb, | |
| class TransporterFacade * | tf | |||
| ) |
Definition at line 1568 of file NdbDictionaryImpl.cpp.
References NdbWaiter::m_mutex, m_reference, m_transporter, and m_waiter.
Referenced by NdbDictionaryImpl::setTransporter().
01569 { 01570 m_reference = ndb->getReference(); 01571 m_transporter = tf; 01572 m_waiter.m_mutex = tf->theMutexPtr; 01573 01574 return true; 01575 }
Here is the caller graph for this function:

| int NdbDictInterface::stopSubscribeEvent | ( | class Ndb & | ndb, | |
| NdbEventOperationImpl & | ||||
| ) |
Definition at line 3624 of file NdbDictionaryImpl.cpp.
References CAST_PTR, DBDICT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dictSignal(), NdbApiSignal::getDataPtrSend(), GSN_SUB_STOP_REQ, NdbEventImpl::m_eventId, NdbEventOperationImpl::m_eventImpl, NdbEventImpl::m_eventKey, NdbEventOperationImpl::m_oid, m_reference, NULL, SubStopReq::part, SubStopReq::subscriberData, SubStopReq::subscriberRef, SubStopReq::subscriptionId, SubStopReq::subscriptionKey, SubscriptionData::TableData, SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theVerId_signalNumber, and WAIT_CREATE_INDX_REQ.
Referenced by NdbDictionaryImpl::stopSubscribeEvent().
03626 { 03627 DBUG_ENTER("NdbDictInterface::stopSubscribeEvent"); 03628 03629 NdbApiSignal tSignal(m_reference); 03630 // tSignal.theReceiversBlockNumber = SUMA; 03631 tSignal.theReceiversBlockNumber = DBDICT; 03632 tSignal.theVerId_signalNumber = GSN_SUB_STOP_REQ; 03633 tSignal.theLength = SubStopReq::SignalLength; 03634 03635 SubStopReq * req = CAST_PTR(SubStopReq, tSignal.getDataPtrSend()); 03636 03637 req->subscriptionId = ev_op.m_eventImpl->m_eventId; 03638 req->subscriptionKey = ev_op.m_eventImpl->m_eventKey; 03639 req->subscriberData = ev_op.m_oid; 03640 req->part = (Uint32) SubscriptionData::TableData; 03641 req->subscriberRef = m_reference; 03642 03643 DBUG_PRINT("info",("GSN_SUB_STOP_REQ subscriptionId=%d,subscriptionKey=%d," 03644 "subscriberData=%d",req->subscriptionId, 03645 req->subscriptionKey,req->subscriberData)); 03646 03647 DBUG_RETURN(dictSignal(&tSignal,NULL,0, 03648 0 /*use masternode id*/, 03649 WAIT_CREATE_INDX_REQ /*WAIT_SUB_STOP__REQ*/, 03650 -1, 100, 03651 0, -1)); 03652 }
Here is the call graph for this function:

Here is the caller graph for this function:

friend class Ndb [friend] |
Definition at line 506 of file NdbDictionaryImpl.hpp.
friend class NdbDictionaryImpl [friend] |
Definition at line 507 of file NdbDictionaryImpl.hpp.
UtilBuffer NdbDictInterface::m_buffer [private] |
Definition at line 556 of file NdbDictionaryImpl.hpp.
Referenced by create_file(), create_filegroup(), createEvent(), createIndex(), NdbDictionaryImpl::createTable(), dictSignal(), dropEvent(), execCREATE_EVNT_CONF(), execCREATE_FILE_CONF(), execCREATE_FILEGROUP_CONF(), execCREATE_TABLE_CONF(), execGET_TABINFO_CONF(), execLIST_TABLES_CONF(), get_file(), get_filegroup(), getTable(), and listObjects().
Definition at line 498 of file NdbDictionaryImpl.hpp.
Referenced by createEvent(), createIndex(), createOrAlterTable(), dictSignal(), dropIndex(), dropTable(), NdbDictionaryImpl::dropTable(), execALTER_TABLE_REF(), execCREATE_EVNT_REF(), execCREATE_FILE_REF(), execCREATE_FILEGROUP_REF(), execCREATE_INDX_REF(), execCREATE_TABLE_REF(), execDROP_EVNT_REF(), execDROP_FILE_REF(), execDROP_FILEGROUP_REF(), execDROP_INDX_REF(), execDROP_TABLE_REF(), execGET_TABINFO_REF(), execSUB_START_CONF(), execSUB_START_REF(), execSUB_STOP_REF(), forceGCPWait(), get_file(), get_filegroup(), getNdbError(), getTable(), and listObjects().
Uint32 NdbDictInterface::m_fragmentId [private] |
Uint32 NdbDictInterface::m_masterNodeId [private] |
Definition at line 501 of file NdbDictionaryImpl.hpp.
Referenced by dictSignal(), execALTER_TABLE_REF(), execCREATE_EVNT_REF(), execCREATE_FILE_REF(), execCREATE_FILEGROUP_REF(), execCREATE_INDX_REF(), execCREATE_TABLE_REF(), execDROP_EVNT_REF(), execDROP_FILE_REF(), execDROP_FILEGROUP_REF(), execDROP_INDX_REF(), execDROP_TABLE_REF(), execSUB_START_REF(), execSUB_STOP_REF(), and NdbDictInterface().
Uint32 NdbDictInterface::m_reference [private] |
Definition at line 500 of file NdbDictionaryImpl.hpp.
Referenced by Ndb::connected(), create_file(), create_filegroup(), createEvent(), createIndex(), dictSignal(), drop_file(), drop_filegroup(), dropEvent(), dropIndex(), dropTable(), executeSubscribeEvent(), forceGCPWait(), get_file(), get_filegroup(), getTable(), listObjects(), NdbDictInterface(), setTransporter(), and stopSubscribeEvent().
class TransporterFacade* NdbDictInterface::m_transporter [private] |
Definition at line 504 of file NdbDictionaryImpl.hpp.
Referenced by dictSignal(), forceGCPWait(), listObjects(), NdbDictInterface(), and setTransporter().
NdbWaiter NdbDictInterface::m_waiter [private] |
Definition at line 503 of file NdbDictionaryImpl.hpp.
Referenced by dictSignal(), execALTER_TABLE_CONF(), execALTER_TABLE_REF(), execCREATE_EVNT_CONF(), execCREATE_EVNT_REF(), execCREATE_FILE_CONF(), execCREATE_FILE_REF(), execCREATE_FILEGROUP_CONF(), execCREATE_FILEGROUP_REF(), execCREATE_INDX_CONF(), execCREATE_INDX_REF(), execCREATE_TABLE_CONF(), execCREATE_TABLE_REF(), execDROP_EVNT_CONF(), execDROP_EVNT_REF(), execDROP_FILE_CONF(), execDROP_FILE_REF(), execDROP_FILEGROUP_CONF(), execDROP_FILEGROUP_REF(), execDROP_INDX_CONF(), execDROP_INDX_REF(), execDROP_TABLE_CONF(), execDROP_TABLE_REF(), execGET_TABINFO_CONF(), execGET_TABINFO_REF(), execLIST_TABLES_CONF(), execNodeStatus(), execSUB_START_CONF(), execSUB_START_REF(), execSUB_STOP_CONF(), execSUB_STOP_REF(), execWAIT_GCP_CONF(), execWAIT_GCP_REF(), forceGCPWait(), listObjects(), and setTransporter().
1.4.7

