[odb-users] Problem connecting a mysql server

Boris Kolpackov boris at codesynthesis.com
Wed May 16 07:59:42 EDT 2012


Hi Peter,

Sorry about that link for ODBC. For some reason I got the impression
that you are using MS SQL Server but now I see it is MySQL.

> Here comes the stacktrace:
>
> [...]

Thanks, that's helpful. Can you modify the common/auto/driver.cxx
file by replacing this code fragment starting on line 56:

        auto_ptr<object> o1 (db->load<object> (id1));
        auto_ptr<object> o2 (db->load<object> (id2));
        auto_ptr<object> o3 (db->load<object> (id3));

With this:

        try
        {
          auto_ptr<object> o1 (db->load<object> (id1));
          auto_ptr<object> o2 (db->load<object> (id2));
          auto_ptr<object> o3 (db->load<object> (id3));
        }
        catch (const odb::exception& e)
        {
          cerr << e.what () << endl;
          return 1;
        }
        catch (const std::exception& e)
        {
          cerr << "std: " << e.what () << endl;
          return 1;
        }

Then re-run the test (i.e., run make check in common/auto/) and
let me know what it prints?

Boris



More information about the odb-users mailing list