add MySQL compatibility
Merge pull request #4894 from mmascher/mysql

Mysql: fix _dberror to raise tha appropriate values