Strange bug
bobef
bobef at abv_nospam.bg
Mon Oct 1 12:46:09 PDT 2007
Hi,
This code is from dbi.mysql.mysqldatabase . I have commented few lines and later when I try to fetch some rows I get access violation in libmysql.dll . But if I uncoment the line with mysql_error or change it to something like "int a=0; if(a) mysql_error(connection);" it works. You guys have any ideas what could cause this? A linker error maybe?
override MysqlResult query (char[] sql) {
mysql_real_query(connection, toCString(sql), sql.length);
MYSQL_RES* results = mysql_store_result(connection);
if (results is null) {
//Cout("query(): ");
//Cout(toDString(mysql_error(connection)));
//Cout("\n").flush;
throw new DBIException("Unable to query the MySQL database.", sql);
}
assert (results !is null);
return new MysqlResult(results);
}
More information about the Digitalmars-d
mailing list