{"id":139,"date":"2011-08-22T12:15:42","date_gmt":"2011-08-22T16:15:42","guid":{"rendered":"http:\/\/myblog.vindaloo.com\/?p=139"},"modified":"2012-06-02T22:47:27","modified_gmt":"2012-06-03T02:47:27","slug":"139","status":"publish","type":"post","link":"http:\/\/myblog.vindaloo.com\/?p=139","title":{"rendered":"MySQL lovefest"},"content":{"rendered":"<p>Great, just discovered how easy it is to break things with mysql views and stored functions. It turns out that to create a view after a dump, mysql must create table temporarily for each view, then one by one drop the tables and create views in their place. \u00a0This presents two potential problems. 1. It&#8217;s possible to have a view with more columns than you have in a table. 2. Views can use stored functions to modify results but stored functions aren&#8217;t a part of the mysql dump process until after the view have been defined.<\/p>\n<p>The solution to the problem may be: Create the database, Create all the stored procedures and functions, create the tables and views from mysqldump &#8211;no-data. Reload all the data. It&#8217;s not. It looks like the only way to do this is to use information schema to make a list of tables to dump. Follow this up with routines, and then follow this up with views.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Great, just discovered how easy it is to break things with mysql views and stored functions. It turns out that to create a view after a dump, mysql must create table temporarily for each view, then one by one drop the tables and create views in their place. \u00a0This presents two potential problems. 1. It&#8217;s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/myblog.vindaloo.com\/?p=139\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MySQL lovefest&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-open-source"],"_links":{"self":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":6,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":146,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/146"}],"wp:attachment":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}