From 6df3f672313f8dbca219199c8ec8d20c0247347f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1s=20Guisasola?= <tomasguisasola@gmail.com>
Date: Mon, 31 Jul 2017 09:41:49 -0300
Subject: [PATCH] Add support for building with MariaDB (thanks to Florian
 Weimer).

---
 src/ls_mysql.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ls_mysql.c b/src/ls_mysql.c
index f80fae4..843153b 100644
--- a/src/ls_mysql.c
+++ b/src/ls_mysql.c
@@ -603,7 +603,12 @@ LUASQL_API int luaopen_luasql_mysql (lua_State *L) {
 	luaL_setfuncs(L, driver, 0);
 	luasql_set_info (L);
     lua_pushliteral (L, "_CLIENTVERSION");
-    lua_pushliteral (L, MYSQL_SERVER_VERSION);
+#ifdef MARIADB_CLIENT_VERSION_STR
+lua_pushliteral (L, MARIADB_CLIENT_VERSION_STR);
+#else
+lua_pushliteral (L, MYSQL_SERVER_VERSION);
+#endif
+    /*lua_pushliteral (L, MYSQL_SERVER_VERSION);*/
     lua_settable (L, -3);
 	return 1;
 }
