Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Compile-time bug in 3.51.12 (driver/results.c)

Compile-time bug in 3.51.12 (driver/results.c)

2006-07-13       - By Tim Cartwright

 Back
OK, I gave up on using MySQL Connector/ODBC 3.51.12 with iODBC 3.52.3  
and MySQL 4.1.19 (see previous post). Instead of iODBC, I switched to  
unixODBC 2.2.11.

For me, building MyODBC 3.51.12 against unixODBC 2.2.11 flat out  
fails. Here's the final compilation command and resulting error:

gcc -DHAVE_CONFIG_H -I. -I. -I. -L/home/cat/myodbc-manual-nmi-build/
globus/lib -L/home/cat/myodbc-manual-nmi-build/unixodbc/lib -I/home/
cat/myodbc-manual-nmi-build/unixodbc/include -O3 -DDBUG_OFF -L/home/
cat/myodbc-manual-nmi-build/globus/lib -L/home/cat/myodbc-manual-nmi-
build/unixodbc/lib -I/home/cat/myodbc-manual-nmi-build/mysql/include/
mysql -MT results.lo -MD -MP -MF .deps/results.Tpo -c results.c  -
fPIC -DPIC -o .libs/results.o
results.c:563: conflicting types for `SQLColAttribute'
/home/cat/myodbc-manual-nmi-build/unixodbc/include/sql.h:603:  
previous declaration of `SQLColAttribute'

Here's the relevant unixODBC code in sql.h (formatted for email):

#if (ODBCVER >= 0x0300)
  SQLRETURN  SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);

  SQLRETURN  SQL_API SQLColAttribute (
    SQLHSTMT StatementHandle,
    SQLUSMALLINT ColumnNumber,
    SQLUSMALLINT FieldIdentifier,
    SQLPOINTER CharacterAttribute,
    SQLSMALLINT BufferLength,
    SQLSMALLINT *StringLength,
    SQLPOINTER NumericAttribute
    /* spec says (SQLPOINTER) not (SQLEN*) - PAH */
  );
#endif

And here's the code from driver/results.c:

//#if defined(__APPLE__)
  SQLRETURN SQL_API SQLColAttribute(
    SQLHSTMT  StatementHandle,
    SQLUSMALLINT ColumnNumber,
    SQLUSMALLINT FieldIdentifier,
    SQLPOINTER  CharacterAttributePtr,
    SQLSMALLINT BufferLength,
    SQLSMALLINT *StringLengthPtr,
    SQLLEN *  NumericAttributePtr
  )
/*#else
  SQLRETURN SQL_API SQLColAttribute(
    SQLHSTMT  StatementHandle,
    SQLUSMALLINT ColumnNumber,
    SQLUSMALLINT FieldIdentifier,
    SQLPOINTER  CharacterAttributePtr,
    SQLSMALLINT BufferLength,
    SQLSMALLINT *StringLengthPtr,
    SQLPOINTER  NumericAttributePtr
  )
#endif*/

Because the compiler directives are commented out, the compiler sees  
the first version of SQLColAttribute in results.c and it does indeed  
conflict with the unixODBC definition.

On a hunch, I removed the comment characters from this part of  
results.c and tried again.  With the compiler directives in place and  
with compiling on Linux (not Mac OS X), the second, compatible  
definition of SQLColAttribute should have been used.  The compilation  
succeeded through to the end.  I don't have any runtime results yet,  
but should soon.

Hope that helps.

--
Tim Cartwright, Condor Project & VDT
University of Wisconsin-Madison, Computer Science Dept.
1210 West Dayton Street, Room 4265; Madison, WI 53706; USA
Tel: +1 608 262 4002 / Email: cat@(protected)

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc?unsub=mysql@(protected)