From: APTX Date: Fri, 6 Apr 2012 16:07:14 +0000 (-0400) Subject: pqxx fixes X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=c33fbf7feb4537bcd05b3e9d8a683ba6ffaa739f;p=libferris.git pqxx fixes --- diff --git a/Ferris/FCA.cpp b/Ferris/FCA.cpp index a32b030..11c5523 100644 --- a/Ferris/FCA.cpp +++ b/Ferris/FCA.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -1660,7 +1661,7 @@ namespace Ferris } #ifdef HAVE_LIBPQXX - static stringlist_t PGArrayToStringList( const result::field& s, stringlist_t& ret ) + static stringlist_t PGArrayToStringList( const pqxx::field& s, stringlist_t& ret ) { string str; s.to(str); @@ -2667,8 +2668,8 @@ namespace Ferris { int colNum = 0; result::const_iterator firsttuple = res.begin(); - result::tuple::const_iterator e = firsttuple->end(); - for( result::tuple::const_iterator cur = firsttuple->begin(); + tuple::const_iterator e = firsttuple->end(); + for( tuple::const_iterator cur = firsttuple->begin(); cur != e; ++cur ) { string name = cur->name(); @@ -2729,8 +2730,8 @@ namespace Ferris fh_concept ivc = m_conceptFactory_func( this, maxItemSetSizeInBits ); int colNum = 0; - result::tuple::const_iterator e = iter->end(); - for( result::tuple::const_iterator cur = iter->begin(); + tuple::const_iterator e = iter->end(); + for( tuple::const_iterator cur = iter->begin(); cur != e; ++cur ) { string name = cur->name(); @@ -2856,9 +2857,9 @@ namespace Ferris for( result::const_iterator iter = res.begin(); iter != res.end(); ++iter ) { int id = -1; - result::field idf = (*iter)[ "id" ]; - result::field parentsf = (*iter)[ "lattice_parents" ]; - result::field childrenf = (*iter)[ "lattice_children" ]; + pqxx::field idf = (*iter)[ "id" ]; + pqxx::field parentsf = (*iter)[ "lattice_parents" ]; + pqxx::field childrenf = (*iter)[ "lattice_children" ]; idf.to( id ); LG_FCA_D << " id:" << id << " parents:" << parentsf.c_str() << endl; @@ -4518,8 +4519,8 @@ namespace Ferris // The mdi 'hint' only works if the SQL query selects in order. // m_md_t::iterator mdi = m_md.end(); - result::tuple::const_iterator e = iter->end(); - for( result::tuple::const_iterator cur = iter->begin(); + tuple::const_iterator e = iter->end(); + for( tuple::const_iterator cur = iter->begin(); cur != e; ++cur ) { const char* name = cur->name(); @@ -4786,8 +4787,8 @@ namespace Ferris if( !res.empty() ) { result::const_iterator ri = res.begin(); - result::tuple::const_iterator e = ri->end(); - for( result::tuple::const_iterator cur = ri->begin(); cur != e; ++cur ) + tuple::const_iterator e = ri->end(); + for( tuple::const_iterator cur = ri->begin(); cur != e; ++cur ) { string name = cur->name(); const oid coltype = cur->type(); diff --git a/apps/fca/ferris-create-fca-tree.cpp b/apps/fca/ferris-create-fca-tree.cpp index e7d36b1..b722dbd 100644 --- a/apps/fca/ferris-create-fca-tree.cpp +++ b/apps/fca/ferris-create-fca-tree.cpp @@ -137,8 +137,8 @@ public: result::const_iterator c = res.begin(); if( c != res.end() ) { - result::tuple::const_iterator e = c->end(); - for( result::tuple::const_iterator cur = c->begin(); + ::pqxx::tuple::const_iterator e = c->end(); + for( ::pqxx::tuple::const_iterator cur = c->begin(); cur != e; ++cur ) { string name = cur->name(); @@ -447,7 +447,7 @@ int main( int argc, char** argv ) work trans( con, "getting the schema..." ); result res = trans.exec( "select * from docmap where docid < 0" ); - result::tuple::size_type res_col_sz = res.columns(); + ::pqxx::tuple::size_type res_col_sz = res.columns(); for( int i=0; iend(); - for( result::tuple::const_iterator cur = row->begin(); cur != e; ++cur ) + ::pqxx::tuple::const_iterator e = row->end(); + for( ::pqxx::tuple::const_iterator cur = row->begin(); cur != e; ++cur ) { string k = cur->name(); if( !k.length() ) @@ -226,8 +226,8 @@ namespace Ferris { #define SLEA tryAddStateLessAttribute - result::tuple::const_iterator e = m_iter->end(); - for( result::tuple::const_iterator cur = m_iter->begin(); cur != e; ++cur ) + ::pqxx::tuple::const_iterator e = m_iter->end(); + for( ::pqxx::tuple::const_iterator cur = m_iter->begin(); cur != e; ++cur ) { string k = cur->name(); if( !k.length() ) @@ -401,8 +401,8 @@ namespace Ferris for( result::const_iterator iter = res.begin(); iter != res.end(); ++iter ) { virgin = true; - result::tuple::const_iterator e = iter->end(); - for( result::tuple::const_iterator cur = iter->begin(); + ::pqxx::tuple::const_iterator e = iter->end(); + for( ::pqxx::tuple::const_iterator cur = iter->begin(); cur != e; ++cur ) { if(!virgin) ret << ","; @@ -516,7 +516,7 @@ namespace Ferris LG_PG_D << "read() sql:" << setupQuery() << endl; result res = trans.exec( setupQuery() ); - for (result::tuple::size_type c = 0; c < res.columns(); ++c) + for (::pqxx::tuple::size_type c = 0; c < res.columns(); ++c) { string k= res.column_name(c); if( !k.length() ) @@ -703,7 +703,7 @@ namespace Ferris result res = trans.exec( setupQuery() ); LG_PG_D << "DeterminePrimaryKey(with sql) have result..." << endl; - for (result::tuple::size_type c = 0; c < res.columns(); ++c) + for (::pqxx::tuple::size_type c = 0; c < res.columns(); ++c) { string k= res.column_name(c); if( !k.length() ) diff --git a/plugins/eaindexers/postgresql/libeaindexpostgresql.cpp b/plugins/eaindexers/postgresql/libeaindexpostgresql.cpp index e2462a7..c131a8e 100644 --- a/plugins/eaindexers/postgresql/libeaindexpostgresql.cpp +++ b/plugins/eaindexers/postgresql/libeaindexpostgresql.cpp @@ -4243,7 +4243,7 @@ namespace Ferris c[0].to( earl ); m_urlcache_ref row = new m_urlcache_t; - for ( result::tuple::const_iterator ti = c->begin(); ti != c->end(); ++ti ) + for ( ::pqxx::tuple::const_iterator ti = c->begin(); ti != c->end(); ++ti ) { string v = ti->c_str(); row->insert( make_pair( ti->name(), v ) );