[mysql][mariadb support]

Daniel KochmaƄski <[email protected]> Wed, 04 Jan 2017 12:43:44 +0100
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain

Hej,

MariaDB is a fork of Mysql which is used on some Linux distributions. It
is binary compatible with MySQL 5.x, but version string isn't recognized
by clsql-mysql. I'm attaching a patch which recognizes MariaDB correclty
for versions 10.x upwards.

See https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/

Best regards,
Daniel


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Add-MariaDB-support-mysql-fork.patch

From 9c17a4eff8887412549ae4c608608384f8f8cf7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= <[email protected]>
Date: Wed, 4 Jan 2017 12:10:34 +0100
Subject: [PATCH 1/2] Add MariaDB support (mysql fork)

---
 db-mysql/mysql-client-info.lisp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/db-mysql/mysql-client-info.lisp b/db-mysql/mysql-client-info.lisp
index 9b791df..73bf977 100644
--- a/db-mysql/mysql-client-info.lisp
+++ b/db-mysql/mysql-client-info.lisp
@@ -46,6 +46,11 @@
          (pushnew :mysql-client-v5.1 cl:*features*)))
       ((eql (schar *mysql-client-info* 0) #\6)
        (pushnew :mysql-client-v6 cl:*features*))
+      ;; MariaDB has different numbering scheme, but is binary
+      ;; compatible.
+      ((and (search "MariaDB" *mysql-client-info*)
+            (string-equal "10" *mysql-client-info* :end2 2))
+       (pushnew :mysql-client-v5 cl:*features*))
       (t
        (error "Unknown mysql client version '~A'." *mysql-client-info*)))))
 
-- 
2.11.0


--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: inline; filename=0002-Update-changelog.patch
Content-Transfer-Encoding: quoted-printable

From 7f1518ee38d79d162bebad6ab4edde041817840e Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?Daniel=3D20Kochma=3DC5=3D84ski?=3D <[email protected]=
u>
Date: Wed, 4 Jan 2017 12:11:55 +0100
Subject: [PATCH 2/2] Update changelog

---
 ChangeLog | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8827550..03f2735 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-01  Daniel Kochma=C5=84ski <[email protected]>
+	* db-mysql/mysql-client-info.lisp: Add recognition of
+	version 10.x of MariaDB client library.
+
 2016-01-26 Kevin Rosenberg <kevin-HJRc7zDS/[email protected]>
 	* Version 6.7.0 release
 	* sql/utils.lisp: Apply patch from Martin Simmons for
@@ -31,7 +35,7 @@
 	* Version 6.6.2 release
 	* db-oracle/oracle-sql.lisp: Remove extra hyphen, thanks to
 	Thomas Vossen
-=09
+
 2015-03-24 Russ Tyndall <[email protected]>
 	* sql/oodml.lisp: fixed call-next-method in the base of
 	read-sql-value and replaced with a continuable
--=20
2.11.0


--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable



--=20
Daniel Kochma=C5=84ski ;; aka jackdaniel | Przemy=C5=9Bl, Poland
TurtleWare - Daniel Kochma=C5=84ski      | www.turtleware.eu

"Be the change that you wish to see in the world." - Mahatma Gandhi

--=-=-=
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ0xTUUwgbWFp
bGluZyBsaXN0CkNMU1FMQGxpc3RzLmtwZS5pbwpodHRwOi8vbGlzdHMua3BlLmlvL2NnaS1iaW4v
bWFpbG1hbi9saXN0aW5mby9jbHNxbAo=

--=-=-=--