Hello libpqxx-ML,

i'm not sure if i misunderstood something or if i did something
wrong, can you help me with this?

I wrote a little program using libpqxx-2.5.1 on amd64. I linked with
-lpqxx -lpq. It uses the tablereader-feature. When I installed the
program on a x86-machine (pentium4), my little program segfaulted. So
I talked with gdb and it seems that tablereader takes one loop longer
on x86. 

Code:


                vector<std::string> vtpl;
                connection cn("");
                work copy_n_dump(cn, "fetch_rp_los");
                copy_n_dump.exec(drop_tmp_table);
                copy_n_dump.exec(create_and_insert_into_tmp_table);
                tablereader rd(copy_n_dump, tmp_tname);

                do {
                        vtpl.clear();
                        rd >> vtpl;
                        t.mutate_by_iterator(vtpl.begin(), vtpl.end());
                        ltpls.push_back(t);

                } while (rd);
                rd.complete();

                copy_n_dump.commit();

The segfault appeared in t.mutate_by_iterator() because i didn't check
whether vtpl.empty(). In gdb i saw an emtpy vector vtpl. 

On the other machine (amd64) everything was fine without the
check.

Should it be like that?

Best Regards,
Johannes Brügmann
-- 




_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to