From fbad43132d2ec8c09ffe55a8f5f016a9566ab5e7 Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Tue, 7 Feb 2006 11:27:11 +0100 Subject: [PATCH 1/2] bug#16924 - ndb - insert wo/ specifying null on varsize attribute init both pos and len --- storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 0644d620eab..7305827b6ac 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -1114,9 +1114,12 @@ Dbtup::prepare_initial_insert(KeyReqStruct *req_struct, ptr= ALIGN_WORD(dst->m_data_ptr+regTabPtr->m_offsets[MM].m_max_var_offset); order += regTabPtr->m_attributes[MM].m_no_of_fixsize; Uint32 pos= 0; + Uint16 *pos_ptr = req_struct->var_pos_array; + Uint16 *len_ptr = pos_ptr + cnt1; for(Uint32 i= 0; im_offset_array_ptr[i]= pos; + * pos_ptr++ = pos; + * len_ptr++ = pos; pos += AttributeDescriptor::getSizeInBytes(tab_descr[*order++].tabDescr); } } From f964e1367f0484574bb5b6eb2e59ab0173c52f16 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Tue, 7 Feb 2006 12:16:24 +0100 Subject: [PATCH 2/2] Bug #17087 No warning on cluster failure for IS.FILES --- sql/ha_ndbcluster.cc | 53 ++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 34cdbe546c1..361401e22d6 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -9618,13 +9618,16 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) NdbDictionary::Dictionary* dict= ndb->getDictionary(); NdbDictionary::Dictionary::List dflist; NdbError ndberr; + unsigned i; + + DBUG_ENTER("ndbcluster_fill_files_table"); dict->listObjects(dflist, NdbDictionary::Object::Datafile); ndberr= dict->getNdbError(); - if (ndberr.classification != ndberror_cl_none) - return 0; + if (ndberr.classification != NdbError::NoError) + ERR_RETURN(ndberr); - for (unsigned i= 0; i < dflist.count; i++) + for (i= 0; i < dflist.count; i++) { NdbDictionary::Dictionary::List::Element& elt = dflist.elements[i]; Ndb_cluster_connection_node_iter iter; @@ -9632,16 +9635,24 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) g_ndb_cluster_connection->init_get_next_node(iter); - while (id= g_ndb_cluster_connection->get_next_node(iter)) + while ((id= g_ndb_cluster_connection->get_next_node(iter))) { NdbDictionary::Datafile df= dict->getDatafile(id, elt.name); ndberr= dict->getNdbError(); - if(ndberr.classification != ndberror_cl_none) - continue; + if(ndberr.classification != NdbError::NoError) + { + if (ndberr.classification == NdbError::SchemaError) + continue; + ERR_RETURN(ndberr); + } NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace()); ndberr= dict->getNdbError(); - if (ndberr.classification != ndberror_cl_none) - continue; + if (ndberr.classification != NdbError::NoError) + { + if (ndberr.classification == NdbError::SchemaError) + continue; + ERR_RETURN(ndberr); + } int c= 0; table->field[c++]->set_null(); // FILE_ID @@ -9706,10 +9717,10 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) dict->listObjects(dflist, NdbDictionary::Object::Undofile); ndberr= dict->getNdbError(); - if (ndberr.classification != ndberror_cl_none) - return 0; + if (ndberr.classification != NdbError::NoError) + ERR_RETURN(ndberr); - for (unsigned i= 0; i < dflist.count; i++) + for (i= 0; i < dflist.count; i++) { NdbDictionary::Dictionary::List::Element& elt= dflist.elements[i]; Ndb_cluster_connection_node_iter iter; @@ -9717,17 +9728,25 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) g_ndb_cluster_connection->init_get_next_node(iter); - while (id= g_ndb_cluster_connection->get_next_node(iter)) + while ((id= g_ndb_cluster_connection->get_next_node(iter))) { NdbDictionary::Undofile uf= dict->getUndofile(id, elt.name); ndberr= dict->getNdbError(); - if (ndberr.classification != ndberror_cl_none) - continue; + if (ndberr.classification != NdbError::NoError) + { + if (ndberr.classification == NdbError::SchemaError) + continue; + ERR_RETURN(ndberr); + } NdbDictionary::LogfileGroup lfg= dict->getLogfileGroup(uf.getLogfileGroup()); ndberr= dict->getNdbError(); - if (ndberr.classification != ndberror_cl_none) - continue; + if (ndberr.classification != NdbError::NoError) + { + if (ndberr.classification == NdbError::SchemaError) + continue; + ERR_RETURN(ndberr); + } int c= 0; table->field[c++]->set_null(); // FILE_ID @@ -9788,5 +9807,5 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) schema_table_store_record(thd, table); } } - return 0; + DBUG_RETURN(0); }