I put together some code that reproduces the problem, the archive includes a
CMake project I use to build and a brief README describing the build process
and mysql setup.
http://cornsyrup.org/~jason/mysqlpp310bug.tgz
For the sake of the mailing list archive, here is the full code:
#include <mysql++/mysql++.h>
#include <mysql++/ssqls.h>
#include <mysql++/sql_types.h>
#include <vector>
#include <iostream>
sql_create_15(triples,
2, 15,
mysqlpp::sql_bigint_unsigned, version,
mysqlpp::sql_blob, hash,
mysqlpp::sql_blob, source,
mysqlpp::sql_blob, target,
mysqlpp::sql_blob, optype,
mysqlpp::sql_varchar, space,
mysqlpp::sql_smallint, vlocality,
mysqlpp::Null<mysqlpp::sql_blob>, inner_source,
mysqlpp::Null<mysqlpp::sql_blob>, inner_target,
mysqlpp::Null<mysqlpp::sql_blob>, inner_optype,
mysqlpp::sql_int_unsigned, created,
mysqlpp::sql_int_unsigned, updated,
mysqlpp::Null<mysqlpp::sql_varchar>, updated_by,
mysqlpp::Null<mysqlpp::sql_tinyint>, fact,
mysqlpp::Null<mysqlpp::sql_bigint_unsigned>, last_version)
int main(int argc, char *argv[]) {
if (argc < 4) return 1;
mysqlpp::Connection c(argv[1], argv[2], argv[3], "");
mysqlpp::Query q = c.query();
q << "SELECT ";
q << "T0.hash, T0.version, T0.source, T0.target, T0.optype, T0.space,";
q << "T0.inner_source, T0.inner_target, T0.inner_optype,";
q << "T0.fact, T0.created, T0.updated, T0.updated_by";
q << " FROM triples T0 WHERE source=unhex(%0q) AND optype=unhex(%1q)";
q << " LIMIT " << 1;
q.parse();
std::vector<triples> rows;
std::string sh2 = "4A81DCB6CA82C3A2219A064BC47BF5";
std::string oh2 = "3E06E4D97980";
try {
std::cerr << "query: " << q.str(sh2, oh2) << std::endl;
q.storein(rows, sh2, oh2);
} catch (std::exception &e) {
std::cerr << "exception what: " << e.what() << std::endl;
}
return 0;
}
Thanks, Jason T.