cherry-pick certain "#if"s from 69dd692 (thanks to kamipo), add CmMakeLists.txt (with some fixed configuration)
in mysql >= 5.5 use different method for opening table def.
deref of NULL might get optimized away (so says clang)
compatible with MySQL 5.6 (though a seperate patch needs to be applied to MySQL 5.6.10 (see https://gist.github.com/kazuho/4994203), to use queue_wait() in WHERE condition)
update CMake script so that it would be on par with autotools+make (note: configuration parameters are passed in as environment variables)
remove workaround for OSX 10.4 (http://d.hatena.ne.jp/kazuhooku/20080326/1206519561)
in MySQL 5.6, generate error upon encountering call to queue_wait() within SELECT
support for MySQL 5.5/5.6 (merge branch 'kazuho/experiments/cmake')