From 76f4b021b087060116c22412f59dd3266c80c39b Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 4 Jul 2025 02:12:50 +0500 Subject: fix: my_bool exists in old mysql versions, but not in latest (cross platform fix) --- bot/src/database.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bot/src/database.hpp') diff --git a/bot/src/database.hpp b/bot/src/database.hpp index 8bc1721..1958428 100644 --- a/bot/src/database.hpp +++ b/bot/src/database.hpp @@ -209,7 +209,11 @@ namespace bot::db { std::vector bind_res(num_fields); std::vector bufs(num_fields); std::vector lengths_out(num_fields); +#if MYSQL_VERSION_ID >= 80000 std::vector is_null(num_fields); +#else + std::vector is_null(num_fields); +#endif for (int i = 0; i < num_fields; i++) { bufs[i].resize(1024); @@ -218,7 +222,11 @@ namespace bot::db { bind_res[i].buffer = bufs[i].data(); bind_res[i].buffer_length = bufs[i].size(); bind_res[i].length = &lengths_out[i]; +#if MYSQL_VERSION_ID >= 80000 bind_res[i].is_null = reinterpret_cast(&is_null[i]); +#else + bind_res[i].is_null = &is_null[i]; +#endif } if (mysql_stmt_bind_result(stmt, bind_res.data())) { -- cgit v1.2.3