MySQL Forums
Forum List  »  Router & Proxy

mysql proxy r/w replication and temporary tables
Posted by: Merlin Morgenstern
Date: March 17, 2011 09:38AM

I am doing master/slave replication on MySQL5.1 and r/w split with mysql proxy 0.8.x

It works fine except with temporary tables. MySQL throws an error, that the temporary table is not existent.

This is the query log for the master server:

CREATE TEMPORARY TABLE IF NOT EXISTS sh ( ad_id MEDIUMINT( 8 ) UNSIGNED NOT NULL, score float , INDEX ( `ad_id` ), INDEX ( `score` )) ENGINE = MEMORY

INSERT INTO sh
SELECT cl.ID, 1
FROM classifieds cl
WHERE cl.advertiser_id = '40179'

This is the query log for the slave:

CREATE TEMPORARY TABLE IF NOT EXISTS sh ( ad_id MEDIUMINT( 8 ) UNSIGNED NOT NULL, score float , INDEX ( `ad_id` ), INDEX ( `score` )) ENGINE = MEMORY

This is the mysql errror message:

Occured during executing INSERT INTO sh SELECT cl.ID, 1 FROM classifieds cl WHERE cl.advertiser_id = '40179' statement
Error: 1146 Table 'dbname.sh' doesn't exist

If I query the master directly (change php db connection to master instead to mysql-proxy), it works without problems.

I am using this mysql proxy config:

[mysql-proxy]
daemon = true
pid-file = /home/mysqladm/mysql-proxy.pid
log-file = /home/mysqladm/mysql-proxy.log
log-level = debug
proxy-address = 192.168.0.109:3307
proxy-backend-addresses = 192.168.0.108:3306
proxy-read-only-backend-addresses = 192.168.0.109
proxy-lua-script = /usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua

Has anybody an idea on how to fix that? Thank you for any help!

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql proxy r/w replication and temporary tables
3540
March 17, 2011 09:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.