List:MySQL++« Previous MessageNext Message »
From:Benjamin Johnson Date:June 21 2011 10:12pm
Subject:Unsigned 64-bit Issue
View as plain text  
On Windows 7, the following example works fine with MySQL 5.5.9 x64.  On
Windows 2008r2, it returns 0 with the same MySQL version.  I'm using MySQL
Connector C 6.0.2 and mysql++ 3.1.0.  I am building with Visual Studio 2008.

I described my issue here:

http://stackoverflow.com/questions/6431794/mysql-win-2008-64-bit-issue


I'm including the code that reproduces it.  It works fine if the number is
smaller than the maximum signed bigint.

#include <mysql++/mysql++.h>
#include <mysql++/ssqls.h>

sql_create_1(test_item,
1, 0,
mysqlpp::sql_bigint_unsigned, host_guid);

int _tmain()
{
mysqlpp::Connection conn(false);
conn.set_option(new mysqlpp::MultiStatementsOption(true));

if (conn.connect("db", "localhost", "r", "p"))
{
    mysqlpp::Query query = conn.query();
    query << "select 15216036968564760613 as host_guid";
    query.parse();

    std::vector<test_item> items;
    query.storein(items);
    for(int i = 0; i < items.size(); ++i)
    {
        std::cout <<  items.at(i).host_guid << std::endl;
    }
}
return 0;
}


Any thoughts?

Thanks,

Ben

Thread
Unsigned 64-bit IssueBenjamin Johnson22 Jun
  • Re: Unsigned 64-bit IssueWarren Young22 Jun
    • Re: Unsigned 64-bit IssueBenjamin Johnson22 Jun
      • Re: Unsigned 64-bit IssueBenjamin Johnson22 Jun
        • Re: Unsigned 64-bit IssueWarren Young22 Jun