Asterisk 13.8.0 MariaDB/MySQL LAST_INSERT_ID() returns always 0,

In my extensions.conf I do the following :
; Lock MySQL/MariaDB access.
same = n,While($[${L} <= 0])
same = n,Set(L=${LOCK(MySQL)})
same = n,EndWhile()
; Mark start of a call attempt.
same = n,Set(history_h1(${nIServer},${IProject},${ANI})=)
; Get unique call id
same = n,Set(CallId=${history_h2()})
; Unlock MySQL acces as the correct CallId was found.
same = n,Set(L=${UNLOCK(MySQL)})

In my func_odbc.conf I do the following :
writesql=INSERT INTO callsystem.history SET IServer=${ARG1},IProject=’${ARG2}’,CallerId=’${ARG3}’,Status=‘ONLINE’;

readsql=SELECT LAST_INSERT_ID() FROM callsystem.history LIMIT 1;

I also tried readsql=SELECT LAST_INSERT_ID(); to no avail.

With Asterisk 13.7.0 this works like a charm.
With Asterisk 13.8.0 CallId is always 0.

Is this a bug or do I need to set something specific in one of the configuration files for 13.8.0 ?

They should behave exactly the same so the ODBC work may have caused a behavior regression. File an issue on the issue tracker[1] attaching full information.


I will file an issue later today as per your request.

Issue added
Also tested 13.8.1 with the same problem.

Patch in, permanent fix expected in 13.9.0.