List:MySQL++« Previous MessageNext Message »
From:jujulj Date:August 11 2008 7:06pm
Subject:problem with fetch_row()
View as plain text  
hi,

when running the query shown below, the loop always stops at the same
point (after 1128 fetch_row) without any error message nor warning.
It seems stuck and does not continue the program.

The table fingerprints is quite big (32M rows). Can it be why it does
not work? I tried in Python using MySQLdb and it works ok.

Any suggestions?

Thank you!




 try
    {

        mysqlpp::Query query = conn.query("select fingerprint,
count(*) from fingerprints group by fingerprint order by
fingerprint;");
        if (mysqlpp::UseQueryResult res = query.use())
        {

            while (mysqlpp::Row row = res.fetch_row()) {
                cout<<row[0]<<";"<<row[1]<<"\n";
            }

        }
        else
        {
            cerr << "Failed to get result: " << query.error() << endl;
            return -1;
        }
    }

    catch (const mysqlpp::BadQuery& er) {
        // Handle any query errors
        cerr << "Query error: " << er.what() << endl;
        return -1;
    }
    catch (const mysqlpp::BadConversion& er) {
        // Handle bad conversions
        cerr << "Conversion error: " << er.what() << endl <<
                "\tretrieved data size: " << er.retrieved <<
                ", actual size: " << er.actual_size << endl;
        return -1;
    }
    catch (const mysqlpp::Exception& er) {
        // Catch-all for any other MySQL++ exceptions
        cerr << "Error: " << er.what() << endl;
        return -1;
    }
Thread
problem with fetch_row()jujulj11 Aug
  • Re: problem with fetch_row()Warren Young11 Aug
    • Re: problem with fetch_row()jujulj12 Aug
    • Re: problem with fetch_row()jujulj12 Aug
    • Re: problem with fetch_row()jujulj12 Aug
  • Re: problem with fetch_row()Warren Young12 Aug