aboutsummaryrefslogtreecommitdiffstats
path: root/databases/mysql-proxy
diff options
context:
space:
mode:
authorclsung <clsung@FreeBSD.org>2009-10-28 14:35:35 +0800
committerclsung <clsung@FreeBSD.org>2009-10-28 14:35:35 +0800
commit93cd113828fb88c92ec54e980f2a46cf5728a6ea (patch)
tree65ac5e5694ceb7e2b0b7f79d25fb3bb2aea2889c /databases/mysql-proxy
parent5e09f449958af3e77929a1cd752c2943af09504a (diff)
downloadfreebsd-ports-gnome-93cd113828fb88c92ec54e980f2a46cf5728a6ea.tar.gz
freebsd-ports-gnome-93cd113828fb88c92ec54e980f2a46cf5728a6ea.tar.zst
freebsd-ports-gnome-93cd113828fb88c92ec54e980f2a46cf5728a6ea.zip
- fix broken rw-spliting
- bump PORTREVISION PR: ports/140039 Submitted by: Vladimir Korkodinov <viper_AT_perm dot raid dot ru>
Diffstat (limited to 'databases/mysql-proxy')
-rw-r--r--databases/mysql-proxy/Makefile2
-rw-r--r--databases/mysql-proxy/files/patch-lib-proxy-Makefile.in0
-rw-r--r--databases/mysql-proxy/files/patch-lib-rw-splitting.lua73
3 files changed, 74 insertions, 1 deletions
diff --git a/databases/mysql-proxy/Makefile b/databases/mysql-proxy/Makefile
index 724fb8d5d0e8..f9b513f5361f 100644
--- a/databases/mysql-proxy/Makefile
+++ b/databases/mysql-proxy/Makefile
@@ -7,7 +7,7 @@
PORTNAME= mysql-proxy
PORTVERSION= 0.7.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL}
MASTER_SITE_SUBDIR= MySQL-Proxy
diff --git a/databases/mysql-proxy/files/patch-lib-proxy-Makefile.in b/databases/mysql-proxy/files/patch-lib-proxy-Makefile.in
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/databases/mysql-proxy/files/patch-lib-proxy-Makefile.in
+++ /dev/null
diff --git a/databases/mysql-proxy/files/patch-lib-rw-splitting.lua b/databases/mysql-proxy/files/patch-lib-rw-splitting.lua
new file mode 100644
index 000000000000..3b4aaac738c4
--- /dev/null
+++ b/databases/mysql-proxy/files/patch-lib-rw-splitting.lua
@@ -0,0 +1,73 @@
+--- lib/rw-splitting.lua.orig 2009-06-30 22:47:39.000000000 +0600
++++ lib/rw-splitting.lua 2009-10-20 12:06:21.000000000 +0600
+@@ -65,7 +65,7 @@
+
+ if is_debug then
+ print()
+- print("[connect_server] " .. proxy.connection.client.address)
++ print("[connect_server] " .. proxy.connection.client.src.name)
+ end
+
+ local rw_ndx = 0
+@@ -143,7 +143,7 @@
+ -- auth.packet is the packet
+ function read_auth_result( auth )
+ if is_debug then
+- print("[read_auth_result] " .. proxy.connection.client.address)
++ print("[read_auth_result] " .. proxy.connection.client.src.name)
+ end
+ if auth.packet:byte() == proxy.MYSQLD_PACKET_OK then
+ -- auth was fine, disconnect from the server
+@@ -175,7 +175,7 @@
+
+ -- looks like we have to forward this statement to a backend
+ if is_debug then
+- print("[read_query] " .. proxy.connection.client.address)
++ print("[read_query] " .. proxy.connection.client.src.name)
+ print(" current backend = " .. proxy.connection.backend_ndx)
+ print(" client default db = " .. c.default_db)
+ print(" client username = " .. c.username)
+@@ -198,7 +198,7 @@
+ return proxy.PROXY_SEND_RESULT
+ end
+
+- proxy.queries:append(1, packet)
++ proxy.queries:append(1, packet, { resultset_is_needed = true })
+
+ -- read/write splitting
+ --
+@@ -278,14 +278,14 @@
+ print(" server default db: " .. s.default_db)
+ print(" client default db: " .. c.default_db)
+ print(" syncronizing")
+- proxy.queries:prepend(2, string.char(proxy.COM_INIT_DB) .. c.default_db)
++ proxy.queries:prepend(2, string.char(proxy.COM_INIT_DB) .. c.default_db, { resultset_is_needed = true })
+ end
+
+ -- send to master
+ if is_debug then
+ if proxy.connection.backend_ndx > 0 then
+ local b = proxy.global.backends[proxy.connection.backend_ndx]
+- print(" sending to backend : " .. b.address);
++ print(" sending to backend : " .. b.dst.name);
+ print(" is_slave : " .. tostring(b.type == proxy.BACKEND_TYPE_RO));
+ print(" server default db: " .. s.default_db)
+ print(" server username : " .. s.username)
+@@ -319,7 +319,7 @@
+ proxy.response = {
+ type = proxy.MYSQLD_PACKET_ERR,
+ errmsg = "can't change DB ".. proxy.connection.client.default_db ..
+- " to on slave " .. proxy.global.backends[proxy.connection.backend_ndx].address
++ " to on slave " .. proxy.global.backends[proxy.connection.backend_ndx].dst.name
+ }
+
+ return proxy.PROXY_SEND_RESULT
+@@ -352,7 +352,7 @@
+ function disconnect_client()
+ local is_debug = proxy.global.config.rwsplit.is_debug
+ if is_debug then
+- print("[disconnect_client] " .. proxy.connection.client.address)
++ print("[disconnect_client] " .. proxy.connection.client.src.name)
+ end
+
+ -- make sure we are disconnection from the connection