Skip to content

Commit f988a7e

Browse files
committed
Add new pkgplugindir handling to seperate plugins from libraries,
and allow override for binary distributions. Extend mysql_config to print compiled-in plugin location for third-party plugins to use. Resolves bug#31736.
1 parent e591fc7 commit f988a7e

16 files changed

Lines changed: 110 additions & 19 deletions

File tree

libmysqld/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ MYSQLDATAdir = $(localstatedir)
2121
MYSQLSHAREdir = $(pkgdatadir)
2222
MYSQLBASEdir= $(prefix)
2323
MYSQLLIBdir= $(libdir)
24+
pkgplugindir = $(libdir)/@PACKAGE@/plugin
2425

2526
EXTRA_DIST = libmysqld.def CMakeLists.txt
2627
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
2728
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
2829
-DDATADIR="\"$(MYSQLDATAdir)\"" \
2930
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
30-
-DLIBDIR="\"$(MYSQLLIBdir)\""
31+
-DPLUGINDIR="\"$(pkgplugindir)\""
3132
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
3233
-I$(top_builddir)/sql -I$(top_srcdir)/sql \
3334
-I$(top_srcdir)/sql/examples \
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
set autocommit=1;
2+
reset master;
3+
create table bug16206 (a int);
4+
insert into bug16206 values(1);
5+
start transaction;
6+
insert into bug16206 values(2);
7+
commit;
8+
show binlog events;
9+
Log_name Pos Event_type Server_id End_log_pos Info
10+
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
11+
f n Query 1 n use `test`; create table bug16206 (a int)
12+
f n Query 1 n use `test`; insert into bug16206 values(1)
13+
f n Query 1 n use `test`; insert into bug16206 values(2)
14+
drop table bug16206;
15+
reset master;
16+
create table bug16206 (a int) engine= bdb;
17+
insert into bug16206 values(0);
18+
insert into bug16206 values(1);
19+
start transaction;
20+
insert into bug16206 values(2);
21+
commit;
22+
insert into bug16206 values(3);
23+
show binlog events;
24+
Log_name Pos Event_type Server_id End_log_pos Info
25+
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
26+
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
27+
f n Query 1 n use `test`; insert into bug16206 values(0)
28+
f n Query 1 n use `test`; insert into bug16206 values(1)
29+
f n Query 1 n use `test`; BEGIN
30+
f n Query 1 n use `test`; insert into bug16206 values(2)
31+
f n Query 1 n use `test`; COMMIT
32+
f n Query 1 n use `test`; insert into bug16206 values(3)
33+
drop table bug16206;
34+
set autocommit=0;
35+
End of 5.0 tests

mysql-test/t/bdb_notembedded.test

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
-- source include/not_embedded.inc
2+
-- source include/have_bdb.inc
3+
4+
#
5+
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
6+
#
7+
set autocommit=1;
8+
9+
let $VERSION=`select version()`;
10+
11+
reset master;
12+
create table bug16206 (a int);
13+
insert into bug16206 values(1);
14+
start transaction;
15+
insert into bug16206 values(2);
16+
commit;
17+
--replace_result $VERSION VERSION
18+
--replace_column 1 f 2 n 5 n
19+
show binlog events;
20+
drop table bug16206;
21+
22+
reset master;
23+
create table bug16206 (a int) engine= bdb;
24+
insert into bug16206 values(0);
25+
insert into bug16206 values(1);
26+
start transaction;
27+
insert into bug16206 values(2);
28+
commit;
29+
insert into bug16206 values(3);
30+
--replace_result $VERSION VERSION
31+
--replace_column 1 f 2 n 5 n
32+
show binlog events;
33+
drop table bug16206;
34+
35+
set autocommit=0;
36+
37+
38+
--echo End of 5.0 tests

plugin/daemon_example/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ MYSQLDATAdir = $(localstatedir)
1818
MYSQLSHAREdir = $(pkgdatadir)
1919
MYSQLBASEdir= $(prefix)
2020
MYSQLLIBdir= $(pkglibdir)
21+
pkgplugindir = $(libdir)/@PACKAGE@/plugin
2122
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
2223
-I$(top_srcdir)/regex \
2324
-I$(top_srcdir)/sql \
2425
-I$(srcdir) @ZLIB_INCLUDES@
2526

2627
EXTRA_LTLIBRARIES = libdaemon_example.la
27-
pkglib_LTLIBRARIES = @plugin_daemon_example_shared_target@
28-
libdaemon_example_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
28+
pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
29+
libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
2930
libdaemon_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
3031
libdaemon_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
3132
libdaemon_example_la_SOURCES = daemon_example.cc

plugin/fulltext/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
#Makefile.am example for a plugin
1717

18-
pkglibdir=$(libdir)/mysql
18+
pkgplugindir=$(libdir)/@PACKAGE@/plugin
1919
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
2020
#noinst_LTLIBRARIES= mypluglib.la
21-
pkglib_LTLIBRARIES= mypluglib.la
21+
pkgplugin_LTLIBRARIES= mypluglib.la
2222
mypluglib_la_SOURCES= plugin_example.c
23-
mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir)
23+
mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir)
2424
mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
2525

2626
# Don't update the files from bitkeeper

scripts/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ CLEANFILES = @server_scripts@ \
9090
mysql_tableinfo \
9191
mysqld_multi
9292

93+
pkgplugindir = $(libdir)/@PACKAGE@/plugin
94+
9395
# Default same as 'pkgdatadir', but we can override it
9496
pkgsuppdir = $(datadir)/@PACKAGE@
9597

@@ -137,6 +139,7 @@ SUFFIXES = .sh
137139
-e 's!@''pkglibdir''@!$(pkglibdir)!g' \
138140
-e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
139141
-e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
142+
-e 's!@''pkgplugindir''@!$(pkgplugindir)!g' \
140143
-e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \
141144
-e 's!@''sysconfdir''@!$(sysconfdir)!g' \
142145
-e 's!@''mandir''@!$(mandir)!g' \

scripts/make_binary_distribution.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
# "pkglibdir" is set to the same as "libdir"
3131
# "pkgincludedir" is set to the same as "includedir"
3232
# "pkgdatadir" is set to the same as "datadir"
33+
# "pkgplugindir" is set to "@prefix@/lib/plugin",
34+
# normally "$libdir/plugin"
3335
# "pkgsuppdir" is set to "@prefix@/support-files",
3436
# normally the same as "datadir"
3537
#
@@ -204,6 +206,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then
204206
pkglibdir=@pkglibdir@ \
205207
pkgincludedir=@pkgincludedir@ \
206208
pkgdatadir=@pkgdatadir@ \
209+
pkgplugindir=@pkgplugindir@ \
207210
pkgsuppdir=@pkgsuppdir@ \
208211
mandir=@mandir@ \
209212
infodir=@infodir@

scripts/mysql_config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ pkglibdir='@pkglibdir@'
8787
pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"`
8888
fix_path pkglibdir $pkglibdir_rel lib/mysql lib
8989

90+
plugindir='@pkgplugindir@'
91+
9092
pkgincludedir='@pkgincludedir@'
9193
fix_path pkgincludedir include/mysql include
9294

@@ -147,6 +149,7 @@ Options:
147149
--include [$include]
148150
--libs [$libs]
149151
--libs_r [$libs_r]
152+
--plugindir [$plugindir]
150153
--socket [$socket]
151154
--port [$port]
152155
--version [$version]
@@ -163,6 +166,7 @@ while test $# -gt 0; do
163166
--include) echo "$include" ;;
164167
--libs) echo "$libs" ;;
165168
--libs_r) echo "$libs_r" ;;
169+
--plugindir) echo "$plugindir" ;;
166170
--socket) echo "$socket" ;;
167171
--port) echo "$port" ;;
168172
--version) echo "$version" ;;

sql/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
1919
MYSQLSHAREdir = $(pkgdatadir)
2020
MYSQLBASEdir= $(prefix)
2121
MYSQLLIBdir= $(pkglibdir)
22+
pkgplugindir = $(libdir)/@PACKAGE@/plugin
2223
INCLUDES = @ZLIB_INCLUDES@ \
2324
-I$(top_builddir)/include -I$(top_srcdir)/include \
2425
-I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes)
@@ -136,7 +137,7 @@ DEFS = -DMYSQL_SERVER \
136137
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
137138
-DDATADIR="\"$(MYSQLDATAdir)\"" \
138139
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
139-
-DLIBDIR="\"$(MYSQLLIBdir)\"" \
140+
-DPLUGINDIR="\"$(pkgplugindir)\"" \
140141
@DEFS@
141142

142143
BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h

sql/mysqld.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8032,7 +8032,7 @@ static void fix_paths(void)
80328032
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
80338033
(void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home);
80348034
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
8035-
get_relative_path(LIBDIR), mysql_home);
8035+
get_relative_path(PLUGINDIR), mysql_home);
80368036
opt_plugin_dir_ptr= opt_plugin_dir;
80378037

80388038
char *sharedir=get_relative_path(SHAREDIR);

0 commit comments

Comments
 (0)