Asterisk crashes on endpoint resigration

I am trying to setup realtime endpoints on Asterisk 13 using MySQL ODBC (libmyodbc5a) driver. So observed that once an endpoint got registered, Asterisk Server crashes. The Message log shows:

res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.3(w) Driver]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘7’ at line 1
res_config_odbc.c: SQL Prepare failed![SELECT * FROM ps_domain_aliases WHERE id = ?]
res_odbc.c: Connection is down attempting to reconnect…
res_odbc.c: Connecting DE-VOICE
res_odbc: Connected to DE-VOICE [DE-VOICE-DNS]
SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.3(w) Driver]Lost connection to MySQL server during query

Any help will be apperciated