Problem: using wrong local lock type value in the mysql_insert() results in a crash. Fix: use a proper value.