<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8132102221957780385</id><updated>2011-12-15T01:30:38.338+02:00</updated><category term='MyISAM'/><category term='auto_increment'/><category term='stack trace'/><category term='insert delayed'/><category term='undelete'/><category term='crash'/><category term='rbr'/><category term='MXit'/><category term='perfmon'/><category term='qa'/><category term='gdb'/><category term='innodb'/><category term='testcase'/><category term='pdh'/><category term='windows'/><category term='corruption'/><category term='merge tables'/><category term='partitioning'/><category term='charset'/><category term='core file'/><title type='text'>my mysql related ramblings</title><subtitle type='html'>A blog about MySQL and other bits and pieces</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-6633596476101225988</id><published>2010-09-29T20:32:00.000+02:00</published><updated>2010-09-29T20:32:03.656+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stack trace'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><title type='text'>A Quick Review of Stack Traces</title><content type='html'>&lt;div style="text-align: justify;"&gt;I'll try to pass on some basic knowledge about those confusing &lt;a href="http://en.wikipedia.org/wiki/Stack_trace"&gt;stack traces&lt;/a&gt; we sometimes see in the &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/error-log.html"&gt;mysql error logs&lt;/a&gt;. &amp;nbsp;What can you tell from them, what are they useful for, and how to validate them?&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;span class="Apple-style-span" style="color: #073763;"&gt;Debugging Crashes&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;We tried to improve postmortem debugging of crashes + &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/using-stack-trace.html"&gt;stack traces&lt;/a&gt;&amp;nbsp;in the error log:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;o) old versions of mysqld only printed &lt;a href="http://bugs.mysql.com/bug.php?id=31891"&gt;numerical numbers&lt;/a&gt; instead of function names (if you're lucky!)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;o) some &lt;a href="http://bugs.mysql.com/bug.php?id=26893"&gt;platforms&lt;/a&gt;/architectures printed &lt;a href="http://bugs.mysql.com/bug.php?id=47391"&gt;no stack trace&lt;/a&gt; what-so-ever!&lt;/div&gt;&lt;div style="text-align: justify;"&gt;o) &lt;a href="http://bugs.mysql.com/bug.php?id=35987"&gt;faulty&lt;/a&gt; &lt;a href="http://bugs.mysql.com/bug.php?id=52850"&gt;implementations&lt;/a&gt; of the crash &lt;a href="http://bugs.mysql.com/bug.php?id=35661"&gt;error reporting&lt;/a&gt;&amp;nbsp;and running &lt;a href="http://bugs.mysql.com/bug.php?id=51817"&gt;query&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So, the result is that on modern supported platforms and recent versions of mysqld, you &lt;i&gt;should&lt;/i&gt; get a&amp;nbsp;useful stack trace. &amp;nbsp;A simple example from 5.5.5 on Windows:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;pre&gt;mysqld.exe!mysql_admin_table()[sql_table.cc:5150]&lt;br /&gt;mysqld.exe!mysql_optimize_table()[sql_table.cc:5226]&lt;br /&gt;mysqld.exe!mysql_execute_command()[sql_parse.cc:3107]&lt;br /&gt;mysqld.exe!mysql_parse()[sql_parse.cc:5911]&lt;br /&gt;mysqld.exe!dispatch_command()[sql_parse.cc:1138]&lt;br /&gt;mysqld.exe!do_command()[sql_parse.cc:807]&lt;br /&gt;mysqld.exe!do_handle_one_connection()[sql_connect.cc:1196]&lt;br /&gt;mysqld.exe!handle_one_connection()[sql_connect.cc:1136]&lt;br /&gt;mysqld.exe!pthread_start()[my_winthread.c:62]&lt;br /&gt;mysqld.exe!_callthreadstartex()[threadex.c:348]&lt;br /&gt;mysqld.exe!_threadstartex()[threadex.c:331]&lt;br /&gt;kernel32.dll!BaseThreadStart()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It should be obvious that &lt;a href="http://bugs.mysql.com/bug.php?id=54783"&gt;OPTIMIZE TABLE&lt;/a&gt; crashed here, since the function name is clear.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The reason I always use windows stack traces in bug reports is because they are readable. &amp;nbsp;Most GDB and linux error log stack traces are not readable by the human brain at a glance, and therefore not memorable. &amp;nbsp;One reason is &lt;a href="http://bugs.mysql.com/bug.php?id=26467"&gt;excessive wrapping&lt;/a&gt;,&amp;nbsp;another reason is offsets and arguments to the functions are irrelevant and not useful for search engine indexes or the average&amp;nbsp;Joe trying to find a bug report matching a stack trace.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;In the old days, a crash only this printed (only 32-bit), and you had to &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/resolve-stack-dump.html"&gt;resolve it yourself&lt;/a&gt;:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;0x81a0705&lt;br /&gt;0x8407eef&lt;br /&gt;0x8408a8f&lt;br /&gt;0x8408b75&lt;br /&gt;0x8408dd2&lt;br /&gt;0x8409af7&lt;br /&gt;0x83e7fc9&lt;br /&gt;0x83eefc3&lt;br /&gt;0x826014c&lt;br /&gt;0x826035c&lt;br /&gt;0x825ec43&lt;br /&gt;0x82106fd&lt;br /&gt;0x81b86da&lt;br /&gt;0x81bd78b&lt;br /&gt;0x81bdd16&lt;br /&gt;0x81bfae2&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Which, on a side note is not always possible to do properly with optimized binaries&amp;nbsp;so you get a &lt;span class="Apple-style-span" style="color: red;"&gt;partially bogus looking&lt;/span&gt; stack and you might be tempted to wrongly suspect faulty hardware, foul play, or bad binaries:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;0x81a0705 handle_segfault + 805&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;0x8407eef my_write + 671&lt;br /&gt;0x8408a8f init_key_cache + 1279&lt;br /&gt;0x8408b75 init_key_cache + 1509&lt;br /&gt;0x8408dd2 init_key_cache + 2114&lt;/span&gt;&lt;br /&gt;0x8409af7 flush_key_blocks + 55&lt;br /&gt;0x83e7fc9 flush_blocks + 41&lt;br /&gt;0x83eefc3 mi_repair_by_sort + 451&lt;br /&gt;0x826014c ha_myisam::repair(THD*, st_mi_check_param&amp;amp;, bool) + 1900&lt;br /&gt;0x826035c ha_myisam::enable_indexes(unsigned int) + 364&lt;br /&gt;0x825ec43 ha_myisam::end_bulk_insert() + 99&lt;br /&gt;0x82106fd mysql_insert(THD*, TABLE_LIST*, List&lt;item&gt;&amp;amp;, List&lt;list&gt;&lt;item&gt; &amp;gt;&amp;amp;, List&lt;item&gt;&amp;amp;, List&lt;item&gt;&amp;amp;, enum_duplicates, bool) + 5037&lt;br /&gt;0x81b86da mysql_execute_command(THD*) + 9610&lt;br /&gt;0x81bd78b mysql_parse(THD*, char const*, unsigned int, char const**) + 379&lt;br /&gt;0x81bdd16 dispatch_command(enum_server_command, THD*, char*, unsigned int) + 1238&lt;br /&gt;0x81bfae2 handle_one_connection + 2578&lt;br /&gt;&lt;/item&gt;&lt;/item&gt;&lt;/item&gt;&lt;/list&gt;&lt;/item&gt;&lt;/pre&gt;&lt;br /&gt;Using a technique that involves disassembling the mysqld binary into ASM and piecing together&amp;nbsp;C/C++ source code/comments, it's quite possible to find those inlined functions, expanded macros, or functions that have no name in the symbols file. &amp;nbsp;A nice topic for another posting. &amp;nbsp;So, after manually inspecting the binary + numeric offsets, I could get a &lt;span class="Apple-style-span" style="color: #38761d;"&gt;proper stack&lt;/span&gt; trace:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;0x81a0705 handle_segfault&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;0x8407eef unlink_block&lt;br /&gt;0x8408a8f free_block&lt;br /&gt;0x8408b75 flush_cached_blocks&lt;br /&gt;0x8408dd2 flush_key_blocks_int&lt;/span&gt;&lt;br /&gt;0x8409af7 flush_key_blocks&lt;br /&gt;0x83e7fc9 flush_blocks&lt;br /&gt;0x83eefc3 mi_repair_by_sort&lt;br /&gt;0x826014c ha_myisam::repair&lt;br /&gt;0x826035c ha_myisam::enable_indexes&lt;br /&gt;0x825ec43 ha_myisam::end_bulk_insert&lt;br /&gt;0x82106fd mysql_insert&lt;br /&gt;0x81b86da mysql_execute_command&lt;br /&gt;0x81bd78b mysql_parse&lt;br /&gt;0x81bdd16 dispatch_command&lt;br /&gt;0x81bfae2 handle_one_connection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is simply a bulk insert performing a 'repair by sort'. &amp;nbsp;It crashed in the keycache when flushing blocks, perhaps due to a memory corruption or overrun of something. &amp;nbsp;I remember fulltext indexes or large table having this problem..&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;span class="Apple-style-span" style="color: #073763;"&gt;Some Identifying Elements of a Stack Trace&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;If your 5.1.&lt;recent&gt; or 5.5.&lt;recent&gt; server ever crashes, please keep the stack trace as it can help identify exactly what the problem is, and you can &lt;a href="http://www.google.co.za/search?hl=en&amp;amp;newwindow=1&amp;amp;safe=off&amp;amp;q=site:bugs.mysql.com+crash+%22Prepared_statement::execute()%22&amp;amp;aq=f&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=&amp;amp;gs_rfai="&gt;search google&lt;/a&gt; for clues. &amp;nbsp;&lt;/recent&gt;&lt;/recent&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;prepared statements&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Easily&amp;nbsp;distinguishable&amp;nbsp;by looking for the functions similar to this:&lt;br /&gt;&lt;pre&gt;.....&lt;br /&gt;mysqld-debug.exe!Prepared_statement::execute()[sql_prepare.cc:3050]&lt;br /&gt;mysqld-debug.exe!mysql_sql_stmt_execute()[sql_prepare.cc:2393]&lt;br /&gt;mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2935]&lt;br /&gt;.....&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;stored routines and their call depth&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Seeing sp_* is a sign of some stored routine activity &amp;nbsp;You can even see how many SP calls there are nested, whether they called triggers. &amp;nbsp;Takes some intuition to follow.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;.......&lt;br /&gt;06 mysqld_debug!sp_instr_stmt::exec_core&lt;br /&gt;07 mysqld_debug!sp_lex_keeper::reset_lex_and_exec_core&lt;br /&gt;08 mysqld_debug!sp_instr_stmt::execute&lt;br /&gt;09 mysqld_debug!sp_head::execute&lt;br /&gt;0a mysqld_debug!sp_head::execute_procedure&lt;br /&gt;0b mysqld_debug!mysql_execute_command&lt;br /&gt;.......&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;storage engine code (archive, innodb, myisam, merge)&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;InnoDB mostly asserts, and this is clearly identified in the error log before a stack trace.&lt;/div&gt;&lt;div&gt;"070223 21:47:40 &amp;nbsp;InnoDB: Assertion failure in thread 1655241648 in file row0mysql.c line 3228"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Archive crashes can be easily seen by ha_archive functions:&lt;/div&gt;&lt;div&gt;&lt;pre&gt;.....&lt;br /&gt;mysqld.exe!ha_archive::free_share()[ha_archive.cc:411]&lt;br /&gt;mysqld.exe!ha_archive::open()[ha_archive.cc:498]&lt;br /&gt;mysqld.exe!handler::ha_open()[handler.cc:2059]&lt;br /&gt;.....&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;query cache&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Any thing involving the Query_Cache class functions:&lt;br /&gt;&lt;pre&gt;.....&lt;br /&gt;#5  0x000000000065f390 in Query_cache::insert_table ()&lt;br /&gt;#6  0x000000000065f63a in Query_cache::register_tables_from_list ()&lt;br /&gt;#7  0x000000000065f6a5 in Query_cache::register_all_tables ()&lt;br /&gt;#8  0x000000000065fc0a in Query_cache::store_query ()&lt;br /&gt;#9  0x000000000058cd38 in mysql_execute_command ()&lt;br /&gt;.....&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;mysql functions (string, math, datetime,&amp;nbsp;comparative)&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Look out for specific Item_func* methods...&lt;/div&gt;&lt;div&gt;&lt;pre&gt;.....&lt;br /&gt;mysqld.exe!Arg_comparator::compare_binary_string()[item_cmpfunc.cc:1158]&lt;br /&gt;mysqld.exe!Item_func_eq::val_int()[item_cmpfunc.cc:1692]&lt;br /&gt;mysqld.exe!Item::val_bool()[item.cc:184]&lt;br /&gt;mysqld.exe!Item_cond_and::val_int()[item_cmpfunc.cc:4222]&lt;br /&gt;.....&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;first calling function in the application&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;You can nearly always expect a valid stack trace to have these functions at the bottom:&lt;br /&gt;&lt;pre style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;.....&lt;br /&gt;mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2256]&lt;br /&gt;mysqld-debug.exe!mysql_parse()[sql_parse.cc:5974]&lt;br /&gt;mysqld-debug.exe!dispatch_command()[sql_parse.cc:1233]&lt;br /&gt;mysqld-debug.exe!do_command()[sql_parse.cc:872]&lt;br /&gt;mysqld-debug.exe!handle_one_connection()[sql_connect.cc:1127]&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;last calling functions before the crash&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Crashing is usually handled by mysqld's segfault handler. &amp;nbsp;It depends on the OS and environment. &amp;nbsp;Most of the time you'll have:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;mysqld-debug.exe!my_sigabrt_handler()[mysqld.cc:2048]&lt;br /&gt;mysqld-debug.exe!raise()[winsig.c:597]&lt;br /&gt;mysqld-debug.exe!abort()[abort.c:78]&lt;br /&gt;......&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;0   mysqld   0x00579d3e my_print_stacktrace + 44&lt;br /&gt;1   mysqld   0x00100f78 handle_segfault + 836&lt;br /&gt;......&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #073763;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Debugging Hangs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When mysqld hangs or flatlines the CPU and logging in or killing queries doesn't help, you'd better either create a corefile, &amp;nbsp;break into the process with a debugger, or just use the &lt;a href="http://poormansprofiler.org/"&gt;PMP&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You'll probably need stack trace of all the threads to determine what is going on:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A single thread is looping endlessly in some loop&lt;/li&gt;&lt;li&gt;Multiple threads are hitting a hot mutex, or totally deadlocked, waiting for each other.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;If the deadlock is in innodb you often get useful innodb outputs in the error log&lt;br /&gt;for each waiting thread.  But it can be extremely helpful to get full stack traces too.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;--Thread 3003468656 has waited at fsp/fsp0fsp.c line 2204 for 556.00 seconds the&lt;br /&gt;semaphore:&lt;br /&gt;X-lock on RW-latch at 0xb759ceb0 created in file fil/fil0fil.c line 1061&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;That's all for now.!&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-6633596476101225988?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/6633596476101225988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=6633596476101225988' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6633596476101225988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6633596476101225988'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2010/09/quick-review-of-stack-traces.html' title='A Quick Review of Stack Traces'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-754380901711994131</id><published>2010-06-16T09:53:00.002+02:00</published><updated>2010-06-16T10:31:45.909+02:00</updated><title type='text'>quick update from down under...</title><content type='html'>&lt;div style="text-align: justify;"&gt;I'm pleased to report that so far the Soccer World Cup has been pulled off rather successfully, with only minor incidents reported.  I have however noticed local news showing some 'feel-good' stories that are obviously written to give a &lt;a href="http://www.news24.com/SouthAfrica/News/Dbn-cops-find-missing-ring-20100615"&gt;false impression&lt;/a&gt; to the international media of the real situation here.  Let's hope the unions and Eskom workers don't mess things up by holding a gun to the Country's head with &lt;a href="http://www.sport24.co.za/Soccer/WorldCup/NationalNews/4-stadiums-hit-by-strike-20100615"&gt;protesting/striking&lt;/a&gt; too much in the international media's light.. Hold thumbs..  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;BTW, I hate the &lt;a href="http://en.wikipedia.org/wiki/Vuvuzela"&gt;vuvuzela&lt;/a&gt; :)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I thought I should share two important MySQL bugs with you today. In case you ever used YaSSL to establish &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/secure-connections.html"&gt;SSL connections&lt;/a&gt;, you were at risk of hitting random crashes due to &lt;a href="http://bugs.mysql.com/bug.php?id=34236"&gt;bug #34236&lt;/a&gt; (Various possibly related SSL crashes) if more than one concurrent connection was ever made.  The reason is the YaSSL code was built without mutexes as if for single threaded apps...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Next bug I think is widespread enough to mention is optimizer/query plan related. Examine the testcase on &lt;a href="http://bugs.mysql.com/bug.php?id=48537"&gt;bug #48537&lt;/a&gt; (difference of index selection between rpm binary and .tar.gz, windows vs linux..)  And read the changeset notes:&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;   On Intel x86 machines index selection by the MySQL query&lt;br /&gt;   optimizer could sometimes depend on the compiler version and&lt;br /&gt;   optimization flags used to build the server binary.&lt;br /&gt;&lt;br /&gt;   The problem was a result of a known issue with floating point&lt;br /&gt;   calculations on x86: since internal FPU precision (80 bit)&lt;br /&gt;   differs from precision used by programs (32-bit float or 64-bit&lt;br /&gt;   double), the result of calculating a complex expression may&lt;br /&gt;   depend on how FPU registers are allocated by the compiler and&lt;br /&gt;   whether intermediate values are spilled from FPU to memory. In&lt;br /&gt;   this particular case compiler versions and optimization flags&lt;br /&gt;   had an effect on cost calculation when choosing the best index&lt;br /&gt;   in best_access_path().&lt;br /&gt;&lt;br /&gt;   A possible solution to this problem which has already been&lt;br /&gt;   implemented in mysql-trunk is to limit FPU internal precision&lt;br /&gt;   to 64 bits. So the fix is a backport of the relevant code to&lt;br /&gt;   5.1 from mysql-trunk.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Now I'll get back to enjoying the public holiday and bugs reporting ;-)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-754380901711994131?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/754380901711994131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=754380901711994131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/754380901711994131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/754380901711994131'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2010/06/quick-update-from-down-under.html' title='quick update from down under...'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3135033542937225648</id><published>2010-05-14T08:14:00.003+02:00</published><updated>2010-05-14T08:53:22.183+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='pdh'/><category scheme='http://www.blogger.com/atom/ns#' term='perfmon'/><title type='text'>vmstat/iostat replacement for windows ?</title><content type='html'>I dislike the old &lt;a href="http://technet.microsoft.com/en-us/library/cc787707(WS.10).aspx"&gt;perfmon&lt;/a&gt; interface and it's unreadable graphs and logs.   For a long time I've been searching for a basic &lt;a href="http://linux.die.net/man/8/vmstat"&gt;vmstat&lt;/a&gt; and/or &lt;a href="http://linux.die.net/man/1/iostat"&gt;iostat&lt;/a&gt; windows port, and one that doesn't rely on that nonsensical cygwin.   If anybody knows of one, please leave a comment.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's a proof on concept I cooked up in 20 minutes using the &lt;a href="http://msdn.microsoft.com/en-us/library/aa373214(VS.85).aspx"&gt;PDH&lt;/a&gt; (performance data helper) functions.  In a nutshell, it queries the PDH counters directly and I'm be free to display&lt;/div&gt;&lt;div&gt;the data however I like.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's what I got so far:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;proc_q_len  pagefile  interrupt/s   cswitch/s  %cpu_user  %cpu_sys  %cpu_idle  %disk_busy   %disk_read  %disk_write&lt;br /&gt;  10      2308780032  2016          2555         64         26         9         100            0           100&lt;br /&gt;   3      2308911104  2863          3669         62         13        23         100            1           100&lt;br /&gt;   0      2309206016  1857          3057         79         10         9           2            0             2&lt;br /&gt;   0      2310217728  2579          3664         64          9        26         100            0           100&lt;br /&gt;   1      2309140480  2195          2985         71          3        25         100            0           100&lt;br /&gt;   2      2309140480  2241          3042         76          4        18         100            0           100&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not perfect, and I'm still trying to devise a proper layout for the stuff I want to display.&lt;/div&gt;&lt;div&gt;The columns shown correspond to the counters:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;\System\Processor Queue Length&lt;/li&gt;&lt;li&gt;\Process(_Total)\Page File Bytes&lt;/li&gt;&lt;li&gt;\Processor(_Total)\Interrupts/sec&lt;/li&gt;&lt;li&gt;\System\Context Switches/sec&lt;/li&gt;&lt;li&gt;\Processor(_Total)\% User Time&lt;/li&gt;&lt;li&gt;\Processor(_Total)\% Privileged Time&lt;/li&gt;&lt;li&gt;\Processor(_Total)\% Idle Time&lt;/li&gt;&lt;li&gt;\PhysicalDisk(_Total)\% Disk Time&lt;/li&gt;&lt;li&gt;\PhysicalDisk(_Total)\% Disk Read Time&lt;/li&gt;&lt;li&gt;\PhysicalDisk(_Total)\% Disk Write Time&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The general flow of code is like this (there are &lt;a href="http://msdn.microsoft.com/en-us/library/aa371886(v=VS.85).aspx"&gt;samples&lt;/a&gt; online):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.   &lt;a href="http://msdn.microsoft.com/en-us/library/aa372652(VS.85).aspx"&gt;PdhOpenQuery&lt;/a&gt;&lt;/div&gt;&lt;div&gt;2.   &lt;a href="http://msdn.microsoft.com/en-us/library/aa372204(VS.85).aspx"&gt;PdhAddCounter&lt;/a&gt; for each counter&lt;/div&gt;&lt;div&gt;3.   for each X seconds:&lt;/div&gt;&lt;div&gt;3.1 &lt;a href="http://msdn.microsoft.com/en-us/library/aa372563(VS.85).aspx"&gt;PdhCollectQueryData&lt;/a&gt;   &lt;/div&gt;&lt;div&gt;3.2 &lt;a href="http://msdn.microsoft.com/en-us/library/aa372637(VS.85).aspx"&gt;PdhGetFormattedCounterValue&lt;/a&gt; for each counter&lt;/div&gt;&lt;div&gt;3.3 print the result for each counter&lt;/div&gt;&lt;div&gt;4.   &lt;a href="http://msdn.microsoft.com/en-us/library/aa372558(VS.85).aspx"&gt;PdhCloseQuery&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3135033542937225648?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3135033542937225648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3135033542937225648' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3135033542937225648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3135033542937225648'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2010/05/vmstatiostat-replacement-for-windows.html' title='vmstat/iostat replacement for windows ?'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3691512649637994735</id><published>2010-05-03T16:40:00.003+02:00</published><updated>2010-05-03T17:01:19.973+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rbr'/><title type='text'>Beware of RBR and tables without indexes</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;I always knew RBR and unindexed tables didn't play along very well, but never realized just how much you can distress a slave can in some cases.&lt;br /&gt;Consider this statement (yeah yeah, i know :)&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;mysql&gt; delete from t1 order by rand(); &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Query OK, 78130 rows affected (2.61 sec)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;t1 has no indexes and is an int field with numbers from 1 to 78130. However, this will cause the slave to re-read entire table for each row deleted!  Here it's still running, causing 100% cpu usage:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;---TRANSACTION 0 1799, ACTIVE 2390 sec, OS thread id 3672 fetching rows mysql tables in use 1, locked 1 153 lock struct(s), heap size 30704, 78281 row lock(s), undo log entries 35423&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Number of rows inserted 78130, updated 0, deleted 35423, read 1076560253 0.00 inserts/s, 0.00 updates/s, 17.58 deletes/s, 367099.91 reads/s&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;Over a billion row reads 40 minutes later and it's not even half done yet.For a large table this could take weeks or years to complete.  It would be nice if there was a way to prevent this situation from happening.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3691512649637994735?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3691512649637994735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3691512649637994735' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3691512649637994735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3691512649637994735'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2010/05/beware-of-rbr-and-tables-without.html' title='Beware of RBR and tables without indexes'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-1903903502512651390</id><published>2010-02-12T16:22:00.005+02:00</published><updated>2010-02-22T15:02:27.341+02:00</updated><title type='text'>debugging mysqld corefile on AIX</title><content type='html'>&lt;div&gt;I recently had the pleasure of logging into an AIX 5.3 machine for the first time ever, to debug a corefile.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Firstly, having the mysqld binary and core is not enough, unless you have an identical machine on which to study the corefile.  Library mismatches can be a problem..   IBM was kind enough to provide the &lt;a href="http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds5/snapcore.htm"&gt;snapcore&lt;/a&gt; utility to solve this easily.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Snapcore will gather all the libraries and create a single archive contain libs, binary, core.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So we now have a file called something like: snapcore_555060.pax&lt;/div&gt;&lt;div&gt;On our dev box, extract the pax archive:  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;gunzip snapcore_555060.pax.Z&lt;/blockquote&gt;&lt;blockquote&gt;pax -r -f snapcore_555060.pax&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On your dev AIX box, make sure you have &lt;a href="http://docs.sun.com/app/docs/doc/819-5257"&gt;DBX&lt;/a&gt; installed!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;bash-3.00# lslpp -l | grep bos.adt.debug&lt;/div&gt;&lt;div&gt;bos.adt.debug              5.3.8.0  COMMITTED  Base Application Development&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we are ready to debug a core.  But we have to instruct DBX to read the libraries&lt;/div&gt;&lt;div&gt;that we got from the pax archive, instead of the default libraries on this system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;dbx -F -p /usr=/home/sbester/core/usr ./mysqld ./core&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And since this isn't a &lt;a href="http://blogs.sun.com/dbx/entry/gdb_vs_dbx_commands_mapping"&gt;DBX tutorial&lt;/a&gt;, I'll stop here, but you'll use normal DBX commands to print a stack trace, move up/down frames, print variables, list the source code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-1903903502512651390?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/1903903502512651390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=1903903502512651390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1903903502512651390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1903903502512651390'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2010/02/debugging-mysqld-corefile-on-aix.html' title='debugging mysqld corefile on AIX'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-4046411263295806460</id><published>2009-12-01T20:20:00.002+02:00</published><updated>2009-12-01T20:21:53.157+02:00</updated><title type='text'>a little challenge</title><content type='html'>How do you make mysqld write a DELETE to the binlog just by entering a SELECT statement ?&lt;br /&gt;No triggers and no stored routines/functions are involved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-4046411263295806460?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/4046411263295806460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=4046411263295806460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4046411263295806460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4046411263295806460'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/12/little-challenge.html' title='a little challenge'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-1113144763336509381</id><published>2009-08-27T07:53:00.004+02:00</published><updated>2009-08-27T08:06:34.754+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partitioning'/><category scheme='http://www.blogger.com/atom/ns#' term='auto_increment'/><title type='text'>partitioning + auto_increment is buggy!</title><content type='html'>Folks, I just want to warn you how buggy &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning.html"&gt;partitioned&lt;/a&gt; tables with negative values are.  &lt;span style="font-weight: bold;"&gt;Never&lt;/span&gt; use negative values for InnoDB &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html"&gt;auto_increment&lt;/a&gt; columns!!!!&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=46902"&gt;Assertion failed: next_insert_id &gt;= auto_inc_interval_for_cur_row.minimum()&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=46909"&gt;partitioned innodb tables end up with duplicate primary key values!&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=43988"&gt;AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45823"&gt;Assertion failure in file row/row0mysql.c line 1386&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;There are more bugs than I listed here..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-1113144763336509381?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/1113144763336509381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=1113144763336509381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1113144763336509381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1113144763336509381'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/08/partitioning-autoincrement-is-buggy.html' title='partitioning + auto_increment is buggy!'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3610523317494335392</id><published>2009-06-27T13:29:00.004+02:00</published><updated>2009-06-27T13:36:47.310+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='merge tables'/><title type='text'>5.1 doesn't solve all merge table hell from 5.0.</title><content type='html'>This week I've had to revisit &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/merge-storage-engine.html"&gt;merge tables&lt;/a&gt; once again due to customers experiencing problems.     Although 5.1 merge table implementation is a &lt;span style="font-weight: bold;"&gt;huge&lt;/span&gt; improvement over 5.0, there still remains some critical bugs.&lt;br /&gt;&lt;br /&gt;My list is still growing:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45800"&gt;bug #45800&lt;/a&gt;: crash when replacing into a merge table and there is a duplicate&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45781"&gt;bug #45781&lt;/a&gt;:    infinite hang/crash in "opening tables" after handler tries to open merge table&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45796"&gt;bug #45796&lt;/a&gt;:    invalid memory reads and writes when altering merge and base tables&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45777"&gt;bug #45777&lt;/a&gt;:    check table doesn't show all problems for merge table compliance in 5.1&lt;br /&gt;&lt;br /&gt;Not to mention a few &lt;a href="http://bugs.mysql.com/bug.php?id=45799"&gt;feature requests&lt;/a&gt;, and even &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/merge-table-problems.html"&gt;documentation clarification&lt;/a&gt; for some manual sections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3610523317494335392?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3610523317494335392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3610523317494335392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3610523317494335392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3610523317494335392'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/06/51-doesnt-solve-all-merge-table-hell.html' title='5.1 doesn&apos;t solve all merge table hell from 5.0.'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-8973137044503897248</id><published>2009-06-19T07:38:00.002+02:00</published><updated>2009-06-19T07:47:43.007+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><title type='text'>some useful additions to query generator</title><content type='html'>I've been on vacation this week, and decided to fine-tune some old QA code.   Opened the manual to see the syntax for a select statement, and afterwards added to my random select generator the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;all index hints (force, use, ignore, for join, for order by, for group by)&lt;/li&gt;&lt;li&gt;lock in share mode, for update&lt;/li&gt;&lt;li&gt;key_block_size for individual indexes&lt;/li&gt;&lt;li&gt;hash, btree, rtree for individual indexes&lt;/li&gt;&lt;li&gt;unique, fulltext, spatial for indexes&lt;/li&gt;&lt;/ul&gt;Especially important is the 'lock in share mode' addition.  The reason is InnoDB&lt;br /&gt;has many serious bugs with this locking mode (insert ... select, and others) in read committed mode.&lt;br /&gt;&lt;br /&gt;So, I don't need multitable delete or update to reproduce those bugs, since I can just do a simple select locking in share mode.   For example, the following bugs previously went without proper testcase until I discovered this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=39320"&gt;assert btr/btr0pcur.c line 217 -innodb_locks_unsafe_for_binlog or read committed&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=45357"&gt;5.1.35 crashes with Failing assertion: index-&gt;type &amp;amp; DICT_CLUSTERED&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=41756"&gt;Strange error messages about locks from InnoDB&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-8973137044503897248?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/8973137044503897248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=8973137044503897248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8973137044503897248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8973137044503897248'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/06/some-useful-additions-to-query.html' title='some useful additions to query generator'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-8970379091639829047</id><published>2009-06-02T07:47:00.002+02:00</published><updated>2009-06-02T07:53:16.678+02:00</updated><title type='text'>some bug stats</title><content type='html'>So I did some checking at the number of bugs I've reported since start of 2005.   Seems I'm at the top of my game here!&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;P1 Server bugs: 180 (next runner up PeterG with 127)&lt;/li&gt;&lt;li&gt;P1 + P2 Server bugs: 321 (next runner up PeterG with 311)&lt;/li&gt;&lt;/ul&gt;Interesting to note that most of my bug filing happened after 2006, but I started working at MySQL in 2005, so that's why I've used that start date.&lt;br /&gt;&lt;br /&gt;The runner ups mostly report bugs in alpha versions, falcon, maria, and beta versions of mysql.&lt;br /&gt;Nearly all of my bugs are in the current GA versions since that is what most of our customers use.&lt;br /&gt;&lt;br /&gt;On occasion I go off on a tangent and try break the subquery optimizations in 6.0, but this&lt;br /&gt;is only a small percentage of the total.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-8970379091639829047?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/8970379091639829047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=8970379091639829047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8970379091639829047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8970379091639829047'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/06/some-bug-stats.html' title='some bug stats'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-7072462609243097132</id><published>2009-05-11T10:35:00.003+02:00</published><updated>2009-05-11T10:43:28.421+02:00</updated><title type='text'>been a shocking week for 5.1.35</title><content type='html'>so last week i started tweaking some of my old 'rainbow' scripts, and found 1 bug for each day of the week. there are a few more in the pipeline still...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44774"&gt;Bug #44774&lt;/a&gt; (load_file function produces valgrind warnings)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44768"&gt;Bug #44768&lt;/a&gt; (SIGFPE crash when selecting rand from a view containing null)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44767"&gt;Bug #44767&lt;/a&gt; (invalid memory reads in password() and old_password() functions)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44766"&gt;Bug #44766&lt;/a&gt; (valgrind error when using convert() in a subquery)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44684"&gt;Bug #44684&lt;/a&gt; (valgrind reports invalid reads in Item_func_spatial_collection::val_str)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44672"&gt;Bug #44672&lt;/a&gt; (Assertion failed: thd-&gt;transaction.xid_state.xid.is_null())&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44664"&gt;Bug #44664&lt;/a&gt; (valgrind warning for COMMIT_AND_CHAIN and ROLLBACK_AND_CHAIN)&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=44633"&gt;Bug #44633&lt;/a&gt; (Automatic search depth and nested join's results in server crash - v2)&lt;br /&gt;&lt;br /&gt;so, it seems i am still useful for bug finding, even with old tools i created pre-5.1 GA&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-7072462609243097132?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/7072462609243097132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=7072462609243097132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/7072462609243097132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/7072462609243097132'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/05/been-shocking-week-for-5135.html' title='been a shocking week for 5.1.35'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-4132323586195860767</id><published>2009-01-10T20:07:00.002+02:00</published><updated>2009-01-10T20:10:54.090+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MXit'/><title type='text'>MXit !</title><content type='html'>Today I started writing a PC client for MXit, because the existing ones suck.  Since the company uses a proprietary variation of the jabber protocol to reduce bandwidth usage, I have to decode the protocol myself..  Will post details of it later...&lt;br /&gt;&lt;br /&gt;Get MXit &lt;a href="http://www.mxit.co.za/web/downloadmxit.htm"&gt;http://www.mxit.co.za/web/downloadmxit.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-4132323586195860767?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/4132323586195860767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=4132323586195860767' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4132323586195860767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4132323586195860767'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2009/01/mxit.html' title='MXit !'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-4787521890701118700</id><published>2009-01-05T14:01:00.005+02:00</published><updated>2009-02-21T10:14:20.714+02:00</updated><title type='text'>Kilimanjaro preparations</title><content type='html'>So I have started training to get fit enough to gracefully reach the top of &lt;a href="http://en.wikipedia.org/wiki/Kilimanjaro"&gt;Kilimanjaro&lt;/a&gt; in 2009.&lt;br /&gt;Information on the &lt;a href="http://en.wikipedia.org/wiki/Mount_Kilimanjaro_climbing_routes"&gt;various routes&lt;/a&gt; here.&lt;br /&gt;&lt;br /&gt;Here I will keep a log of certain walks I do, and their timings.&lt;br /&gt;Note that time_down usually includes time spent at the summit.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;+------------+------------+------------+-----------+------------+------------------------------------------------------+&lt;br /&gt;| date       | start_time | time_there | time_back | time_total | venue                                                |&lt;br /&gt;+------------+------------+------------+-----------+------------+------------------------------------------------------+&lt;br /&gt;| 2008-12-27 | 16:37:00   | 00:47:00   | 00:32:00  | 01:19:00   | Lions Head                                           |&lt;br /&gt;| 2008-12-28 | 05:47:00   | 00:48:00   | 00:35:00  | 01:23:00   | Lions Head                                           |&lt;br /&gt;| 2008-12-30 | 12:57:00   | 00:42:00   | 00:30:00  | 01:12:00   | Lions Head                                           |&lt;br /&gt;| 2008-12-31 | 12:24:00   | 00:39:00   | 00:30:00  | 01:09:00   | Lions Head                                           |&lt;br /&gt;| 2009-01-02 | 12:09:00   | 00:37:00   | 00:28:00  | 01:05:00   | Lions Head                                           |&lt;br /&gt;| 2009-01-05 | 12:45:00   | 00:39:00   | 00:22:00  | 01:01:00   | Lions Head                                           |&lt;br /&gt;| 2009-01-07 | 17:19:00   | 00:37:00   | 00:21:00  | 00:58:00   | Lions Head                                           |&lt;br /&gt;| 2009-01-14 | 12:10:00   | 01:01:00   | 01:29:00  | 02:30:00   | Home-&gt;La Med (via KloofNek)-&gt;Joburg (via Sea Point)  |&lt;br /&gt;| 2009-01-24 | 06:00:00   | 01:05:00   | 00:47:00  | 01:52:00   | Platteklip                                           |&lt;br /&gt;| 2009-01-29 | 13:30:00   | 00:38:00   | 00:27:00  | 01:05:00   | Lions Head                                           |&lt;br /&gt;| 2009-02-21 | 07:26:00   | 00:58:00   | 01:31:00  | 02:29:00   | Home-&gt;La Med (via KloofNek)-&gt;Joburg) (via Sea Point) |&lt;br /&gt;+------------+------------+------------+-----------+------------+------------------------------------------------------+&lt;br /&gt;11 rows in set (0.03 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rWQ25b5P8wk/SWBn0vp7WtI/AAAAAAAAAPs/fe_NVA-KYYE/s1600-h/100_1222_resample_040.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_rWQ25b5P8wk/SWBn0vp7WtI/AAAAAAAAAPs/fe_NVA-KYYE/s200/100_1222_resample_040.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5287340118376143570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rWQ25b5P8wk/SWBoJ8xZL_I/AAAAAAAAAP0/lgFWjmdn4vU/s1600-h/100_1223_resample_041.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_rWQ25b5P8wk/SWBoJ8xZL_I/AAAAAAAAAP0/lgFWjmdn4vU/s200/100_1223_resample_041.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5287340482674372594" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rWQ25b5P8wk/SWBox9J3_7I/AAAAAAAAAP8/_O_lL6lEzU4/s1600-h/100_1203_resample_021.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_rWQ25b5P8wk/SWBox9J3_7I/AAAAAAAAAP8/_O_lL6lEzU4/s200/100_1203_resample_021.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5287341169971822514" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-4787521890701118700?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/4787521890701118700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=4787521890701118700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4787521890701118700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/4787521890701118700'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2008/12/lions-head-walk-timings.html' title='Kilimanjaro preparations'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_rWQ25b5P8wk/SWBn0vp7WtI/AAAAAAAAAPs/fe_NVA-KYYE/s72-c/100_1222_resample_040.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-2666741658924237223</id><published>2008-09-20T06:34:00.005+02:00</published><updated>2010-04-29T15:39:01.975+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='innodb'/><title type='text'>innodb index page format</title><content type='html'>Today I had to decode an innodb index page, so I documented the entire process here:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;E:\mysql-enterprise-gpl-5.0.66a-winx64\bin&gt;mysqld-nt --console --skip-grant-tables --skip-name-resolve&lt;br /&gt;InnoDB: The first specified data file .\ibdata1 did not exist:&lt;br /&gt;InnoDB: a new database to be created!&lt;br /&gt;080919 14:29:00  InnoDB: Setting file .\ibdata1 size to 10 MB&lt;br /&gt;InnoDB: Database physically writes the file full: wait...&lt;br /&gt;080919 14:29:00  InnoDB: Log file .\ib_logfile0 did not exist: new to be created&lt;br /&gt;InnoDB: Setting log file .\ib_logfile0 size to 5 MB&lt;br /&gt;InnoDB: Database physically writes the file full: wait...&lt;br /&gt;080919 14:29:01  InnoDB: Log file .\ib_logfile1 did not exist: new to be created&lt;br /&gt;InnoDB: Setting log file .\ib_logfile1 size to 5 MB&lt;br /&gt;InnoDB: Database physically writes the file full: wait...&lt;br /&gt;InnoDB: Doublewrite buffer not found: creating new&lt;br /&gt;InnoDB: Doublewrite buffer created&lt;br /&gt;InnoDB: Creating foreign key constraint system tables&lt;br /&gt;InnoDB: Foreign key constraint system tables created&lt;br /&gt;080919 14:29:01  InnoDB: Started; log sequence number 0 0&lt;br /&gt;080919 14:29:01 [Note] mysqld-nt: ready for connections.&lt;br /&gt;Version: '5.0.66a-enterprise-gpl-nt'  socket: ''  port: 3306  MySQL Enterprise Server (GPL)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create table t1(a varchar(20) primary key, b varchar(20), c varchar(20),key(b),key(c,b))engine=innodb;&lt;br /&gt;insert into t1(a,b,c) values ('aaaa','bbbbb','cccccc');&lt;br /&gt;insert into t1(a,b,c) values ('aaaaaaa',null,'ccc');&lt;br /&gt;insert into t1(a,b,c) values ('a','b',null);&lt;br /&gt;insert into t1(a,b,c) values ('aaaaaaaaaa','bbb','c');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;080919 14:37:59 [Note] mysqld-nt: Normal shutdown&lt;br /&gt;&lt;br /&gt;080919 14:37:59  InnoDB: Starting shutdown...&lt;br /&gt;080919 14:38:14  InnoDB: Shutdown completed; log sequence number 0 48536&lt;br /&gt;080919 14:38:14 [Note] mysqld-nt: Shutdown complete&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;we have secondary indexes on this table&lt;br /&gt;&lt;br /&gt;this is key(c,b) (directly from ibdata1):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;000d0000h: 35 56 71 04 00 00 00 34 FF FF FF FF FF FF FF FF ; 5Vq....4ÿÿÿÿÿÿÿÿ&lt;br /&gt;000d0010h: 00 00 00 00 00 00 BD 92 45 BF 00 00 00 00 00 00 ; ......½’E¿......&lt;br /&gt;000d0020h: 00 00 00 00 00 00 00 02 00 C3 80 06 00 00 00 00 ; .........Ã€.....&lt;br /&gt;000d0030h: 00 B5 00 05 00 00 00 04 00 00 00 00 00 00 03 05 ; .µ..............&lt;br /&gt;000d0040h: 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 ; ................&lt;br /&gt;000d0050h: 00 02 15 F2 00 00 00 00 00 00 00 02 15 32 01 00 ; ...ò.........2..&lt;br /&gt;000d0060h: 02 00 47 69 6E 66 69 6D 75 6D 00 05 00 0B 00 00 ; ..Ginfimum......&lt;br /&gt;000d0070h: 73 75 70 72 65 6D 75 6D 04 05 06 00 00 00 10 FF ; supremum.......ÿ&lt;br /&gt;000d0080h: EF 63 63 63 63 63 63 62 62 62 62 62 61 61 61 61 ; ïccccccbbbbbaaaa&lt;br /&gt;000d0090h: 07 03 02 00 00 18 FF E9 63 63 63 61 61 61 61 61 ; ......ÿécccaaaaa&lt;br /&gt;000d00a0h: 61 61 01 01 01 00 00 20 00 0B 62 61 0A 03 01 00 ; aa..... ..ba....&lt;br /&gt;000d00b0h: 00 00 28 FF E3 63 62 62 62 61 61 61 61 61 61 61 ; ..(ÿãcbbbaaaaaaa&lt;br /&gt;000d00c0h: 61 61 61 00 00 00 00 00 00 00 00 00 00 00 00 00 ; aaa.............&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let's reformat this page into the correct fields as seen by InnoDB:&lt;br /&gt;&lt;br /&gt;0000: 35567104           -&gt; FIL_PAGE_SPACE_OR_CHKSUM&lt;br /&gt;0004: 00000034           -&gt; FIL_PAGE_OFFSET                                    &lt;br /&gt;0008: FFFFFFFF           -&gt; FIL_PAGE_PREV                                      &lt;br /&gt;0012: FFFFFFFF           -&gt; FIL_PAGE_NEXT                                       &lt;br /&gt;0016: 000000000000BD92   -&gt; FIL_PAGE_LSN&lt;br /&gt;0024: 45BF               -&gt; FIL_PAGE_TYPE  (#define FIL_PAGE_INDEX 17855)&lt;br /&gt;0026: 0000000000000000   -&gt; FIL_PAGE_FILE_FLUSH_LSN&lt;br /&gt;0034: 00000000           -&gt; FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID&lt;br /&gt;&lt;br /&gt;0038: 0002               -&gt; PAGE_N_DIR_SLOTS&lt;br /&gt;0040: 00C3               -&gt; PAGE_HEAP_TOP   (195 ...)&lt;br /&gt;0042: 8006               -&gt; PAGE_N_HEAP  (6 records in heap (remove 15th bit)&lt;br /&gt;0044: 0000               -&gt; PAGE_FREE&lt;br /&gt;0046: 0000               -&gt; PAGE_GARBAGE&lt;br /&gt;0048: 00B5               -&gt; PAGE_LAST_INSERT&lt;br /&gt;0050: 0005               -&gt; PAGE_DIRECTION  (PAGE_NO_DIRECTION)&lt;br /&gt;0052: 0000               -&gt; PAGE_N_DIRECTION&lt;br /&gt;0054: 0004               -&gt; PAGE_N_RECS&lt;br /&gt;0056: 0000000000000305   -&gt; PAGE_MAX_TRX_ID (773)&lt;br /&gt;0064: 0000               -&gt; PAGE_LEVEL&lt;br /&gt;0066: 0000000000000011     -&gt; PAGE_INDEX_ID ( Page may be an index page where index id is 0 277385)&lt;br /&gt;0074: 000000000000000215F2 -&gt; PAGE_BTR_SEG_LEAF&lt;br /&gt;0084: 00000000000000021532 -&gt; PAGE_BTR_SEG_TOP&lt;br /&gt;&lt;br /&gt;infimum:&lt;br /&gt;0094: 01                -&gt; info_bits=0, n_owned=1 (always 1 for the infimum)&lt;br /&gt;0095: 00                -&gt; heap number&lt;br /&gt;0096: 02                -&gt; status bits&lt;br /&gt;0097: 0047              -&gt; next record (71 bytes)&lt;br /&gt;0099: 696E66696D756D00  -&gt; "infimum"&lt;br /&gt;&lt;br /&gt;supremum:&lt;br /&gt;0107: 05000b            -&gt; extra bytes&lt;br /&gt;0110: 0000              -&gt; next record, zero since supremum is always last&lt;br /&gt;0112: 73757072656D756D  -&gt; "supremum"&lt;br /&gt;&lt;br /&gt;index row1:&lt;br /&gt;0120: 040506            -&gt; field offsets, starting with the last field.&lt;br /&gt;0123: 00000010          -&gt; extra bytes&lt;br /&gt;0127: FFEF              -&gt; offset to next record (17 bytes back (offset 112))&lt;br /&gt;0129: 636363636363      -&gt; 'cccccc' (keypart1)&lt;br /&gt;0135: 6262626262        -&gt; 'bbbbb'  (keypart2)&lt;br /&gt;0140: 61616161          -&gt; 'aaaa'   (primary key appended)&lt;br /&gt;&lt;br /&gt;index row2:&lt;br /&gt;0144: 0703              -&gt; field lengths, starting with the last field (excluding null!).&lt;br /&gt;0146: 02000018          -&gt; extra bytes&lt;br /&gt;0150: FFE9              -&gt; offset to next record (23 bytes back (offset 129))&lt;br /&gt;0152: 636363            -&gt; 'ccc' (keypart1)&lt;br /&gt;0155: 61616161616161    -&gt; 'aaaaaaa' (primary key appended)&lt;br /&gt;&lt;br /&gt;index row3:&lt;br /&gt;0162: 0101              -&gt; field lengths, starting with the last field (excluding null!).&lt;br /&gt;0164: 01000020          -&gt; extra bytes&lt;br /&gt;0168: 000B              -&gt; offset to next record (11 bytes (offset 181))&lt;br /&gt;0170: 62                -&gt; 'b' (keypart2)&lt;br /&gt;0171: 61                -&gt; 'a' (primary key appended)&lt;br /&gt;&lt;br /&gt;index row4:&lt;br /&gt;0172: 0A0301            -&gt; field lengths&lt;br /&gt;0175: 00000028          -&gt; extra bytes&lt;br /&gt;0179: FFE3              -&gt; offset to next record (29 bytes back (offset 152!))&lt;br /&gt;0181: 63                -&gt; 'c' (keypart1)&lt;br /&gt;0182: 626262            -&gt; 'bbb' (keypart2)&lt;br /&gt;0185: 61616161616161616161 -&gt; 'aaaaaaaaaa' (primary key appended)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;explanation of "extra bytes" still to be done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-2666741658924237223?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/2666741658924237223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=2666741658924237223' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2666741658924237223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2666741658924237223'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2008/09/innodb-index-page-format.html' title='innodb index page format'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-5640243490938709536</id><published>2008-08-21T21:25:00.005+02:00</published><updated>2008-08-22T09:22:07.831+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='core file'/><category scheme='http://www.blogger.com/atom/ns#' term='gdb'/><title type='text'>how to debug a mysqld core file from an rpm install</title><content type='html'>You have a typical rpm installation of mysql, and the process is crashing.  Here are the basic steps needed to find out more info about a crash:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Configure the OS to be able to create corefiles. (&lt;a href="http://kbase.redhat.com/faq/FAQ_52_2890.shtm"&gt;Redhat details&lt;/a&gt;), (&lt;a href="http://developers.sun.com/solaris/articles/manage_core_dump.html"&gt;Solaris details&lt;/a&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Tell mysqld to create a corefile by adding the following options to my.cnf:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;br /&gt;[mysqld_safe]&lt;br /&gt;core-file-size=unlimited&lt;br /&gt;&lt;br /&gt;[mysqld]&lt;br /&gt;core-file&lt;/blockquote&gt;Usually the corefile will be created in the datadir with a name like core.2921 where 2921 was the pid of the running process.   The location is configurable on most OS's.&lt;br /&gt;&lt;br /&gt;You'll need the following to study the core file:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;exact mysqld binary that created the core file&lt;/li&gt;&lt;li&gt;the core file&lt;/li&gt;&lt;li&gt;the glibc version of the original system (rpm -qa|grep -i glibc)&lt;/li&gt;&lt;li&gt;the debuginfo package corresponding to the original mysql rpms.&lt;/li&gt;&lt;/ul&gt;Let's go through a hypothetical example next.&lt;br /&gt;On my server I have installed &lt;a href="http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-server-community-5.0.67-0.rhel5.x86_64.rpm/from/pick"&gt;MySQL-server-community-5.0.67-0.rhel5.x86_64.rpm&lt;/a&gt; and it's been crashing.  I have a corefile called core.12345 which I've moved to a test system because I don't want to impact production while playing around with it.&lt;br /&gt;&lt;br /&gt;On the production server we have glibc 2.3.4-2.36 installed.  So to setup the test box to study the core I do this:&lt;br /&gt;&lt;br /&gt;From dev.mysql.com download the &lt;a href="http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-community-debuginfo-5.0.67-0.rhel5.x86_64.rpm/from/pick"&gt;MySQL-community-debuginfo-5.0.67-0.rhel5.x86_64.rpm&lt;/a&gt;&lt;br /&gt;Download the glibc-2.3.4-2.36.x86_64.rpm from somewhere (in case test system isn't running same version).  Next we extract the RPMS and launch gdb and tell it the path to load libraries and symbol files:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;rpm2cpio MySQL-community-debuginfo-5.0.67-0.rhel5.x86_64.rpm   | cpio -idvu&lt;br /&gt;rpm2cpio glibc-2.3.4-2.36.x86_64.rpm   | cpio -idvu&lt;br /&gt;&lt;br /&gt;gdb ./mysqld --core ./core.12345&lt;br /&gt;set solib-absolute-prefix .&lt;br /&gt;file ./usr/lib/debug/usr/sbin/mysqld.debug&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;From here you should &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html"&gt;get reasonable output from GDB&lt;/a&gt;, such as "thread apply all bt" and "bt full" and continue to examine the corefile...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-5640243490938709536?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/5640243490938709536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=5640243490938709536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5640243490938709536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5640243490938709536'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2008/08/how-to-debug-mysqld-core-file-from-rpm.html' title='how to debug a mysqld core file from an rpm install'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-2327499225051345109</id><published>2008-07-04T16:28:00.005+02:00</published><updated>2008-08-21T22:20:42.868+02:00</updated><title type='text'>gypsy is resumed</title><content type='html'>In search of better qa tools, i have resumed work on my gypsy. Within hours i verified a bug i thought was not possible any time soon...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=37671"&gt;&lt;span style="font-weight: bold;"&gt;crash on prepared statement + cursor + geometry + too many open files !&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The code is also in launchpad (bzr branch lp:gypsy) if anybody cares.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-2327499225051345109?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/2327499225051345109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=2327499225051345109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2327499225051345109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2327499225051345109'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2008/07/gypsy-is-resumed.html' title='gypsy is resumed'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3063135025149440720</id><published>2008-04-16T20:50:00.003+02:00</published><updated>2008-04-16T20:53:41.304+02:00</updated><title type='text'>innodb plugin and new features!</title><content type='html'>check it out:&lt;br /&gt;&lt;a href="http://www.innodb.com/wp/2008/04/15/innodb-plugin-announced/"&gt;the announcement&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.innodb.com/doc/innodb_plugin-1.0/"&gt;plugin documentation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;o) Fast Index Creation in the InnoDB Storage Engine&lt;br /&gt;o) InnoDB Data Compression&lt;br /&gt;o) InnoDB File Format Management&lt;br /&gt;o) InnoDB INFORMATION_SCHEMA tables&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;yay!! gonna test the compression immediately :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3063135025149440720?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3063135025149440720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3063135025149440720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3063135025149440720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3063135025149440720'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2008/04/innodb-plugin-and-new-features.html' title='innodb plugin and new features!'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-8546733060487975954</id><published>2007-10-23T20:40:00.000+02:00</published><updated>2007-10-23T20:49:39.525+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><category scheme='http://www.blogger.com/atom/ns#' term='testcase'/><title type='text'>putting it all together</title><content type='html'>Last post was about Rainbow testing.  So that's old news, and I lost count of the number of bugs it found, and have been fixed.  Probably 30+ crashes.  &lt;br /&gt;&lt;br /&gt;Now, I have to put together all these odds &amp; ends of code I wrote disparately over the last 18 months into a single collection to enable complete end-to-end testing.&lt;br /&gt;&lt;br /&gt;I have now got roughly the following:&lt;br /&gt;&lt;br /&gt;o) random table maker&lt;br /&gt;o) query maker based on any tables, (using predefined rules)&lt;br /&gt;o) data generator for any tables&lt;br /&gt;o) complete charset collection for each valid character&lt;br /&gt;o) database of mysql functions, data types&lt;br /&gt;o) multi-threaded testing environment for any queries&lt;br /&gt;o) query results comparer for any queries&lt;br /&gt;o) rainbow, which will provide help in making good coverage of functions, etc.&lt;br /&gt;&lt;br /&gt;What's needed still?  Well, I would like 56 hours in a day ...  More posts later when v0.001 of the integrated is semi-functional :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-8546733060487975954?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/8546733060487975954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=8546733060487975954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8546733060487975954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/8546733060487975954'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/10/putting-it-all-together.html' title='putting it all together'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-1251540106388688392</id><published>2007-09-19T17:05:00.000+02:00</published><updated>2007-09-19T17:14:18.124+02:00</updated><title type='text'>mysql crash log analyzer ?</title><content type='html'>So with over 1000 crashes in my logs from just one night of simple queries, I have a painful time to find new crashes in the 90MB file.  So I'm taking a detour on the rainbow query generator for 2 days.  Will be writing an error log analyzer instead :)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;step 1: upload the mysqld and the mysqld.sym file for the version you're working with.&lt;br /&gt;step 2: import the binary and symbols into a mysql table&lt;br /&gt;step 3: upload the error log&lt;br /&gt;step 4: parse the error log into seperate crashes&lt;br /&gt;step 5: find the stack traces for each crash, and resolve them using the symbols&lt;br /&gt;step 6: determine if this crash is matching any existing crashes.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With thousands of crashes on various builds of mysqld, the above system can be useful to me.  Also, I'd import all the crashes from reports on bugs.mysql.com for searching purposes.  This toy will allow me to identify whether a crash is new, or it's been seen before.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-1251540106388688392?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/1251540106388688392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=1251540106388688392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1251540106388688392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1251540106388688392'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/09/mysql-crash-log-analyzer.html' title='mysql crash log analyzer ?'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-166889235395786047</id><published>2007-09-19T13:45:00.000+02:00</published><updated>2007-09-19T13:56:29.163+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><title type='text'>some results of rainbow</title><content type='html'>ok folks.  here's some results:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;mysql&gt; select last_errno,count(*) from &lt;br /&gt;queryqueue group by last_errno;&lt;br /&gt;+------------+----------+&lt;br /&gt;| last_errno | count(*) |&lt;br /&gt;+------------+----------+&lt;br /&gt;|          0 |  1600796 |&lt;br /&gt;|       1048 |     1971 |&lt;br /&gt;|       1053 |        1 |&lt;br /&gt;|       1139 |       35 |&lt;br /&gt;|       1267 |    19722 |&lt;br /&gt;|       1270 |     4243 |&lt;br /&gt;|       1271 |     8944 |&lt;br /&gt;|       1416 |     2284 |&lt;br /&gt;|       1580 |    23225 |&lt;br /&gt;|       2003 |       28 |&lt;br /&gt;|       2013 |     1606 |&lt;br /&gt;+------------+----------+&lt;br /&gt;11 rows in set (0.00 sec)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;error 2013 means lost connection to server (read: server crashed).&lt;br /&gt;so there are many bugs found already.  1606 crashes out of 1.6 million&lt;br /&gt;executed queries, is great.&lt;br /&gt;&lt;br /&gt;check my rss feed for the exact bugs ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-166889235395786047?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/166889235395786047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=166889235395786047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/166889235395786047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/166889235395786047'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/09/some-results-of-rainbow.html' title='some results of rainbow'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-6640522144209610419</id><published>2007-09-12T11:01:00.000+02:00</published><updated>2007-09-12T11:03:22.695+02:00</updated><title type='text'>good news!</title><content type='html'>my girlfriend's grandfather wants a blog!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-6640522144209610419?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/6640522144209610419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=6640522144209610419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6640522144209610419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6640522144209610419'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/09/good-news.html' title='good news!'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3648765238047722651</id><published>2007-09-07T09:03:00.000+02:00</published><updated>2007-09-12T20:57:16.390+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><category scheme='http://www.blogger.com/atom/ns#' term='testcase'/><title type='text'>sql rainbow tables</title><content type='html'>I thought of a brilliant QA plan.  Create sql rainbow tables!  Just trust me, this system of QA will be &lt;span style="font-weight:bold;"&gt;very powerful&lt;/span&gt; in bug finding.   Especially important will be the comparison of old/new versions of mysql.  Writing a prototype now, on my day off.&lt;br /&gt;&lt;br /&gt;Just during prototype development, I've discovered a handful of bugs.  I'm testing all functions that are documented in the manual.  This is alot that I've written up:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; select count(*),category from func group by category;&lt;br /&gt;+----------+--------------+&lt;br /&gt;| count(*) | category     |&lt;br /&gt;+----------+--------------+&lt;br /&gt;|        6 | arithmetic   |&lt;br /&gt;|        7 | bit          |&lt;br /&gt;|       60 | casting      |&lt;br /&gt;|       47 | comparison   |&lt;br /&gt;|       52 | datetime     |&lt;br /&gt;|       18 | encryption   |&lt;br /&gt;|      127 | geometry     |&lt;br /&gt;|       17 | information  |&lt;br /&gt;|        7 | logical      |&lt;br /&gt;|       32 | mathematical |&lt;br /&gt;|        9 | misc         |&lt;br /&gt;|       47 | string       |&lt;br /&gt;|        2 | xml          |&lt;br /&gt;+----------+--------------+&lt;br /&gt;13 rows in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let me explain this rainbow tables concept with a simple example.&lt;br /&gt;Suppose we have a function, like "GREATEST()".&lt;br /&gt;&lt;br /&gt;I run a query like this:&lt;br /&gt;&lt;br /&gt;SELECT GREATEST(col1,col2,col3) FROM table0;&lt;br /&gt;&lt;br /&gt;The columns col1,col2,col3 will form any combination of column type.  So we have int, date, string, blob, spatial!  Given a combination of all datatypes and all function parameters, it leaves us with a good few million queries.  Of course, a few million queries is not so much for a machine to execute quickly..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3648765238047722651?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3648765238047722651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3648765238047722651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3648765238047722651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3648765238047722651'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/09/sql-rainbow-tables.html' title='sql rainbow tables'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-1738958777570421182</id><published>2007-08-26T19:47:00.001+02:00</published><updated>2008-08-21T22:29:04.760+02:00</updated><title type='text'>cross-check results using triggers and views</title><content type='html'>&lt;div style="text-align: justify;"&gt;I've been struggling to come up with a decent prototype for the self-verifying random testcases I wrote about earlier.  In the mean time, I wrote a set of triggers and a view which should yield the same information, no matter what you do to the underlying table.  If they don't, there's a bug in the server.&lt;br /&gt;&lt;br /&gt;The test table, t1 is simple.  It has an int and a varchar column.  There are triggers after insert/update/delete.   The triggers update an evolving summary table.&lt;br /&gt;&lt;br /&gt;The evolving summary table maintains the average+sum value of the int, and the average+sum length of the varchar field.   The view selects these values from the table too.&lt;br /&gt;&lt;br /&gt;To test it, I ran 50 threads of random insert/update/delete queries to table t1 for a few minutes.  Then after the test had stopped I confirmed the results matched.  (i.e. the running totals had been correctly maintained - if they match the view).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pastebin.com/f37a1c197"&gt; Here's the setup of table t1, the running summary table, and the view&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next, I hit the server with random update/insert/delete for a few minutes:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;- completed spawning new database worker threads&lt;br /&gt;- 15 threads running, 0003961 successful queries. (330.083333 QPS).&lt;br /&gt;- 15 threads running, 0005334 successful queries. (114.416667 QPS).&lt;br /&gt;- 15 threads running, 0006206 successful queries. (72.666667 QPS).&lt;br /&gt;- 15 threads running, 0006783 successful queries. (48.083333 QPS).&lt;br /&gt;- 15 threads running, 0007779 successful queries. (83.000000 QPS).&lt;br /&gt;- 15 threads running, 0008981 successful queries. (100.166667 QPS).&lt;br /&gt;- 15 threads running, 0010393 successful queries. (117.666667 QPS).&lt;br /&gt;- 15 threads running, 0010979 successful queries. (48.833333 QPS).&lt;br /&gt;- 15 threads running, 0011373 successful queries. (32.833333 QPS).&lt;br /&gt;- 15 threads running, 0011875 successful queries. (41.833333 QPS).&lt;br /&gt;- 15 threads running, 0012399 successful queries. (43.666667 QPS).&lt;br /&gt;- 15 threads running, 0012870 successful queries. (39.250000 QPS).&lt;br /&gt;- 15 threads running, 0013566 successful queries. (58.000000 QPS).&lt;br /&gt;- 15 threads running, 0013775 successful queries. (17.416667 QPS).&lt;br /&gt;- 15 threads running, 0014001 successful queries. (18.833333 QPS).&lt;br /&gt;- 15 threads running, 0014265 successful queries. (22.000000 QPS).&lt;br /&gt;- 15 threads running, 0014869 successful queries. (50.333333 QPS).&lt;br /&gt;- 15 threads running, 0015325 successful queries. (38.000000 QPS).&lt;br /&gt;- 15 threads running, 0016425 successful queries. (91.666667 QPS).&lt;br /&gt;- 15 threads running, 0016743 successful queries. (26.500000 QPS).&lt;br /&gt;- 15 threads running, 0016919 successful queries. (14.666667 QPS).&lt;br /&gt;- 15 threads running, 0017180 successful queries. (21.750000 QPS).&lt;br /&gt;- 15 threads running, 0017448 successful queries. (22.333333 QPS).&lt;br /&gt;- 15 threads running, 0017745 successful queries. (24.750000 QPS).&lt;br /&gt;- 15 threads running, 0017997 successful queries. (21.000000 QPS).&lt;br /&gt;- 15 threads running, 0018095 successful queries. (8.166667 QPS).&lt;br /&gt;- waiting for threads to finish&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And - let's see if the results match up.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; select * from t1_summary;&lt;br /&gt;+--------------+-------------+-----------------+--------------------+-----------------+&lt;br /&gt;|num_elements  | sum_id      | sum_length_name | avg_id             | avg_length_name |&lt;br /&gt;|     10237    | 76231668630 |         1198066 | 7446680.5343377098 |  117.0329195294 |&lt;br /&gt;+--------------+-------------+-----------------+--------------------+-----------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; select * from t1_view;&lt;br /&gt;+-------------+-----------------+--------------+-----------------+&lt;br /&gt;|sum_id       | sum_length_name | avg_id       | avg_length_name |&lt;br /&gt;+-------------+-----------------+--------------+-----------------+&lt;br /&gt;|76231668630  |         1198066 | 7446680.5343 |        117.0329 |&lt;br /&gt;+-------------+-----------------+--------------+-----------------+&lt;br /&gt;1 row in set (0.05 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yup, they do :)  What have I actually tested here ??  Hm.  At least one thing.  The trigger's execution didn't miss anything.   Why is this first step important ??  Because my program doesn't &lt;b&gt;know&lt;/b&gt; the correct answer to the above 2 queries.  It sends random garbage to server, hence it doesn't know how to verify a result.  Having the server keep a running total, and comparing that to a final total from the view, is some very small assurance I think.&lt;br /&gt;&lt;br /&gt;Next step will be to use more detailed functions instead of SUM and AVG.  Something whereby the order of execution will matter...  More on this later.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-1738958777570421182?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/1738958777570421182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=1738958777570421182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1738958777570421182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1738958777570421182'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/08/cross-check-results-using-triggers-and.html' title='cross-check results using triggers and views'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-7431075252011706123</id><published>2007-08-25T09:09:00.000+02:00</published><updated>2007-08-25T13:21:36.664+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MyISAM'/><category scheme='http://www.blogger.com/atom/ns#' term='undelete'/><title type='text'>how to undelete rows from a fixed length myisam table</title><content type='html'>&lt;div style="text-align: justify;"&gt;You have inadvertently deleted some rows from your table and want them back.  This is semi-doable with fixed row format of MyISAM.  I put together a few steps, which I'll compliment with a program that does it for you, later.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;save output of &lt;span style="font-style: italic;"&gt;SHOW TABLE STATUS LIKE 't1'&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;SHOW CREATE TABLE `t1`&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;shutdown mysql server asap!&lt;/li&gt;&lt;li&gt;backup t1.frm, t1.MYI, t1.MYD immediately&lt;/li&gt;&lt;li&gt;create a new table t1_recover, which has no auto-inc and no unique/pk.&lt;/li&gt;&lt;li&gt;remove the files t1_recover.MYD and t1_recover.MYI&lt;/li&gt;&lt;li&gt;write a C program that scans through t1.MYD reading blocks of length Avg_row_length and checking if first byte indicates a row is marked as deleted.&lt;/li&gt;&lt;li&gt;if it's deleted, dump it as is into the file t1_recover.MYD&lt;/li&gt;&lt;li&gt;goto mysql prompt.  issue &lt;span style="font-style: italic;"&gt;REPAIR TABLE `t1_recover` USE_FRM&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;Some notes.&lt;br /&gt;&lt;br /&gt;You cannot recover entire record.  You'll lose first 6 bytes of each record (or how every long data pointer length is).  Typically, this is the first 2 int columns trashed.&lt;br /&gt;&lt;br /&gt;You cannot determine which columns contained NULL in the recovered records (assuming some columns are nullable).&lt;br /&gt;&lt;br /&gt;If you anticipate to have to use this recovery method often, then you can create a fake char(9) column at the beginning of the table, so that when a row is deleted, this column will be overridden instead of your real data..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Here is the code!&lt;/span&gt; &lt;a href="http://pastebin.com/f6bf732f3"&gt;myisam undeleter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Example usage below:&lt;br /&gt;1) create a table and delete some records:&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; create table mydel(id int, name char(15), address char(15), bday datetime, daysleft decimal(10,5));&lt;br /&gt;Query OK, 0 rows affected (0.06 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; insert into mydel values (1,'shane','down south','2005-09-01',10.5);&lt;br /&gt;Query OK, 1 row affected (0.01 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; insert into mydel values (2,'susan car','up north','2001-02-01',14.1);&lt;br /&gt;Query OK, 1 row affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; insert into mydel values (3,'bobby scott','chinatown','1976-12-21',55.5);&lt;br /&gt;Query OK, 1 row affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; delete from mydel where id=2 or id=3;&lt;br /&gt;Query OK, 2 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; flush tables;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; show table status;&lt;br /&gt;+--------+--------+------------+------+----------------+-------------+&lt;br /&gt;| Name   | Engine | Row_format | Rows | Avg_row_length | Data_length |&lt;br /&gt;+--------+--------+------------+------+----------------+-------------+&lt;br /&gt;| mydel  | MyISAM | Fixed      |    1 |             49 |         147 |&lt;br /&gt;+--------+--------+------------+------+----------------+-------------+&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;2) next, build and run the app:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;&gt; gcc -o undeleter -lm ./undeleter.c&lt;br /&gt;&gt;&lt;br /&gt;&gt; ./undeleter /5.1/data/test/mydel.MYD /5.1/data/test/mydel_recover.MYD 49&lt;br /&gt;allocating a block of memory for records, 49 bytes&lt;br /&gt;starting to read records&lt;br /&gt;found deleted record at offset 49&lt;br /&gt;found deleted record at offset 98&lt;br /&gt;-----------------&lt;br /&gt; completed &lt;br /&gt;-----------------&lt;br /&gt;records copied into '/5.1/data/test/mydel_recover.MYD': 2&lt;br /&gt;records present in '/5.1/data/test/mydel.MYD': 1&lt;br /&gt;&lt;br /&gt;next steps:&lt;br /&gt;1. remove the MYI for '/5.1/data/test/mydel_recover.MYD'&lt;br /&gt;2. make sure '/5.1/data/test/mydel_recover.MYD' definition .frm is created without any unique or PK keys&lt;br /&gt;3. repair table &lt;recovered table=""&gt; use_frm&lt;br /&gt;&lt;/recovered&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3) next, sort out the recovered table&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sbester@www:/5.1/data/test&gt; cp ./mydel.frm ./mydel_recover.frm&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;mysql&gt; repair table mydel_recover use_frm;&lt;br /&gt;+--------------------+--------+----------+------------------------------------+&lt;br /&gt;| Table              | Op     | Msg_type | Msg_text                           |&lt;br /&gt;+--------------------+--------+----------+------------------------------------+&lt;br /&gt;| test.mydel_recover | repair | warning  | Number of rows changed from 0 to 2 |&lt;br /&gt;| test.mydel_recover | repair | status   | OK                                 |&lt;br /&gt;+--------------------+--------+----------+------------------------------------+&lt;br /&gt;2 rows in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; select * from mydel_recover;&lt;br /&gt;+------+-------------+-----------+---------------------+----------+&lt;br /&gt;| id   | name        | address   | bday                | daysleft |&lt;br /&gt;+------+-------------+-----------+---------------------+----------+&lt;br /&gt;|   -1 |   san car   | up north  | 2001-02-01 00:00:00 | 14.10000 |&lt;br /&gt;|    0 |  ☺bby scott | chinatown | 1976-12-21 00:00:00 | 55.50000 |&lt;br /&gt;+------+-------------+-----------+---------------------+----------+&lt;br /&gt;2 rows in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Notice!  I just cp the .frm.  That's only because I didn't need to strip out the&lt;br /&gt;PK or auto-increment column.  As you seen, `id` is trashed.  `name`&lt;br /&gt;is partially trash.  the `id` would have caused alot of duplicate key&lt;br /&gt;errors if you still had a PK.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;More information here: &lt;a href="http://forge.mysql.com/wiki/MySQL_Internals_MyISAM"&gt;MySQL_Internals_MyISAM&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-7431075252011706123?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/7431075252011706123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=7431075252011706123' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/7431075252011706123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/7431075252011706123'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/08/how-to-undelete-rows-from-fixed-length.html' title='how to undelete rows from a fixed length myisam table'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-5319363041883709444</id><published>2007-08-21T19:26:00.000+02:00</published><updated>2007-08-21T19:38:05.915+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><category scheme='http://www.blogger.com/atom/ns#' term='testcase'/><title type='text'>new direction for test development</title><content type='html'>&lt;div style="text-align: justify;"&gt;I've been thinking about this today.  My attempts thus far to write random queries which stress various parts of the server have worked, and served a purpose - but have been rather huge and clumsy.&lt;br /&gt;&lt;br /&gt;For example a 5 union select, each comprising of 7 joins did have it's value..  The problem with  huge random queries is simply that the results cannot be verified as easily as they were constructed (unless you run the same on various DBMS).   These huge tests are mostly only good for checking if the server crashes.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now, I wish to try write testcases that have these properties:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;small&lt;/li&gt;&lt;li&gt;results are self-verified&lt;/li&gt;&lt;li&gt;each test is random, but reproducible given a seed value&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;Tonight I'll throw together a code-generator to do simple insert/select and post any interesting results here later.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-5319363041883709444?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/5319363041883709444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=5319363041883709444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5319363041883709444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5319363041883709444'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/08/new-direction-for-test-development.html' title='new direction for test development'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-6567786014992382505</id><published>2007-08-13T20:18:00.000+02:00</published><updated>2007-08-13T20:45:23.469+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='charset'/><category scheme='http://www.blogger.com/atom/ns#' term='corruption'/><title type='text'>a moment in time</title><content type='html'>I pulled the latest 5.1BK sources today and built mysqld.  I must admit, it fared pretty well against my little charset tester.  0 failures and over 120 tests done which took &gt;5 hours.&lt;br /&gt;&lt;br /&gt;To give a clue to the score last time I run the same tests, here are the bugs I opened!&lt;br /&gt;&lt;ul nowrap=""&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=29464"&gt;load data infile into table with big5 chinese fulltext index hangs 100% cpu&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=29461"&gt;corruption with character set macce collate macce_bin&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=29333"&gt;myisam corruption with character set cp932 collate cp932_japanese_ci&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=29299"&gt;repeatable myisam fulltext index corruption&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=29261"&gt;repeatable innodb and myisam corruption&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So now I'm sitting thinking about a new set of functionality tests...&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-6567786014992382505?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/6567786014992382505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=6567786014992382505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6567786014992382505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/6567786014992382505'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/08/moment-in-time.html' title='a moment in time'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-2067001298187898692</id><published>2007-08-12T09:57:00.000+02:00</published><updated>2007-08-12T10:02:03.806+02:00</updated><title type='text'>sad news</title><content type='html'>my girlfriend hates blogs :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-2067001298187898692?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/2067001298187898692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=2067001298187898692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2067001298187898692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/2067001298187898692'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/08/sad-news.html' title='sad news'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-3955754792039947141</id><published>2007-07-24T22:08:00.000+02:00</published><updated>2007-08-13T20:28:21.768+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MyISAM'/><category scheme='http://www.blogger.com/atom/ns#' term='corruption'/><title type='text'>That error 127 MyISAM bug finally...</title><content type='html'>Gotcha: &lt;a href="http://bugs.mysql.com/bug.php?id=29838"&gt;Bug #29838 &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The bug itself seems so simple to repeat. I'm boggling how it was not seen before. :-0 I really tried too many overly-complex tests, IMHO.  Sometimes, it's still best to keep it simple!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-3955754792039947141?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/3955754792039947141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=3955754792039947141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3955754792039947141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/3955754792039947141'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/07/that-error-127-myisam-bug-finally.html' title='That error 127 MyISAM bug finally...'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-5458344094114370409</id><published>2007-05-24T11:03:00.000+02:00</published><updated>2007-05-24T11:09:46.925+02:00</updated><title type='text'>that key_cache bug, 17332</title><content type='html'>This massive fix has been pushed into 5.1.19 and so far I cannot repeat any crashes!! Well done Ingo and reviewers ! My testing continues!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=17332"&gt;changing key_buffer_size on a running server can crash under load&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-5458344094114370409?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/5458344094114370409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=5458344094114370409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5458344094114370409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5458344094114370409'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/05/that-keycache-bug-17332.html' title='that key_cache bug, 17332'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-99565955886760598</id><published>2007-05-21T10:44:00.000+02:00</published><updated>2007-08-13T20:30:21.072+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='insert delayed'/><category scheme='http://www.blogger.com/atom/ns#' term='corruption'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><title type='text'>Using 'insert delayed into ... '?</title><content type='html'>Think again!.  There are many corruptions, crashes, and hangs caused by insert delayed statements. Be especially cautious of using an old version of mysql to do delayed inserts in combination with triggers, stored routines, and merge tables.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28280"&gt; Bug #28280 - insert delayed on a table containing trigger leads to server crash&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27998"&gt; Bug #27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE table&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=26464"&gt; Bug #26464 - insert delayed + update + merge = corruption&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=26445"&gt; Bug #26445 - MySQL crash: drop trigger and insert delayed&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=26238"&gt; Bug #26238 - inserted delayed always inserts 0 for BIT columns&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=25712"&gt; Bug #25712 - insert delayed and check table run together report crashed tables&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=25507"&gt; Bug #25507 - multi-row insert delayed + auto increment causes duplicate key entries on slave&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=23312"&gt; Bug #23312 - server hangs 'closing tables' with insert delayed,flush tables,alter table&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=21483"&gt; Bug #21483 - Server abort or deadlock on INSERT DELAYED with another implicit insert&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=16218"&gt; Bug #16218 - Crash on insert delayed&lt;/a&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-99565955886760598?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/99565955886760598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=99565955886760598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/99565955886760598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/99565955886760598'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/05/using-insert-delayed-into.html' title='Using &apos;insert delayed into ... &apos;?'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-1963456120037197476</id><published>2007-05-20T17:18:00.000+02:00</published><updated>2007-05-20T17:27:47.682+02:00</updated><title type='text'>partition maintenance?</title><content type='html'>It seems doing any partition maintenance in combination with some concurrent workload will fail with many different errors in 5.1.  For more or less the same underlying lack of locking, I've filed a few bugs.&lt;br /&gt;&lt;br /&gt;To cause a myisam table corruption or server crash (or innodb assert) all you need is 1 thread inserting, and 1 thread altering/optimizing partitions:  Of course, the more threads the easier the problems will happen..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28477"&gt; Bug #28477&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28487"&gt; Bug #28487&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28488"&gt; Bug #28488&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28489"&gt; Bug #28489&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28490"&gt; Bug #28490&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-1963456120037197476?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/1963456120037197476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=1963456120037197476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1963456120037197476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/1963456120037197476'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/05/partition-maintenance.html' title='partition maintenance?'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8132102221957780385.post-5630951957801260585</id><published>2007-05-19T14:30:00.000+02:00</published><updated>2007-05-19T14:56:29.499+02:00</updated><title type='text'>to get started</title><content type='html'>A short list of some recent bug reports opened by me.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28519"&gt;bug #28519 falcon crash with signal 4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28492"&gt;bug #28492 subselect returns LONG in &gt;5.0.24a and LONGLONG in &lt;=5.0.24a&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28490"&gt;bug #28490 crash in handler.cc, handler::print_error(int error, myf errflag)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28489"&gt;bug #28489 spurious out of memory message in comment of show table status&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28488"&gt;bug #28488 Incorrect information in file: './test/t1_test#.frm'&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28487"&gt;bug #28487 during alter table .. add partition temporary tables are visible to users&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28477"&gt;bug #28477 innodb assertion and crash during alter table to add/drop partitions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28476"&gt;bug #28476 force index on a disabled myisam index gives error 124&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28414"&gt;bug #28414 please add more useful information to error logs when corruption occurs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28375"&gt;bug #28375 mysql crash with subselect and null values&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28280"&gt;bug #28280 insert delayed on a table containing trigger leads to server crash&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28272"&gt;bug #28272 server crash during EXPLAIN SELECT ..&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28254"&gt;bug #28254 innodb crash if shutdown during innodb_table_monitor is running&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=28211"&gt;bug #28211 RENAME DATABASE and query cache don't play nicely together&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27860"&gt;bug #27860 parser doesn't handle memory well for large queries. crashes server&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27854"&gt;bug #27854 'mysqladmin debug' command invokes 64bit unaware mallinfo()&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27643"&gt;bug #27643 query failed : 1114 (The table '' is full)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27594"&gt;bug #27594 Can't find file: '.\db1\t1.frm' (errno: 13)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27592"&gt;bug #27592 stack overrun when storing datetime value using prepared statements&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=27516"&gt;bug #27516 divide by zero crash during optimize table&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8132102221957780385-5630951957801260585?l=mysqlbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlbugs.blogspot.com/feeds/5630951957801260585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8132102221957780385&amp;postID=5630951957801260585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5630951957801260585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8132102221957780385/posts/default/5630951957801260585'/><link rel='alternate' type='text/html' href='http://mysqlbugs.blogspot.com/2007/05/all-my-assigned-or-opened-bugs_19.html' title='to get started'/><author><name>sbester</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
