mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-10 07:04:03 +00:00
- fix broken rw-spliting
- bump PORTREVISION PR: ports/140039 Submitted by: Vladimir Korkodinov <viper_AT_perm dot raid dot ru>
This commit is contained in:
parent
7a8868f74f
commit
f35609a9e6
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=243404
@ -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
|
||||
|
73
databases/mysql-proxy/files/patch-lib-rw-splitting.lua
Normal file
73
databases/mysql-proxy/files/patch-lib-rw-splitting.lua
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user