{"id":7407,"date":"2015-10-08T09:44:50","date_gmt":"2015-10-08T07:44:50","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=7407"},"modified":"2015-10-08T09:44:50","modified_gmt":"2015-10-08T07:44:50","slug":"new-statements-id-like-to-see-in-mysql-5-8","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/new-statements-id-like-to-see-in-mysql-5-8","title":{"rendered":"New statements I&#8217;d like to see in MySQL 5.8"},"content":{"rendered":"<p>Following up on\u00a0<a title=\"Link to New features I'd like to see in MySQL 5.8\" href=\"http:\/\/code.openark.org\/blog\/mysql\/new-features-id-like-to-see-in-mysql-5-8\" rel=\"bookmark\">New features I&#8217;d like to see in MySQL 5.8<\/a>, here are <em>statements<\/em> I would like to see in MySQL 5.8:<\/p>\n<ul>\n<li><strong>ENABLE EVENTS;<\/strong><br \/>\nWhen promoting a slave to master, I want to be able to enable all those events that are in <strong>SLAVESIDE_DISABLED<\/strong> state. Today I script an iteration over the events an constructing the <strong>ALTER EVENT&#8230;ENABLE<\/strong> statement one by one. Just activate those!<\/li>\n<li><strong>SKIP GTID TRANSACTION;<\/strong><br \/>\nI have a transaction on slave that I want to skip, and there&#8217;s GTID. The sequence of<\/p>\n<blockquote>\n<pre>STOP SLAVE;\r\nSET GTID_NEXT=\"...\";\r\nBEGIN;\r\nCOMMIT;\r\nSET GTID_NEXT=\"AUTOMATIC\";\r\nSTART SLAVE;<\/pre>\n<\/blockquote>\n<p>is just something I don&#8217;t want to do. To compute the <strong>GTID_NEXT<\/strong>; to open a transaction; to use session variables; this may seem straightforward to import the above from a shell script, but calculating the next GTID is not entirely trivial; issuing the above from your programming language makes for a weird <em>&#8220;all these have to be in the same session AND you&#8217;re going to do a transaction meanwhile&#8221;<\/em>. With golang it&#8217;s actually a problem.<br \/>\nMake it simple for me. I&#8217;m willing to do the <strong>STOP\/START SLAVE<\/strong>.<\/li>\n<li><strong>BINLOG ENTRY\u00a0&#8216;&lt;arbitrary text&gt;&#8217;;<\/strong><br \/>\nVery selfishly, I want to be able to inject a comment into the binary log, of arbitrary text. I want this comment to appear in SBR format, as if it were a DDL.<br \/>\nMy selfish reason: injection of Pseudo-GTID. But I can see various other use cases, such as application level injection of app-logic checkpointing; chef\/glu injection of <em>&#8220;code deployed at this time&#8221;<\/em>; application injection of <em>&#8220;daily audit done to this point&#8221;<\/em>.\u00a0This is too cool and too easy to skip.<\/li>\n<li><strong>SHOW RELAY LOGS;<\/strong><br \/>\nSimilar to <strong>SHOW BINARY\u00a0LOGS;<\/strong><\/li>\n<li><strong>PURGE RELAY LOGS TO &#8216;&#8230;&#8217;;<\/strong><br \/>\nSimilar to <strong>PURGE BINARY\u00a0LOGS TO &#8216;&#8230;&#8217;;<\/strong><br \/>\nIt&#8217;s time relay logs stopped being 2nd class citizens.<\/li>\n<li><strong>SHOW NONBLOCKING [GLOBAL|SESSION] STATUS;<\/strong><br \/>\nIssue a SHOW GLOBAL|SESSION STATUS query that only shows those variables for which it does not need to block. i.e. this is a safe, fast <em>&#8220;show me everything you&#8217;ve got that I won&#8217;t need to pay for&#8221;<\/em>.<\/li>\n<\/ul>\n<p>Yes, yes, <em>statements<\/em> are also features, I know.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following up on\u00a0New features I&#8217;d like to see in MySQL 5.8, here are statements I would like to see in MySQL 5.8: ENABLE EVENTS; When promoting a slave to master, I want to be able to enable all those events that are in SLAVESIDE_DISABLED state. Today I script an iteration over the events an constructing [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[5],"tags":[51],"class_list":["post-7407","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-opinions"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bZZp-1Vt","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/7407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/comments?post=7407"}],"version-history":[{"count":8,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/7407\/revisions"}],"predecessor-version":[{"id":7437,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/7407\/revisions\/7437"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=7407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=7407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=7407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}