Description: fix FTBFS with MariaDB's conflicting my_bool declaration
 MariaDB's <mysql.h> already defines my_bool as char while
 mysql8_my_bool.patch reintroduces it as bool, leading to a
 conflicting declaration error with MySQL/MariaDB headers.
 Guard the typedef so my_bool is only (re)defined when the
 client library headers do not provide it (MySQL >= 8.0).
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: other
Forwarded: no
Last-Update: 2026-09-02

--- libodb-mysql-2.4.0.orig/odb/mysql/mysql-types.hxx
+++ libodb-mysql-2.4.0/odb/mysql/mysql-types.hxx
@@ -12,6 +12,13 @@
 #else
 #  include <mysql/mysql.h>
 #endif
+
+// my_bool is provided by the client library headers in all MySQL versions
+// before 8.0 (as char) and in all MariaDB versions. Only MySQL 8.0+ removed
+// it from the public headers, so (re)define it as bool there.
+#if !defined(MARIADB_BASE_VERSION) && \
+    (!defined(MYSQL_VERSION_ID) || MYSQL_VERSION_ID >= 80000)
 typedef bool my_bool;
+#endif
 
 #endif // ODB_MYSQL_MYSQL_TYPES_HXX
