gearman / gearmand

http://gearman.org/
Other
738 stars 138 forks source link

error: unknown type name 'my_bool #165

Closed imKota closed 5 years ago

imKota commented 6 years ago

https://github.com/gearman/gearmand/blob/e2d76cf631414964decc2f22006a666e1c0e2424/libgearman-server/plugins/queue/mysql/queue.cc#L211

my_bool has been renamed to bool in MySQL 8.0. https://dev.mysql.com/doc/refman/8.0/en/c-api-prepared-statement-data-structures.html

esabol commented 6 years ago

That doesn't sound like it has anything to do with macOS?

imKota commented 6 years ago

@esabol yeah, sorry))

esabol commented 6 years ago

What about MariaDB compatibility? Do they still use my_bool or have they switched to bool as well?

imKota commented 6 years ago

@esabol I dont know. When I used mariadb, I had errors in the build. Which I still have not decided. So I compiled the project with mysql, removed mysql and then installed mariadb

esabol commented 6 years ago

https://mariadb.com/kb/en/library/mysql_bind/ would seem to indicate that MariaDB still uses my_bool.

We'll probably need configure to determine whether to use my_bool or bool and set an appropriate #define... EDIT: No. See next comment.

esabol commented 6 years ago

I've also seen the following used:

#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID) && \
  MYSQL_VERSION_ID >= 80001 && MYSQL_VERSION_ID != 80002
typedef bool my_bool;
#endif

#include <stdbool.h> is only needed in C code, and the only occurrence of my_bool in gearmand is in C++ code, so the above should work. Are you willing to test this, @imKota ?

See https://jira.mariadb.org/browse/MDEV-13773 and https://bugs.mysql.com/?id=87337

p-alik commented 5 years ago

fixed by @esabol in #212