Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4195

Header files differ from MySQL -- mysql-connector-odbc unable to be build

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.29
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Gliffy Diagrams

        Attachments

          Activity

          Hide
          hhorak Honza Horak added a comment -

          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

          Show
          hhorak Honza Horak added a comment - 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
          Hide
          hhorak Honza Horak added a comment -

          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.

          Show
          hhorak Honza Horak added a comment - 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.
          Hide
          hhorak Honza Horak added a comment -

          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.

          Show
          hhorak Honza Horak added a comment - 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.
          Hide
          hhorak Honza Horak added a comment -

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

          Show
          hhorak Honza Horak added a comment - I should have also mentioned that I'm building mysql-connector-odbc-5.1.11 against mariadb-5.5.29.
          Hide
          wlad Vladislav Vaintroub added a comment - - edited

          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)

          Show
          wlad Vladislav Vaintroub added a comment - - edited 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)
          Hide
          hhorak Honza Horak added a comment -

          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.

          Show
          hhorak Honza Horak added a comment - 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.
          Hide
          wlad Vladislav Vaintroub added a comment - - edited

          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

          Show
          wlad Vladislav Vaintroub added a comment - - edited 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
          Hide
          hhorak Honza Horak added a comment -

          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.

          Show
          hhorak Honza Horak added a comment - 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.
          Hide
          wlad Vladislav Vaintroub added a comment -

          As discussed , closing as "not a bug"

          Show
          wlad Vladislav Vaintroub added a comment - As discussed , closing as "not a bug"

            People

            • Assignee:
              Unassigned
              Reporter:
              hhorak Honza Horak
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: