Description: Guard my_bool typedef against MariaDB headers
 Make the my_bool typedef introduced for MySQL 8 conditional: MySQL 8.x
 removed my_bool from its client headers, while MariaDB still declares it
 as 'typedef char my_bool;'.  Only define the typedef when the client
 header is MySQL >= 8.0 and not MariaDB, so the package builds against
 both MySQL 8+ and MariaDB.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: no
Last-Update: 2026-09-04
---
--- mysqltcl-3.052.orig/generic/mysqltcl.c
+++ mysqltcl-3.052/generic/mysqltcl.c
@@ -41,7 +41,14 @@
 
 #include <tcl.h>
 #include <mysql.h>
+/* MySQL 8.x removed the my_bool typedef, so it must be reintroduced for
+ * the API to compile.  MariaDB, however, still declares 'typedef char my_bool;'
+ * in mysql.h; redefining it as bool (or as anything else) would cause a
+ * conflicting-types error.  Only define my_bool when the MySQL client header
+ * (>= 8.0) does not provide it (i.e. it is not MariaDB). */
+#if defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_VERSION_ID)
 typedef bool my_bool;
+#endif
 
 #include <errno.h>
 #include <string.h>

