[MDEV-4195] Header files differ from MySQL -- mysql-connector-odbc unable to be build Created: 2013-02-22  Updated: 2013-02-26  Resolved: 2013-02-26

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.29
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Honza Horak Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None

Attachments: File mysql-connector-odbc-maria.patch    

 Comments   
Comment by Honza Horak [ 2013-02-22 ]

Sorry, I've hit enter too early..

The problem is that declaration of some symbols is not the same, particularly:
_dig_vec_lower, _dig_vec_upper, insert_dynamic – in all cases there is "const" added in mariadb

Comment by Honza Horak [ 2013-02-22 ]

To describe the issue better – this is how a patch for mysql-connector-odbc has to look like, to be able to be built against mariadb.

Comment by Honza Horak [ 2013-02-22 ]

I understand it should be more correct to use "const" types, but in this case it breaks applications that works with original mysql well. So I'd suggest to remove "const" in these cases.

Comment by Honza Horak [ 2013-02-22 ]

I should have also mentioned that I'm building mysql-connector-odbc-5.1.11 against mariadb-5.5.29.

Comment by Vladislav Vaintroub [ 2013-02-22 ]

I understand the issue that myodbc reuses server code, by simple copy and paste verbatim from the server code, thus it has the same function and global variable names, only that myodbc does not have const? Would not it be more logical to rename MyODBC functions and variables in this case. Also, what´did not actually work? Was there a compile error? That would be surprising, since C is not particularly strict about const (not to a point that it would produce compile errors)

Comment by Honza Horak [ 2013-02-25 ]

Yeah, I should have added some more info..

The file is compiling using this command:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../driver -I.. -I/usr/include -O3 -DDBUG_OFF -I/usr/include/mysql -I/usr/include/mysql/.. -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-strict-aliasing -DTHREAD=1 -UMY_PTHREAD_FASTMUTEX -c array.c  -fPIC -DPIC -o .libs/array.o

And it produces this compilation error:

array.c:95:9: error: conflicting types for 'insert_dynamic'
 my_bool insert_dynamic(DYNAMIC_ARRAY *array, uchar* element)
         ^
In file included from mysys_priv.h:17:0,
                 from array.c:18:
/usr/include/mysql/my_sys.h:773:16: note: previous declaration of 'insert_dynamic' was here
 extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar * element);
                ^

The same case is for _dig_vec_lower and _dig_vec_upper.

Well, yes, fixing myodbc would be simple. But I'm thinking about other 3rd party applications, that can suffer from the same issue and would have to be fixed as well.

Comment by Vladislav Vaintroub [ 2013-02-25 ]

Hmm.. I see no array.c in MyODBC code (I'm looking at http://bazaar.launchpad.net/~mysql/myodbc/5.1/files/head:/driver/ ). I'm still wondering how you get this error

Comment by Honza Horak [ 2013-02-25 ]

Oh, my bad, sorry for confusing.. I've found where array.c turned up on my machine – in Fedora we're getting some mysys files from mysql/mariadb and manually add these to compile smoothly. That's also the case for array.c.

Well, in case the 3 symbols mentioned above are not meant to be used by 3rd party applications – feel free to close this bug as invalid.

Comment by Vladislav Vaintroub [ 2013-02-26 ]

As discussed , closing as "not a bug"

Generated at Thu Feb 08 06:54:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.