Wednesday, September 19, 2007

mysql crash log analyzer ?

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 :)


step 1: upload the mysqld and the mysqld.sym file for the version you're working with.
step 2: import the binary and symbols into a mysql table
step 3: upload the error log
step 4: parse the error log into seperate crashes
step 5: find the stack traces for each crash, and resolve them using the symbols
step 6: determine if this crash is matching any existing crashes.

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.

some results of rainbow

ok folks. here's some results:



mysql> select last_errno,count(*) from
queryqueue group by last_errno;
+------------+----------+
| last_errno | count(*) |
+------------+----------+
| 0 | 1600796 |
| 1048 | 1971 |
| 1053 | 1 |
| 1139 | 35 |
| 1267 | 19722 |
| 1270 | 4243 |
| 1271 | 8944 |
| 1416 | 2284 |
| 1580 | 23225 |
| 2003 | 28 |
| 2013 | 1606 |
+------------+----------+
11 rows in set (0.00 sec)


error 2013 means lost connection to server (read: server crashed).
so there are many bugs found already. 1606 crashes out of 1.6 million
executed queries, is great.

check my rss feed for the exact bugs ...

Wednesday, September 12, 2007

good news!

my girlfriend's grandfather wants a blog!

Friday, September 7, 2007

sql rainbow tables

I thought of a brilliant QA plan. Create sql rainbow tables! Just trust me, this system of QA will be very powerful in bug finding. Especially important will be the comparison of old/new versions of mysql. Writing a prototype now, on my day off.

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:


mysql> select count(*),category from func group by category;
+----------+--------------+
| count(*) | category |
+----------+--------------+
| 6 | arithmetic |
| 7 | bit |
| 60 | casting |
| 47 | comparison |
| 52 | datetime |
| 18 | encryption |
| 127 | geometry |
| 17 | information |
| 7 | logical |
| 32 | mathematical |
| 9 | misc |
| 47 | string |
| 2 | xml |
+----------+--------------+
13 rows in set (0.00 sec)


Let me explain this rainbow tables concept with a simple example.
Suppose we have a function, like "GREATEST()".

I run a query like this:

SELECT GREATEST(col1,col2,col3) FROM table0;

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..