user1902689
user1902689

Reputation: 1775

MariaDB (/usr/include/mysql and libmysqlclient) vs (/usr/include/mariadb libmariadbclient and libmariadb)

First, let me clarify everything here is MariaDB - nothing actually involving the MySQL code.

In Arch Linux, I'm running a MariaDB server and client. I installed the mariadb package which is built from the source at:

http://ftp.heanet.ie/mirrors/mariadb/mariadb-10.1.18/source/mariadb-10.1.18.tar.gz

This provides:

I have C++ applications that will access MariaDB, and I thought I also needed mariadb-connector-c, so I built tag v2.3.1 at

https://github.com/MariaDB/mariadb-connector-c

This provides:

Q1 -

What's the purpose and difference between libmysqlclient, libmariadbclient, and libmariadb? (Ignoring difference shared vs static library.)

Q2 -

/usr/include/mysql/mysql.h (from http://ftp.heanet.ie/mirrors/mariadb/mariadb-10.1.18/source/mariadb-10.1.18.tar.gz)

and

/usr/include/mariadb/mysql.h (from tag v2.3.1 at from https://github.com/MariaDB/mariadb-connector-c)

Are quite similar and have a lot of identical code, but are also way different.

I ran into that /usr/include/mysql/mysql.h defines:

const char * STDCALL mysql_error(MYSQL * myql);

But /usr/include/mariadb/mysql.h defines:

char * STDCALL mysql_error(MYSQL *mysql);

(Note the missing const on the return value.)

I got very confused at this point why the same function is declared in each, why they're different, which I should be using, etc.

NOTE I'm aware of mariadb++, but its last commit was 3.5 years ago, so I'm pretending it doesn't exist.

Upvotes: 3

Views: 3291

Answers (1)

Georg Richter
Georg Richter

Reputation: 7476

1) The main difference between libmysql and libmariadb (Connector/C) is the license: libmysql is licensed under GPL license, while Connector/C is licensed under the less restrictive LGPL license which will allow to use it closed source applications.

MariaDB Connector/C 2.3 (libmariadb= supports all api calls and public structures from libmysql. Version 3.0 (currently) beta offers a lot of new functionality which isn't implemented in libmysql.

Beginning of MariaDB Server version 10.2 (beta) Connector/C 3.0 will replace libmysql in the server package.

2) This a minor bug and already fixed

Upvotes: 3

Related Questions