diff options
author | Michael Widenius <monty@askmonty.org> | 2009-10-02 13:36:28 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-10-02 13:36:28 +0300 |
commit | f77e2692dcce37e23a643c4e7c83394ea553b5c3 (patch) | |
tree | 94fc513a0a750ec0c8502c7e031205bcc16f6b70 /libmysql | |
parent | 12f18c8800a949347a223fc38946c94d5aca0e8a (diff) | |
download | mariadb-git-f77e2692dcce37e23a643c4e7c83394ea553b5c3.tar.gz |
Added client functions:
- mysql_get_server_name()
This returns MySQL or MariaDB depending on the server type
- mariadb_connection()
This returns 1 if you are connected to a MariaDB server
Modifed the MySQL command line client to print out if you are connected to MariaDB or MySQL
Better default prompt (shows server you are connected to and base directory)
client/mysql.cc:
Print out if you are connected to MariaDB or MySQL
Better default prompt (shows server you are connected to and base directory)
Added option \N to prompt to print server name.
configure.in:
Changed maria to MariaDB in version string
include/mysql.h:
Added mysql_get_server_name() and mariadb_connection()
include/mysql.h.pp:
Update for new API functions
libmysql/libmysql.c:
Added client functions:
- mysql_get_server_name()
This returns MySQL or MariaDB depending on the server type
- mariadb_connection()
This returns 1 if you are connected to a MariaDB server
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 464cc5f870e..526dcf51e70 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1430,6 +1430,18 @@ mysql_get_server_info(MYSQL *mysql) } +my_bool STDCALL mariadb_connection(MYSQL *mysql) +{ + return strinstr(mysql->server_version, "MariaDB") != 0; +} + +const char * STDCALL +mysql_get_server_name(MYSQL *mysql) +{ + return mariadb_connection(mysql) ? "MariaDB" : "MySQL"; +} + + const char * STDCALL mysql_get_host_info(MYSQL *mysql) { |