olli hauer: > On 2018-02-25 23:00, olli hauer wrote: > > On 2018-02-25 17:19, Wietse Venema wrote: > ... > >> > >> #if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_VERSION_ID) > >> #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE > >> #elif MYSQL_VERSION_ID >= 50023 > >> #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT > >> MYSQL_OPT_SSL_VERIFY_SERVER_CERT > >> #endif > > I've updated the patch, since mariadb 10.0 also has a higher MYSQL_VERSION_ID > but does not define MARIADB_VERSION_ID. > > Testing against MARIADB_BASE_VERSION should do the trick, e.g. the values > from mariadb 5.5, 10.0 and 10.2 > #define MARIADB_BASE_VERSION "mariadb-5.5" > #define MARIADB_BASE_VERSION "mariadb-10.0" > #define MARIADB_BASE_VERSION "mariadb-10.2" > > Updated patch is attached or can be found here: > > https://people.freebsd.org/~ohauer/postfix.dict__mysql/patch-src_global_dict__mysql.c_v2.diff >
While we're improving the code, do you think that this would work: #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50023 #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT #elif MYSQL_VERSION_ID >= 80000 #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT #endif That is, have all the Mariadb-related conditions together on the same line, instead of distributing those conditions over two different lines. It's a style thing. Wietse