Ignore:
Timestamp:
08/03/18 20:53:39 (6 years ago)
Author:
tbretz
Message:
Output some more connection information with print-connect
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fits2sql.cc

    r19135 r19136  
    464464    Database connection(uri);
    465465
     466    if (verbose>0)
     467    {
     468        cout << "Client Version: " << connection.client_version() << '\n';
     469        cout << "Server Version: " << connection.server_version() << endl;
     470    }
     471
    466472    if (print_connection)
    467473    {
     
    692698    }
    693699
     700    if (print_connection)
     701    {
     702        try
     703        {
     704            const auto &res1 = connection.query("SHOW STATUS LIKE 'Bytes_%'").store();
     705            cout << left << setw(16) << res1[0]["Variable_name"] << ' ' << Tools::Scientific(res1[0]["Value"]) << endl;
     706            cout << left << setw(16) << res1[1]["Variable_name"] << ' ' << Tools::Scientific(res1[1]["Value"]) << endl;
     707            cout << endl;
     708        }
     709        catch (const exception &e)
     710        {
     711            cerr << "\nSHOW STATUS LIKE 'Bytes_%'\n\n";
     712            cerr << "SQL query failed:\n" << e.what() << endl;
     713            return 6;
     714        }
     715    }
     716
    694717    return 0;
    695718}
Note: See TracChangeset for help on using the changeset viewer.