Description:
Slave reports error:
Last_Error: Query caused different errors on master and slave. Error on master: 'Table '%-.64s' already exists' (1050), Error on slave: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PÀ6' at line 1' (1064). Default database: 'corp'. Query: 'CREATE ALGORITHM=UNDEFINED DEFINER=`eh`@`localhost` SQL SECURITY DEFINER VIEW `cmts_view` AS PÀ6'
However, the master logged no errors and created the view as expected.
How to repeat:
Create several databases that each have a 'cmts' table with this structure:
CREATE TABLE `cmts` (
`id` int(11) NOT NULL auto_increment,
`hostname` varchar(30) NOT NULL default '',
`ip_address` varchar(15) NOT NULL default '',
`read_string` varchar(30) NOT NULL default '',
`cm_read_strings` varchar(140) NOT NULL default 'public',
`cm_write_strings` varchar(140) NOT NULL default '',
`status` enum('active','disabled','deleted') default 'active',
`responsive` tinyint(4) default '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM
create view cmts_view as
SELECT 'orangecounty' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from orangecounty.cmts where status = 'active'
UNION SELECT 'santabarbara' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from santabarbara.cmts where status = 'active'
UNION SELECT 'sandiego' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from sandiego.cmts where status = 'active'
UNION SELECT 'phoenix' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from phoenix.cmts where status = 'active'
UNION SELECT 'macon' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from macon.cmts where status = 'active'
UNION SELECT 'gulfcoast' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from gulfcoast.cmts where status = 'active'
UNION SELECT 'hamptonroads' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from hamptonroads.cmts where status = 'active'
UNION SELECT 'omaha' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from omaha.cmts where status = 'active'
UNION SELECT 'oklahomacity' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from oklahomacity.cmts where status = 'active'
UNION SELECT 'tulsa' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from tulsa.cmts where status = 'active'
UNION SELECT 'wichita' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from wichita.cmts where status = 'active'
UNION SELECT 'neworleans' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from neworleans.cmts where status = 'active'
UNION SELECT 'batonrouge' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from batonrouge.cmts where status = 'active'
UNION SELECT 'cleveland' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from cleveland.cmts where status = 'active'
UNION SELECT 'rhodeisland' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from rhodeisland.cmts where status = 'active'
UNION SELECT 'nova' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from nova.cmts where status = 'active'
UNION SELECT 'roanoke' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from roanoke.cmts where status = 'active'
UNION SELECT 'palosverdes' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from palosverdes.cmts where status = 'active'
UNION SELECT 'gainesville' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from gainesville.cmts where status = 'active'
UNION SELECT 'lasvegas' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from lasvegas.cmts where status = 'active'
UNION SELECT 'connecticut' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from connecticut.cmts where status = 'active';
that will work on the master but fail on the slave
Suggested fix:
A better error message would help!
Description: Slave reports error: Last_Error: Query caused different errors on master and slave. Error on master: 'Table '%-.64s' already exists' (1050), Error on slave: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PÀ6' at line 1' (1064). Default database: 'corp'. Query: 'CREATE ALGORITHM=UNDEFINED DEFINER=`eh`@`localhost` SQL SECURITY DEFINER VIEW `cmts_view` AS PÀ6' However, the master logged no errors and created the view as expected. How to repeat: Create several databases that each have a 'cmts' table with this structure: CREATE TABLE `cmts` ( `id` int(11) NOT NULL auto_increment, `hostname` varchar(30) NOT NULL default '', `ip_address` varchar(15) NOT NULL default '', `read_string` varchar(30) NOT NULL default '', `cm_read_strings` varchar(140) NOT NULL default 'public', `cm_write_strings` varchar(140) NOT NULL default '', `status` enum('active','disabled','deleted') default 'active', `responsive` tinyint(4) default '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM create view cmts_view as SELECT 'orangecounty' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from orangecounty.cmts where status = 'active' UNION SELECT 'santabarbara' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from santabarbara.cmts where status = 'active' UNION SELECT 'sandiego' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from sandiego.cmts where status = 'active' UNION SELECT 'phoenix' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from phoenix.cmts where status = 'active' UNION SELECT 'macon' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from macon.cmts where status = 'active' UNION SELECT 'gulfcoast' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from gulfcoast.cmts where status = 'active' UNION SELECT 'hamptonroads' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from hamptonroads.cmts where status = 'active' UNION SELECT 'omaha' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from omaha.cmts where status = 'active' UNION SELECT 'oklahomacity' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from oklahomacity.cmts where status = 'active' UNION SELECT 'tulsa' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from tulsa.cmts where status = 'active' UNION SELECT 'wichita' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from wichita.cmts where status = 'active' UNION SELECT 'neworleans' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from neworleans.cmts where status = 'active' UNION SELECT 'batonrouge' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from batonrouge.cmts where status = 'active' UNION SELECT 'cleveland' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from cleveland.cmts where status = 'active' UNION SELECT 'rhodeisland' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from rhodeisland.cmts where status = 'active' UNION SELECT 'nova' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from nova.cmts where status = 'active' UNION SELECT 'roanoke' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from roanoke.cmts where status = 'active' UNION SELECT 'palosverdes' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from palosverdes.cmts where status = 'active' UNION SELECT 'gainesville' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from gainesville.cmts where status = 'active' UNION SELECT 'lasvegas' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from lasvegas.cmts where status = 'active' UNION SELECT 'connecticut' as instance,hostname,ip_address,read_string,cm_read_strings,cm_write_strings from connecticut.cmts where status = 'active'; that will work on the master but fail on the slave Suggested fix: A better error message would help!