Don’t Forget to Alter your Federated Tables!

May 5, 2009 · Posted in MySQL · 1 Comment 

If you’re using the Federated engine, here’s something important to remember (apart from the usual advice of “please don’t”). If you need to change the structure of the remote table, always remember to update the Federated table. If not, when you try to use the table, you’ll get this error:

mysql> SELECT * FROM foo;
ERROR 1030 (HY000): Got error 1 from storage engine

This error isn’t really helpful. The problem is, the Federated engine only checks that the remote table structure is correct when it initially connects. Once it has connected, no more checks. When you restart the server, you get a much more helpful message:

mysql SELECT * FROM foo;
ERROR 1431 (HY000): The foreign data source you are trying to reference does not exist. Data source error:  error: 1054  'Unknown column 'b' in 'field list''

Also, keep your eye on the FederatedX project. It’s still under development, but will hopefully upgrade the Federated engine to being useful again.

  • Gary Pendergast, noun: Gamer, developer, MySQL, WordPress, web and music geek. Currently taking a leave of absence from life as a MySQL Support Engineer for Oracle to tour around Europe. Can be observed in his natural habit at pento.net, or usually in Bologna, Italy.

  • My Twitter

    • Touristing until early next week. Replies will be sporadic, at best. 5 days ago
    • Somewhat surprised at the number of #WordPress sites I see using "ugly" urls, /?page_id=555 5 days ago
    • Learned something today: .it domains need 1-2 days to change DNS servers, I guess the registry approves these changes manually. Oh, Italy. 6 days ago
    • SVN commit message to make me drop everything and run `svn up`: "Fix typo making all users admins" 6 days ago
    • Huh, #Filezilla owns #WinSCP for uploading large numbers of small files. 6 days ago
    • More updates...