{"id":2253,"date":"2011-01-05T23:58:20","date_gmt":"2011-01-05T13:58:20","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=2253"},"modified":"2014-10-08T09:16:08","modified_gmt":"2014-10-07T23:16:08","slug":"is-your-storage-engine-buggy-or-the-database-server","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2011\/01\/05\/is-your-storage-engine-buggy-or-the-database-server\/","title":{"rendered":"Is your Storage Engine buggy or the database server?"},"content":{"rendered":"<p>If your storage engine returns an error from rnd_init (or doStartTableScan as it&#8217;s named in <a href=\"http:\/\/www.drizzle.org\">Drizzle<\/a>) and does <strong>not<\/strong> save this error and return it in any subsequent calls to rnd_next, your engine is buggy. Namely it is buggy in that a) an error may not be reported back to the user and b) everything may explode horribly when rnd_next is called after rnd_init returned an error.<\/p>\n<p>Unless it is running on <a href=\"http:\/\/mariadb.org\/\">MariaDB<\/a> 5.2 or (soon, when the patch hits the tree) <a href=\"http:\/\/www.drizzle.org\">Drizzle<\/a>.<\/p>\n<p>Monty (\u00ef\u00bb\u00bf\u00ef\u00bb\u00bf<a href=\"http:\/\/monty-says.blogspot.com\/\">Widenius<\/a>, not <a href=\"http:\/\/inaugust.com\/\">Taylor<\/a>) wrote a patch for <a href=\"http:\/\/mariadb.org\">MariaDB<\/a> based on my <a href=\"https:\/\/bugs.launchpad.net\/drizzle\/+bug\/588251\">bug report<\/a> that addressed that problem. It uses the compiler feature to throw a warning if the result of a function isn&#8217;t checked to make sure that all places that call rnd_init are checking for an error from the engine.<\/p>\n<p>Today I (finally) pulled that into Drizzle as well.<\/p>\n<p>So&#8230; if your engine does the logical thing and goes &#8220;oh look, this method returns an error&#8230; I&#8217;ll return my error&#8221; it will exhibit bugs in <a href=\"http:\/\/mysql.com\">MySQL<\/a> but not <a href=\"http:\/\/mariadb.org\">MariaDB<\/a> 5.2 or <a href=\"http:\/\/www.drizzle.org\">Drizzle<\/a> (when patch hits).<\/p>\n<p>Which is buggy, the server or the engine?<\/p>\n<p>The <a href=\"http:\/\/bugs.mysql.com\/bug.php?id=54166\">MySQL bug number is 54166<\/a>, filed in June 2010.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your storage engine returns an error from rnd_init (or doStartTableScan as it&#8217;s named in Drizzle) and does not save this error and return it in any subsequent calls to rnd_next, your engine is buggy. Namely it is buggy in &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2011\/01\/05\/is-your-storage-engine-buggy-or-the-database-server\/\">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_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[76,75,14],"tags":[70,340,628,280,80,242],"class_list":["post-2253","post","type-post","status-publish","format-standard","hentry","category-code","category-drizzle-work-et-al","category-mysql","tag-drizzle","tag-mariadb","tag-mysql","tag-rnd_init","tag-storage-engine-api","tag-storageengine"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-Al","jetpack-related-posts":[{"id":2083,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/07\/22\/a-tale-of-a-bug\/","url_meta":{"origin":2253,"position":0},"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":3237,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/08\/mysql-modularity-are-we-there-yet\/","url_meta":{"origin":2253,"position":1},"title":"MySQL modularity, are we there yet?","author":"Stewart Smith","date":"2013-03-08","format":false,"excerpt":"MySQL is now over four times the size than it was with MySQL 3.23. This has not come in the shape of plugins. Have we improved modularity over time? I decided to take LoC count for plugins and storage engines (in the case of Drizzle, memory, myisam and innobase 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":3257,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/13\/which-is-bigger-mysql-or-postgresql\/","url_meta":{"origin":2253,"position":2},"title":"Which is bigger: MySQL or PostgreSQL?","author":"Stewart Smith","date":"2013-03-13","format":false,"excerpt":"From my previous posts, we have some numbers (excluding NDB) for the size of MySQL, so what about PostgreSQL? Here, I used PostgreSQL git trunk and classing things in the contrib\/ directory as plugins. I put the number of lines of code in the src\/backend\/storage directory down as storage engines\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":3398,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/08\/14\/who-is-working-on-mariadb-10-0\/","url_meta":{"origin":2253,"position":3},"title":"Who is working on MariaDB 10.0?","author":"Stewart Smith","date":"2013-08-14","format":false,"excerpt":"There was some suggestion after my previous post (Who works on MariaDB and MySQL?) that I look at MariaDB 10.0 - so I have. My working was very simple, in a current MariaDB 10.0 BZR tree (somewhat beyond 10.0.3), I ran the following command: bzr log -n0 -rtag:mariadb-10.0.0..|egrep '(author|committer): '|\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":3234,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/04\/04\/refactoring-internal-temporary-tables-another-stab-at-it\/","url_meta":{"origin":2253,"position":4},"title":"Refactoring Internal temporary tables (another stab at it)","author":"Stewart Smith","date":"2013-04-04","format":false,"excerpt":"A few weekends ago, I started to again look at the code in Drizzle for producing internal temporary tables. Basically, we have a few type of tables: Standard Temporary (from CREATE TEMPORARY TABLE) Temporary (from ALTER TABLE) Internal temporary (to help with query execution) If you're lucky enough to be\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":3291,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/04\/18\/where-are-they-now-mysql-storage-engines\/","url_meta":{"origin":2253,"position":5},"title":"Where are they now: MySQL Storage Engines","author":"Stewart Smith","date":"2013-04-18","format":false,"excerpt":"There was once a big hooplah about the MySQL Storage Engine Architecture and how it was easy to just slot in some other method of storage instead of the provided ones. Over the years I've repeatedly mentioned how this wasn't really the case and that it was remarkably non trivial.\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":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2253","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=2253"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2253\/revisions"}],"predecessor-version":[{"id":3845,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2253\/revisions\/3845"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=2253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=2253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=2253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}