Bug #5442 MySQL++ not 64-bit ready?
Submitted: 7 Sep 2004 8:20 Modified: 9 Nov 2004 17:19
Reporter: Greg Newby Email Updates:
Status: Won't fix Impact on me:
Category:MySQL++ Severity:S2 (Serious)
Version:1.7.15 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[7 Sep 2004 8:20] Greg Newby
I've been unable to get correct results from a few test programs on IA64 and AMD64 systems running Linux.  It looks like there are data size/alignment issues with output, using both ResUse and Result classes.  I've tested this on several different Linux system, against another system with the same software.  I've also tried 1.7.14, a few different MySQLs (4.0.18 and 4.1.3gamma).  This is with MySQL++ built from scratch.  gcc/g++ 3.2.2 and 3.4.0, also Intel's C++ version 8.

I've used strace and the mysql command line to observe that correct data are arriving from mysqld.  I've also queried a 64 bit server from 32 bit client and vice-versa, to confirm the problem is with the MySQL client, not the server.

How to repeat:
Here's one of my tables:

CREATE TABLE `inv0gov2small` (
  `termid` int(10) unsigned NOT NULL default '0',
  `docid` int(10) unsigned NOT NULL default '0',
  `offset` smallint(5) unsigned NOT NULL default '0',
  `weight_in_subdoc` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`termid`,`docid`,`offset`,`weight_in_subdoc`)

The sequence to retrieve it is straight out of examples/simple1.cc, either with query.store or query.use.  In my test cases, the odd columns' values were truncated (i.e., 153 became 15) and the even columns' values became 0.

Suggested fix:
I could not find where things were going wrong in sqlplusint, but suspect there is something about data alignment or sizes as the Row values are populated.  My output is by setting a Result::iterator i to Result res.begin(), setting a Row row=*i; and getting values using either cout << row[0] etc. (as in simple1.cc and other examples) or using strtol or similar to get data to the right data type.

If it would help, I can provide more details, run test programs, or provide access to some of my 64 bit servers for developers.
[2 Nov 2004 15:58] MySQL Verification Team
No, MySQL++ is not 64-bit ready.

But you could try to make it 64-bit compatible.

I do not know how 1.7.15 is doing in this respect, but you could ask question on

Try making C API 64-bit ready, then build 1.7.15 carefully.

If that does not help try finding 1.7.9 with all patches for GCC 3.3.2.

It truly depends on the compiler you are using. G++ 3.3.2 should be able to make
1.7.9 with all patches 64-bit compatible.
[9 Nov 2004 17:19] MySQL Verification Team
MySQL++ is no longer maintained by MySQL AB