diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-02 00:24:42 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-02 00:24:42 +0100 |
commit | 66581f5da35d43ec785b9d5861f5e61e1cdeec3c (patch) | |
tree | 025c06cdb397ff49bf6bc7e99e9ab5998a232798 | |
parent | d8acfecb06fe8353233cb006b60f985e02c12f2f (diff) | |
download | mariadb-git-66581f5da35d43ec785b9d5861f5e61e1cdeec3c.tar.gz |
bug, added error handling to information_schema files
-rw-r--r-- | sql/ha_ndbcluster.cc | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0dcdf83664d..4451577dd06 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -9608,10 +9608,14 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) Ndb *ndb= check_ndb_in_thd(thd); NdbDictionary::Dictionary* dict= ndb->getDictionary(); NdbDictionary::Dictionary::List dflist; + NdbError ndberr; - dict->listObjects(dflist,NdbDictionary::Object::Datafile); + dict->listObjects(dflist, NdbDictionary::Object::Datafile); + ndberr= dict->getNdbError(); + if (ndberr.classification != ndberror_cl_none) + return 0; - for(unsigned i= 0;i < dflist.count;i++) + for (unsigned i= 0; i < dflist.count; i++) { NdbDictionary::Dictionary::List::Element& elt = dflist.elements[i]; Ndb_cluster_connection_node_iter iter; @@ -9619,21 +9623,28 @@ 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); - int c=0; + ndberr= dict->getNdbError(); + if(ndberr.classification != ndberror_cl_none) + continue; + NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace()); + ndberr= dict->getNdbError(); + if (ndberr.classification != ndberror_cl_none) + continue; + + int c= 0; table->field[c++]->set_null(); // FILE_ID - table->field[c++]->store(elt.name,strlen(elt.name),system_charset_info); + table->field[c++]->store(elt.name, strlen(elt.name), + system_charset_info); table->field[c++]->store("DATAFILE",8,system_charset_info); - table->field[c++]->store(df.getTablespace(),strlen(df.getTablespace()), + table->field[c++]->store(df.getTablespace(), strlen(df.getTablespace()), system_charset_info); table->field[c++]->set_null(); // TABLE_CATALOG table->field[c++]->set_null(); // TABLE_SCHEMA table->field[c++]->set_null(); // TABLE_NAME - NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace()); - // LOGFILE_GROUP_NAME table->field[c++]->store(ts.getDefaultLogfileGroup(), strlen(ts.getDefaultLogfileGroup()), @@ -9662,7 +9673,7 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) table->field[c++]->store(df.getObjectVersion()); // VERSION - table->field[c++]->store("FIXED",5,system_charset_info); // ROW_FORMAT + table->field[c++]->store("FIXED", 5, system_charset_info); // ROW_FORMAT table->field[c++]->set_null(); // TABLE_ROWS table->field[c++]->set_null(); // AVG_ROW_LENGTH @@ -9675,40 +9686,50 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) table->field[c++]->set_null(); // CHECK_TIME table->field[c++]->set_null(); // CHECKSUM - table->field[c++]->store("NORMAL",6, system_charset_info); + table->field[c++]->store("NORMAL", 6, system_charset_info); char extra[30]; - int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u",id); - table->field[c]->store(extra,len,system_charset_info); + int len= my_snprintf(extra, sizeof(extra), "CLUSTER_NODE=%u", id); + table->field[c]->store(extra, len, system_charset_info); schema_table_store_record(thd, table); } } - dict->listObjects(dflist,NdbDictionary::Object::Undofile); + dict->listObjects(dflist, NdbDictionary::Object::Undofile); + ndberr= dict->getNdbError(); + if (ndberr.classification != ndberror_cl_none) + return 0; - for(unsigned i= 0;i < dflist.count;i++) + for (unsigned i= 0; i < dflist.count; i++) { - NdbDictionary::Dictionary::List::Element& elt = dflist.elements[i]; + NdbDictionary::Dictionary::List::Element& elt= dflist.elements[i]; Ndb_cluster_connection_node_iter iter; unsigned id; 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); - int c=0; + ndberr= dict->getNdbError(); + if (ndberr.classification != ndberror_cl_none) + continue; + NdbDictionary::LogfileGroup lfg= + dict->getLogfileGroup(uf.getLogfileGroup()); + ndberr= dict->getNdbError(); + if (ndberr.classification != ndberror_cl_none) + continue; + + int c= 0; table->field[c++]->set_null(); // FILE_ID - table->field[c++]->store(elt.name,strlen(elt.name),system_charset_info); - table->field[c++]->store("UNDO LOG",8,system_charset_info); + table->field[c++]->store(elt.name, strlen(elt.name), + system_charset_info); + table->field[c++]->store("UNDO LOG", 8, system_charset_info); table->field[c++]->set_null(); // TABLESPACE NAME table->field[c++]->set_null(); // TABLE_CATALOG table->field[c++]->set_null(); // TABLE_SCHEMA table->field[c++]->set_null(); // TABLE_NAME - NdbDictionary::LogfileGroup lfg= - dict->getLogfileGroup(uf.getLogfileGroup()); - // LOGFILE_GROUP_NAME table->field[c++]->store(uf.getLogfileGroup(), strlen(uf.getLogfileGroup()), @@ -9750,12 +9771,13 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond) table->field[c++]->set_null(); // CHECK_TIME table->field[c++]->set_null(); // CHECKSUM - table->field[c++]->store("NORMAL",6, system_charset_info); + table->field[c++]->store("NORMAL", 6, system_charset_info); char extra[30]; int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u",id); - table->field[c]->store(extra,len,system_charset_info); + table->field[c]->store(extra, len, system_charset_info); schema_table_store_record(thd, table); } } + return 0; } |