Unix Technical Forum

MySQL slave error when creating view

This is a discussion on MySQL slave error when creating view within the MySQL General forum forums, part of the MySQL category; --> I ran the following DDL on our master today: CREATE OR REPLACE VIEW REF_TRANSFER_PREFERENCE ( IORG_UID, TDISTRICT_NAME, IORGDISPLAY, IORG ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:08 AM
Tim Lucia
 
Posts: n/a
Default MySQL slave error when creating view

I ran the following DDL on our master today:

CREATE OR REPLACE VIEW REF_TRANSFER_PREFERENCE (
IORG_UID, TDISTRICT_NAME, IORGDISPLAY, IORG ) AS
SELECT
0, TDISTRICT_NAME, IORG_UID, IORG_UID
FROM REF_PREFERENCE
;

The master happily created the view. The slave however dies with:

070405 10:48:23 [ERROR] Slave: Error 'Duplicate column name 'IORG_UID'' on
query. Default database: 'pildb'. Query: 'CREATE OR REPLACE
ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW
`REF_TRANSFER_PREFERENCE` AS SELECT 0, TDISTRICT_NAME, IORG_UID, IORG_UID
FROM REF_PREFERENCE', Error_code: 1060

I can work around it by redefining the view DDL as:

CREATE OR REPLACE VIEW REF_TRANSFER_PREFERENCE (
IORG_UID, TDISTRICT_NAME, IORGDISPLAY, IORG ) AS
SELECT
0 as IORG_UID, TDISTRICT_NAME, IORG_UID as IORGDISPLAY, IORG_UID as
IORG
FROM REF_PREFERENCE
;

And the slave is happy. Is this a bug? Anyone care to comment?

CONFIGURATION:
storage_engine MyISAM
table_type MyISAM
updatable_views_with_limit YES
version 5.0.24-standard-log
version_comment MySQL Community Edition - Standard (GPL)
version_compile_machine x86_64
version_compile_os unknown-linux-gnu

Thanks,
Tim



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:08 AM
sam rumaizan
 
Posts: n/a
Default append information

I have a question if you don't mind.
The update statement will replace the existing information. What if I
have Textarea instead and I want to add information to the field
without erasing previous information. Basically append information







---------------------------------
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:49 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com