Skip to content

Commit c3ad7cb

Browse files
authored
Make it compatible with MySQL 8 (#6)
`my_bool` does not exist anymore, use it only for MySQL versions < 8
1 parent 2338f2c commit c3ad7cb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/InfoLoggerDispatchSQL.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#include "InfoLoggerDispatch.h"
22
#include <mysql.h>
3+
#include <mysql_version.h>
34
#include "utility.h"
45
#include "infoLoggerMessage.h"
56
#include <unistd.h>
67
#include <string.h>
78

9+
#if LIBMYSQL_VERSION_ID >= 80000
10+
typedef bool my_bool;
11+
#endif
812

913
// some constants
1014
#define SQL_RETRY_CONNECT 1 // base retry time, will be sleeping up to 10x this value

src/infoLoggerServer_insert_sql.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@
2121
#include <unistd.h>
2222

2323
#include <mysql.h>
24+
#include <mysql_version.h>
2425
#include <sys/time.h>
2526

2627
#define SQL_RETRY_CONNECT 10 /* base retry time, will be sleeping up to 10x this value */
2728

2829
#include "infoLoggerMessage.h"
2930
#include "infoLoggerConfig.h"
3031

32+
#if LIBMYSQL_VERSION_ID >= 80000
33+
typedef bool my_bool;
34+
#endif
35+
3136
extern void infoLog_msg_destroy(infoLog_msg_t *m);
3237
extern t_infoLoggerConfig cfg; /* infoLoggerServer configuration */
3338

0 commit comments

Comments
 (0)