summaryrefslogtreecommitdiff
path: root/databases/mysql-proxy/files
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2018-01-31 21:37:03 +0000
committerRene Ladan <rene@FreeBSD.org>2018-01-31 21:37:03 +0000
commit131ff678e8fda50806e64ea55bceb4f05f99c55a (patch)
treefdd02c718233bd9084703152f18a98ae4e1f8b0e /databases/mysql-proxy/files
parentgraphics/colmap: update to 3.4 (diff)
Remove expired port:
2018-01-30 databases/mysql-proxy: No longer maintained and not recommended for production use
Notes
Notes: svn path=/head/; revision=460537
Diffstat (limited to 'databases/mysql-proxy/files')
-rw-r--r--databases/mysql-proxy/files/mysql-proxy.in53
-rw-r--r--databases/mysql-proxy/files/patch-Makefile.in11
-rw-r--r--databases/mysql-proxy/files/patch-examples-Makefile.in45
-rw-r--r--databases/mysql-proxy/files/patch-lib-Makefile.in29
-rw-r--r--databases/mysql-proxy/files/patch-lib-admin.lua208
-rw-r--r--databases/mysql-proxy/files/patch-lib-reporter.lua82
-rw-r--r--databases/mysql-proxy/files/patch-src_chassis-mainloop.c40
7 files changed, 0 insertions, 468 deletions
diff --git a/databases/mysql-proxy/files/mysql-proxy.in b/databases/mysql-proxy/files/mysql-proxy.in
deleted file mode 100644
index 125156ea814f..000000000000
--- a/databases/mysql-proxy/files/mysql-proxy.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# $FreeBSD$
-#
-# PROVIDE: mysql-proxy
-# REQUIRE: LOGIN
-# KEYWORD: shutdown
-#
-# Add the following line to /etc/rc.conf to enable mysql-proxy:
-# mysql_proxy_enable (bool): Set to "NO" by default.
-# Set it to "YES" to enable MySQL Proxy.
-# mysql_proxy_address (str): Set to ":4040" by default.
-# Set listening address:port of the proxy-server.
-# mysql_proxy_backend_addresses (str): Set to "127.0.0.1:3306" by default.
-# Set address:port of the remote backend-servers
-# mysql_proxy_pid_file (path): Default to "/var/run/mysql-proxy.pid"
-# Set PID file in case we are started as daemon
-# mysql_proxy_args (str): Default to ""
-# Custom additional arguments to be passed to mysql-proxy:
-# --proxy-read-only-backend-addresses=<host:port> - address:port of the remote slave-server
-# --proxy-skip-profiling - disables profiling of queries (default: enabled)
-# --proxy-fix-bug-25371 - fix bug #25371 (mysqld > 5.1.12) for older libmysql versions
-# --proxy-lua-script=<file> - filename of the lua script
-# --no-proxy - don't start proxy-server
-
-. /etc/rc.subr
-
-name="mysql_proxy"
-rcvar=mysql_proxy_enable
-
-load_rc_config $name
-
-: ${mysql_proxy_enable="NO"}
-: ${mysql_proxy_address=":4040"}
-: ${mysql_proxy_backend_addresses="127.0.0.1:3306"}
-
-start_precmd="${name}_prestart"
-
-mysql_proxy_prestart()
-{
- local addr
-
- for addr in ${mysql_proxy_backend_addresses}; do
- command_args="${command_args} --proxy-backend-addresses=${addr}"
- done
-}
-
-pidfile="${mysql_proxy_pid_file:-"/var/run/mysql-proxy.pid"}"
-command=%%PREFIX%%/libexec/mysql-proxy
-command_args="--proxy-address=${mysql_proxy_address} ${mysql_proxy_args} --daemon --pid-file=${pidfile}"
-procname=%%PREFIX%%/libexec/mysql-proxy
-
-run_rc_command "$1"
diff --git a/databases/mysql-proxy/files/patch-Makefile.in b/databases/mysql-proxy/files/patch-Makefile.in
deleted file mode 100644
index 72e9dc2be56f..000000000000
--- a/databases/mysql-proxy/files/patch-Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile.in.orig 2010-01-26 13:59:52.000000000 +0100
-+++ Makefile.in 2010-01-26 14:00:16.000000000 +0100
-@@ -238,7 +238,7 @@
- deps
-
- ACLOCAL_AMFLAGS = -I m4
--pkgconfigdir = $(libdir)/pkgconfig
-+pkgconfigdir = $(libexecdir)/pkgconfig
- pkgconfig_DATA = mysql-proxy.pc mysql-chassis.pc
- all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/databases/mysql-proxy/files/patch-examples-Makefile.in b/databases/mysql-proxy/files/patch-examples-Makefile.in
deleted file mode 100644
index 0276e0035a74..000000000000
--- a/databases/mysql-proxy/files/patch-examples-Makefile.in
+++ /dev/null
@@ -1,45 +0,0 @@
---- examples/Makefile.in.orig 2009-05-18 22:15:02.000000000 +0800
-+++ examples/Makefile.in 2009-07-09 08:39:44.000000000 +0800
-@@ -162,6 +162,7 @@
- build_vendor = @build_vendor@
- builddir = @builddir@
- datadir = @datadir@
-+exampledir = @datadir@/examples/mysql-proxy
- datarootdir = @datarootdir@
- docdir = @docdir@
- dvidir = @dvidir@
-@@ -257,20 +258,20 @@
- -rm -rf .libs _libs
- install-dist_docDATA: $(dist_doc_DATA)
- @$(NORMAL_INSTALL)
-- test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
-+ test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
- @list='$(dist_doc_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
-- echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
-- $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
-+ echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(exampledir)/$$f'"; \
-+ $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(exampledir)/$$f"; \
- done
-
- uninstall-dist_docDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_doc_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
-- echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
-- rm -f "$(DESTDIR)$(docdir)/$$f"; \
-+ echo " rm -f '$(DESTDIR)$(exampledir)/$$f'"; \
-+ rm -f "$(DESTDIR)$(exampledir)/$$f"; \
- done
- tags: TAGS
- TAGS:
-@@ -309,7 +310,7 @@
- check: check-am
- all-am: Makefile $(DATA)
- installdirs:
-- for dir in "$(DESTDIR)$(docdir)"; do \
-+ for dir in "$(DESTDIR)$(exampledir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
- install: install-am
diff --git a/databases/mysql-proxy/files/patch-lib-Makefile.in b/databases/mysql-proxy/files/patch-lib-Makefile.in
deleted file mode 100644
index 0dbd3373e433..000000000000
--- a/databases/mysql-proxy/files/patch-lib-Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
---- lib/Makefile.in.orig 2009-04-04 20:32:01.000000000 +0600
-+++ lib/Makefile.in 2009-05-05 17:02:50.000000000 +0600
-@@ -126,9 +126,9 @@
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
- am__dist_doc_DATA_DIST = active-queries.lua active-transactions.lua \
-- admin-sql.lua analyze-query.lua auditing.lua \
-+ admin-sql.lua admin.lua analyze-query.lua auditing.lua \
- commit-obfuscator.lua commit-obfuscator.msc histogram.lua \
-- load-multi.lua ro-balance.lua ro-pooling.lua rw-splitting.lua \
-+ load-multi.lua reporter.lua ro-balance.lua ro-pooling.lua rw-splitting.lua \
- xtab.lua
- dist_docDATA_INSTALL = $(INSTALL_DATA)
- DATA = $(dist_doc_DATA)
-@@ -278,12 +278,14 @@
- active-queries.lua \
- active-transactions.lua \
- admin-sql.lua \
-+ admin.lua \
- analyze-query.lua \
- auditing.lua \
- commit-obfuscator.lua \
- commit-obfuscator.msc \
- histogram.lua \
- load-multi.lua \
-+ reporter.lua \
- ro-balance.lua \
- ro-pooling.lua \
- rw-splitting.lua \
diff --git a/databases/mysql-proxy/files/patch-lib-admin.lua b/databases/mysql-proxy/files/patch-lib-admin.lua
deleted file mode 100644
index 0ab588d8e448..000000000000
--- a/databases/mysql-proxy/files/patch-lib-admin.lua
+++ /dev/null
@@ -1,208 +0,0 @@
---- lib/admin.lua.orig 2009-05-05 16:55:08.000000000 +0600
-+++ lib/admin.lua 2009-05-05 16:56:11.000000000 +0600
-@@ -0,0 +1,205 @@
-+--[[ $%BEGINLICENSE%$
-+ Copyright (C) 2009 MySQL AB, 2008 Sun Microsystems, Inc
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; version 2 of the License.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+
-+ $%ENDLICENSE%$ --]]
-+
-+-- admin-1.lua
-+
-+--[[
-+
-+ See http://forge.mysql.com/tools/tool.php?id=78
-+ (Thanks to Jan Kneschke)
-+ See http://www.chriscalender.com/?p=41
-+ (Thanks to Chris Calender)
-+ See http://datacharmer.blogspot.com/2009/01/mysql-proxy-is-back.html
-+ (Thanks Giuseppe Maxia)
-+
-+--]]
-+
-+
-+function set_error(errmsg)
-+ proxy.response = {
-+ type = proxy.MYSQLD_PACKET_ERR,
-+ errmsg = errmsg or "error"
-+ }
-+end
-+
-+function read_query(packet)
-+ if packet:byte() ~= proxy.COM_QUERY then
-+ set_error("[admin] we only handle text-based queries (COM_QUERY)")
-+ return proxy.PROXY_SEND_RESULT
-+ end
-+
-+ local query = packet:sub(2)
-+ local rows = { }
-+ local fields = { }
-+
-+ -- try to match the string up to the first non-alphanum
-+ local f_s, f_e, command = string.find(packet, "^%s*(%w+)", 2)
-+ local option
-+
-+ if f_e then
-+ -- if that match, take the next sub-string as option
-+ f_s, f_e, option = string.find(packet, "^%s+(%w+)", f_e + 1)
-+ end
-+
-+ -- we got our commands, execute it
-+ if command == "show" and option == "querycounter" then
-+ ---
-+ -- proxy.PROXY_SEND_RESULT requires
-+ --
-+ -- proxy.response.type to be either
-+ -- * proxy.MYSQLD_PACKET_OK or
-+ -- * proxy.MYSQLD_PACKET_ERR
-+ --
-+ -- for proxy.MYSQLD_PACKET_OK you need a resultset
-+ -- * fields
-+ -- * rows
-+ --
-+ -- for proxy.MYSQLD_PACKET_ERR
-+ -- * errmsg
-+ proxy.response.type = proxy.MYSQLD_PACKET_OK
-+ proxy.response.resultset = {
-+ fields = {
-+ { type = proxy.MYSQL_TYPE_LONG, name = "query_counter", },
-+ },
-+ rows = {
-+ { proxy.global.query_counter }
-+ }
-+ }
-+
-+ -- we have our result, send it back
-+ return proxy.PROXY_SEND_RESULT
-+ elseif command == "show" and option == "myerror" then
-+ proxy.response.type = proxy.MYSQLD_PACKET_ERR
-+ proxy.response.errmsg = "my first error"
-+
-+ return proxy.PROXY_SEND_RESULT
-+
-+ elseif string.sub(packet, 2):lower() == 'select help' then
-+ return show_process_help()
-+
-+ elseif string.sub(packet, 2):lower() == 'show proxy processlist' then
-+ return show_process_table()
-+
-+ elseif query == "SELECT * FROM backends" then
-+ fields = {
-+ { name = "backend_ndx",
-+ type = proxy.MYSQL_TYPE_LONG },
-+
-+ { name = "address",
-+ type = proxy.MYSQL_TYPE_STRING },
-+ { name = "state",
-+ type = proxy.MYSQL_TYPE_STRING },
-+ { name = "type",
-+ type = proxy.MYSQL_TYPE_STRING },
-+ }
-+
-+ for i = 1, #proxy.global.backends do
-+ local b = proxy.global.backends[i]
-+
-+ rows[#rows + 1] = {
-+ i, b.dst.name, b.state, b.type
-+ }
-+ end
-+ else
-+ set_error()
-+ return proxy.PROXY_SEND_RESULT
-+ end
-+
-+ proxy.response = {
-+ type = proxy.MYSQLD_PACKET_OK,
-+ resultset = {
-+ fields = fields,
-+ rows = rows
-+ }
-+ }
-+ return proxy.PROXY_SEND_RESULT
-+end
-+
-+
-+function make_dataset (header, dataset)
-+ proxy.response.type = proxy.MYSQLD_PACKET_OK
-+
-+ proxy.response.resultset = {
-+ fields = {},
-+ rows = {}
-+ }
-+ for i,v in pairs (header) do
-+ table.insert(proxy.response.resultset.fields, {type = proxy.MYSQL_TYPE_STRING, name = v})
-+ end
-+ for i,v in pairs (dataset) do
-+ table.insert(proxy.response.resultset.rows, v )
-+ end
-+ return proxy.PROXY_SEND_RESULT
-+end
-+
-+function show_process_table()
-+ local dataset = {}
-+ local header = { 'Id', 'IP Address', 'Time' }
-+ local rows = {}
-+ for t_i, t_v in pairs (proxy.global.process) do
-+ for s_i, s_v in pairs ( t_v ) do
-+ table.insert(rows, { t_i, s_v.ip, os.date('%c',s_v.ts) })
-+ end
-+ end
-+ return make_dataset(header,rows)
-+end
-+
-+function show_process_help()
-+ local dataset = {}
-+ local header = { 'command', 'description' }
-+ local rows = {
-+ {'SELECT HELP', 'This command.'},
-+ {'SHOW PROXY PROCESSLIST', 'Show all connections and their true IP Address.'},
-+ }
-+ return make_dataset(header,rows)
-+end
-+
-+function dump_process_table()
-+ proxy.global.initialize_process_table()
-+ print('current contents of process table')
-+ for t_i, t_v in pairs (proxy.global.process) do
-+ print ('session id: ', t_i)
-+ for s_i, s_v in pairs ( t_v ) do
-+ print ( '\t', s_i, s_v.ip, s_v.ts )
-+ end
-+ end
-+ print ('---END PROCESS TABLE---')
-+end
-+
-+
-+
-+
-+--[[ Help
-+
-+we use a simple string-match to split commands are word-boundaries
-+
-+mysql> show querycounter
-+
-+is split into
-+command = "show"
-+option = "querycounter"
-+
-+spaces are ignored, the case has to be as is.
-+
-+mysql> show myerror
-+
-+returns a error-packet
-+
-+--]]
-+
-+
diff --git a/databases/mysql-proxy/files/patch-lib-reporter.lua b/databases/mysql-proxy/files/patch-lib-reporter.lua
deleted file mode 100644
index b113d913e97d..000000000000
--- a/databases/mysql-proxy/files/patch-lib-reporter.lua
+++ /dev/null
@@ -1,82 +0,0 @@
---- lib/reporter.lua.orig 2009-05-05 16:54:45.000000000 +0600
-+++ lib/reporter.lua 2009-05-05 16:56:21.000000000 +0600
-@@ -0,0 +1,79 @@
-+--[[
-+
-+ Copyright (C) 2009 MySQL AB, 2008 Sun Microsystems, Inc
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; version 2 of the License.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+
-+--]]
-+
-+-- reporter.lua
-+
-+--[[
-+
-+ See http://forge.mysql.com/tools/tool.php?id=78
-+ (Thanks to Jan Kneschke)
-+ See http://www.chriscalender.com/?p=41
-+ (Thanks to Chris Calender)
-+ See http://datacharmer.blogspot.com/2009/01/mysql-proxy-is-back.html
-+ (Thanks Giuseppe Maxia)
-+
-+--]]
-+
-+proxy.global.query_counter = proxy.global.query_counter or 0
-+
-+function proxy.global.initialize_process_table()
-+ if proxy.global.process == nil then
-+ proxy.global.process = {}
-+ end
-+ if proxy.global.process[proxy.connection.server.thread_id] == nil then
-+ proxy.global.process[proxy.connection.server.thread_id] = {}
-+ end
-+end
-+
-+function read_auth_result( auth )
-+ local state = auth.packet:byte()
-+ if state == proxy.MYSQLD_PACKET_OK then
-+ proxy.global.initialize_process_table()
-+ table.insert( proxy.global.process[proxy.connection.server.thread_id],
-+ { ip = proxy.connection.client.src.name, ts = os.time() } )
-+ end
-+end
-+
-+function disconnect_client()
-+ local connection_id = proxy.connection.server.thread_id
-+ if connection_id then
-+ -- client has disconnected, set this to nil
-+ proxy.global.process[connection_id] = nil
-+ end
-+end
-+
-+
-+---
-+-- read_query() can return a resultset
-+--
-+-- You can use read_query() to return a result-set.
-+--
-+-- @param packet the mysql-packet sent by the client
-+--
-+-- @return
-+-- * nothing to pass on the packet as is,
-+-- * proxy.PROXY_SEND_QUERY to send the queries from the proxy.queries queue
-+-- * proxy.PROXY_SEND_RESULT to send your own result-set
-+--
-+function read_query( packet )
-+ -- a new query came in in this connection
-+ -- using proxy.global.* to make it available to the admin plugin
-+ proxy.global.query_counter = proxy.global.query_counter + 1
-+
-+end
diff --git a/databases/mysql-proxy/files/patch-src_chassis-mainloop.c b/databases/mysql-proxy/files/patch-src_chassis-mainloop.c
deleted file mode 100644
index 95f8dac6af2d..000000000000
--- a/databases/mysql-proxy/files/patch-src_chassis-mainloop.c
+++ /dev/null
@@ -1,40 +0,0 @@
-Switch away from deprecated libevent macros.
-
---- src/chassis-mainloop.c.orig 2013-12-23 22:57:16 UTC
-+++ src/chassis-mainloop.c
-@@ -99,9 +99,9 @@ int chassis_check_version(const char *li
- chassis *chassis_new() {
- chassis *chas;
-
-- if (0 != chassis_check_version(event_get_version(), _EVENT_VERSION)) {
-+ if (0 != chassis_check_version(event_get_version(), LIBEVENT_VERSION)) {
- g_critical("%s: chassis is build against libevent %s, but now runs against %s",
-- G_STRLOC, _EVENT_VERSION, event_get_version());
-+ G_STRLOC, LIBEVENT_VERSION, event_get_version());
- return NULL;
- }
-
-@@ -116,7 +116,7 @@ chassis *chassis_new() {
-
- chas->threads = chassis_event_threads_new();
-
-- chas->event_hdr_version = g_strdup(_EVENT_VERSION);
-+ chas->event_hdr_version = g_strdup(LIBEVENT_VERSION);
-
- chas->shutdown_hooks = chassis_shutdown_hooks_new();
-
-@@ -225,10 +225,10 @@ static void event_log_use_glib(int libev
-
- GLogLevelFlags glib_log_level = G_LOG_LEVEL_DEBUG;
-
-- if (libevent_log_level == _EVENT_LOG_DEBUG) glib_log_level = G_LOG_LEVEL_DEBUG;
-- else if (libevent_log_level == _EVENT_LOG_MSG) glib_log_level = G_LOG_LEVEL_MESSAGE;
-- else if (libevent_log_level == _EVENT_LOG_WARN) glib_log_level = G_LOG_LEVEL_WARNING;
-- else if (libevent_log_level == _EVENT_LOG_ERR) glib_log_level = G_LOG_LEVEL_CRITICAL;
-+ if (libevent_log_level == EVENT_LOG_DEBUG) glib_log_level = G_LOG_LEVEL_DEBUG;
-+ else if (libevent_log_level == EVENT_LOG_MSG) glib_log_level = G_LOG_LEVEL_MESSAGE;
-+ else if (libevent_log_level == EVENT_LOG_WARN) glib_log_level = G_LOG_LEVEL_WARNING;
-+ else if (libevent_log_level == EVENT_LOG_ERR) glib_log_level = G_LOG_LEVEL_CRITICAL;
-
- g_log(G_LOG_DOMAIN, glib_log_level, "(libevent) %s", msg);
- }