Compatibility between MySQL versions improved, ease compilation
This commit is contained in:
parent
dbeaaecc03
commit
cb74130ca3
|
@ -4,26 +4,11 @@ mysql_CFLAGS = `mysql_config --cflags`
|
||||||
|
|
||||||
vn_mysql_libdir = /usr/lib/mysql/plugin
|
vn_mysql_libdir = /usr/lib/mysql/plugin
|
||||||
|
|
||||||
if MYSQL8
|
|
||||||
|
|
||||||
MYSQLD_SOURCE = /var/mysql/mysql-8.0.15
|
|
||||||
vn_mysql_CFLAGS = \
|
vn_mysql_CFLAGS = \
|
||||||
-Wall -O3 \
|
-Wall -O3 \
|
||||||
-DMYSQL8=1 \
|
|
||||||
-I$(MYSQLD_SOURCE)/include \
|
-I$(MYSQLD_SOURCE)/include \
|
||||||
-I$(MYSQLD_SOURCE) \
|
|
||||||
-I$(MYSQLD_SOURCE)/bld/include \
|
|
||||||
-I$(MYSQLD_SOURCE)libbinlogevents/export \
|
|
||||||
$(mysql_CFLAGS)
|
$(mysql_CFLAGS)
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
vn_mysql_CFLAGS = \
|
|
||||||
-Wall -O3 \
|
|
||||||
$(mysql_CFLAGS)
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
vn_mysql_LDFLAGS = \
|
vn_mysql_LDFLAGS = \
|
||||||
-no-undefined \
|
-no-undefined \
|
||||||
-module \
|
-module \
|
||||||
|
|
35
README.md
35
README.md
|
@ -10,21 +10,37 @@ Install basic tools for compiling.
|
||||||
$ apt-get install build-essential devscripts dh-autoreconf
|
$ apt-get install build-essential devscripts dh-autoreconf
|
||||||
```
|
```
|
||||||
|
|
||||||
Install MySQL and GLib development libraries.
|
Install MySQL development libraries.
|
||||||
```
|
```
|
||||||
$ apt-get install libmysqld-dev libglib2.0-dev
|
$ apt-get install libmysqld-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile and generate Debian package for MySQL 5.
|
If MySQL development libraries are not available for your distribution or MySQL
|
||||||
|
version you can obtain MySQL server source code from apt sources repository or
|
||||||
|
from MySQL page.
|
||||||
|
```
|
||||||
|
$ apt-get source mysql-community
|
||||||
|
```
|
||||||
|
|
||||||
|
Install GLib development libraries.
|
||||||
|
```
|
||||||
|
$ apt-get install libglib2.0-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Run autogen.
|
||||||
```
|
```
|
||||||
$ ./autogen.sh
|
$ ./autogen.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Compile and generate Debian package.
|
||||||
|
```
|
||||||
$ debuild -uc -us -b
|
$ debuild -uc -us -b
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile and generate Debian package for MySQL 8.
|
If development libraries are not available and you have downloaded the server
|
||||||
|
source code, you can tell the build command it's location.
|
||||||
```
|
```
|
||||||
$ ./autogen.sh
|
$ debuild --set-envvar MYSQLD_SOURCE=[mysqld_source_dir] -uc -us -b
|
||||||
$ debuild --set-envvar MYSQL8=TRUE -uc -us -b
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
@ -52,6 +68,13 @@ DROP FUNCTION IF EXISTS multimax;
|
||||||
DROP FUNCTION IF EXISTS sql_printf;
|
DROP FUNCTION IF EXISTS sql_printf;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
Obtain MySQL version from commandline.
|
||||||
|
```
|
||||||
|
$ mysql_config --version | cut -d "." -f 1
|
||||||
|
```
|
||||||
|
|
||||||
## Built with
|
## Built with
|
||||||
|
|
||||||
* [MySQL](https://dev.mysql.com/doc/refman/8.0/en/extending-mysql.html)
|
* [MySQL](https://dev.mysql.com/doc/refman/8.0/en/extending-mysql.html)
|
||||||
|
|
|
@ -13,8 +13,6 @@ AC_PROG_CXX
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
PKG_CHECK_MODULES([glib], [glib-2.0])
|
PKG_CHECK_MODULES([glib], [glib-2.0])
|
||||||
|
|
||||||
AM_CONDITIONAL([MYSQL8], [test ! -z "$MYSQL8"])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
proxy-auth/Makefile
|
proxy-auth/Makefile
|
||||||
|
|
|
@ -20,20 +20,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib-unix.h>
|
#include <glib-unix.h>
|
||||||
|
|
||||||
#ifndef MYSQL8
|
|
||||||
#define MYSQL_ABI_CHECK
|
#define MYSQL_ABI_CHECK
|
||||||
#endif
|
|
||||||
|
|
||||||
//#include <stdbool.h>
|
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <mysql/errmsg.h>
|
#include <mysql/errmsg.h>
|
||||||
#include <mysql/plugin_auth.h>
|
#include <mysql/plugin_auth.h>
|
||||||
|
|
||||||
#ifdef MYSQL8
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <mysql/plugin.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONFIG_FILE _CONFIG_DIR"/proxy-auth.ini"
|
#define CONFIG_FILE _CONFIG_DIR"/proxy-auth.ini"
|
||||||
#define SQL_FILE _SQL_DIR"/proxy-auth.sql"
|
#define SQL_FILE _SQL_DIR"/proxy-auth.sql"
|
||||||
|
|
||||||
|
@ -416,13 +408,15 @@ proxy_auth_handler = {
|
||||||
MYSQL_AUTHENTICATION_INTERFACE_VERSION,
|
MYSQL_AUTHENTICATION_INTERFACE_VERSION,
|
||||||
"mysql_clear_password", // Cleartext plugin required in the client
|
"mysql_clear_password", // Cleartext plugin required in the client
|
||||||
proxy_auth_plugin_main,
|
proxy_auth_plugin_main,
|
||||||
|
#if MYSQL_VERSION_ID >= 50700
|
||||||
generate_auth_string_hash,
|
generate_auth_string_hash,
|
||||||
validate_auth_string_hash,
|
validate_auth_string_hash,
|
||||||
set_salt,
|
set_salt,
|
||||||
AUTH_FLAG_PRIVILEGED_USER_FOR_PASSWORD_CHANGE,
|
AUTH_FLAG_PRIVILEGED_USER_FOR_PASSWORD_CHANGE,
|
||||||
#ifdef MYSQL8
|
#if MYSQL_VERSION_ID >= 80000
|
||||||
NULL
|
NULL
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
mysql_declare_plugin(proxy_auth) {
|
mysql_declare_plugin(proxy_auth) {
|
||||||
|
@ -433,7 +427,7 @@ mysql_declare_plugin(proxy_auth) {
|
||||||
"Proxy user authentication server-side plugin",
|
"Proxy user authentication server-side plugin",
|
||||||
PLUGIN_LICENSE_GPL,
|
PLUGIN_LICENSE_GPL,
|
||||||
proxy_auth_plugin_init,
|
proxy_auth_plugin_init,
|
||||||
#ifdef MYSQL8
|
#if MYSQL_VERSION_ID >= 80000
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
#endif
|
||||||
proxy_auth_plugin_deinit,
|
proxy_auth_plugin_deinit,
|
||||||
|
|
Reference in New Issue