server"
Bug appears only on Windows platform. Freeing memory in
TMP_TABLE_PARAM::cleanup() allocated by new Copy_fields[0] in
setup_copy_fields() results in memory destruction. In test IF used instead
of CONCAT because IF have more stable crash.
Call pthread_mutex_destroy() on not used mutex.
Changed comments in .h and .c files from // -> /* */
Added detection of mutex on which one didn't call pthread_mutex_destroy()
Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression"
Added optimisation for ORDER BY NULL