See if this applies. From 5.6 release notes
8.2.1 SQLExecDirect issues
ODBC programs using SQLExecDirect on statements with bound variables may crash the engine.
The problem is related to an incorrect row set size. The row set size is specified with:
odbc SQLSetStmtAttr $hstmt SQL_ATTR_PARAMSET_SIZE 1 0
Where 1 is the size of the row set. If the size is 1, the bound variables are assumed to be scalars. If the size is greater than 1, the variables are assumed to be arrays.
Using the wrong size will attempt to bind to a non-existent variable and cause a crash.
The size should always default to 1 but there may be cases where it does not. If the SQLExecDirect statement has no row size set, force the row set size to 1 before executing the SQLExecDirect command.
To work around the issue, force the row set size to 1 with the SQLSetStmtAttr statement shown above, before using the statement with bound variables.