{"id":2313,"date":"2011-03-03T16:26:21","date_gmt":"2011-03-03T06:26:21","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=2313"},"modified":"2011-03-03T16:26:46","modified_gmt":"2011-03-03T06:26:46","slug":"undocumented-alter-table-that-does-nothing","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2011\/03\/03\/undocumented-alter-table-that-does-nothing\/","title":{"rendered":"Undocumented ALTER TABLE that does *nothing* (useful)"},"content":{"rendered":"<p>(at least since MySQL 5.1.42)<\/p>\n<pre>alter table t1 force;<\/pre>\n<p>Pretty neat huh? In fact, in Drizzle this will end up doing a copying alter table. Not useful.<\/p>\n<p>There&#8217;s an over four year old bug report in MySQL (<a href=\"http:\/\/bugs.mysql.com\/bug.php?id=24091\">Bug#24091<\/a>).<\/p>\n<p>I&#8217;m just going to remove that bit from the parser in Drizzle &#8211; it makes no sense.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(at least since MySQL 5.1.42) alter table t1 force; Pretty neat huh? In fact, in Drizzle this will end up doing a copying alter table. Not useful. There&#8217;s an over four year old bug report in MySQL (Bug#24091). I&#8217;m just &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2011\/03\/03\/undocumented-alter-table-that-does-nothing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[75,14],"tags":[85,269,70,628],"class_list":["post-2313","post","type-post","status-publish","format-standard","hentry","category-drizzle-work-et-al","category-mysql","tag-bug","tag-ddl","tag-drizzle","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-Bj","jetpack-related-posts":[{"id":2041,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/06\/29\/enum-now-works-properly-in-drizzle\/","url_meta":{"origin":2313,"position":0},"title":"ENUM now works properly (in Drizzle)","author":"Stewart Smith","date":"2010-06-29","format":false,"excerpt":"Over at the Drizzle blog, the recent 2010-06-07 tarball was announced. This tarball release has my fixes for the ENUM type, so that it now works as it should. I was quite amazed that such a small block of code could have so many bugs! One of the most interesting\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2310,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/03\/03\/sql-oddity-alter-table-and-default-values\/","url_meta":{"origin":2313,"position":1},"title":"SQL Oddity: ALTER TABLE and default values","author":"Stewart Smith","date":"2011-03-03","format":false,"excerpt":"\u00ef\u00bb\u00bfSo, the MySQL (and Drizzle) ALTER TABLE syntax allows you to easily change the default value of a column. For example: CREATE TABLE t1 (answer int); ALTER TABLE t1 ALTER answer SET DEFAULT 42; So, you create a TIMESTAMP column and forgot to set the default value to CURRENT_TIMESTAMP. Easy,\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2083,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/07\/22\/a-tale-of-a-bug\/","url_meta":{"origin":2313,"position":2},"title":"A tale of a bug&#8230;","author":"Stewart Smith","date":"2010-07-22","format":false,"excerpt":"So I sometimes get asked if we funnel back bug reports or patches back to MySQL from Drizzle. Also, MariaDB adds some interest here as they are a lot closer (and indeed compatible with) to MySQL. With Drizzle, we have deviated really quite heavily from the MySQL codebase. There are\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2307,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/03\/01\/alter-table-rename-rename-rename\/","url_meta":{"origin":2313,"position":3},"title":"ALTER TABLE RENAME RENAME RENAME","author":"Stewart Smith","date":"2011-03-01","format":false,"excerpt":"Here's a nice challenge for you. What does the following do (or error out on?): CREATE TABLE t1 (a int); CREATE TABLE t2 (b int); ALTER TABLE t1 RENAME t3, RENAME t2, RENAME t4; I'd be interested to know what a) you think it does and then b) if you\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1265,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/11\/22\/what-version-in-information_schematables-means-hint-not-what-you-think\/","url_meta":{"origin":2313,"position":4},"title":"What VERSION in INFORMATION_SCHEMA.TABLES means (hint: not what you think)","author":"Stewart Smith","date":"2008-11-22","format":false,"excerpt":"It's the FRM file format version number. It's not the version of the table as one might expect (i.e. after CREATE it's 1. Then, if you ALTER, it's 2. Alter again 3 etc). In Drizzle, we now return 0. In future, I plan that Drizzle will allow the engine to\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2036,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/06\/03\/new-create-table-performance-record\/","url_meta":{"origin":2313,"position":5},"title":"New CREATE TABLE performance record!","author":"Stewart Smith","date":"2010-06-03","format":false,"excerpt":"\u00ef\u00bb\u00bf\u00ef\u00bb\u00bf4 min 20 sec So next time somebody complains about NDB taking a long time in CREATE TABLE, you're welcome to point them to this :) A single CREATE TABLE statement It had ONE column It was an ENUM column. With 70,000 possible values. It was 605kb of SQL. It\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=2313"}],"version-history":[{"count":3,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2313\/revisions"}],"predecessor-version":[{"id":2316,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2313\/revisions\/2316"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=2313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=2313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=2313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}