Ok, I got a bit into the code.
Found that the error comes here, so I added a couple of logs to see what data
is put in the prepared statement before
being executed.
attachment.c:
data-sql[data-pos] = state-attachments[i].digest; data-type[data-pos] =
TYPE_STRING; data-pos++;
data-sql[data-pos] = (char *)&state-attachments[i].size); data-type[data-pos] =
TYPE_LONG; data-pos++;
syslog(LOG_PRIORITY, "SONICLE - data %d: %s", 0, data-sql[0]);
syslog(LOG_PRIORITY, "SONICLE - data %d: %l", 1, *((long *)data-sql[1]));
if(p_exec_query(sdata, data-stmt_get_attachment_id_by_signature, data) == ERR)
goto NOT_FOUND;
Seems that the problem comes with the numerical parameter, set up as a pointer
to char, stated as type long.
If I try to get the original long value, I get nothing.
This is what I get in syslog:
SONICLE - data 0:
2fc562039d4c9625581b7d7738666ed2cc0ddd284154fd8b7229dd9fcd9b23b1
SONICLE - data 1:
I also tried logging everything as char:
syslog(LOG_PRIORITY, "SONICLE - data %d: %s", 0, data-sql[0]);
syslog(LOG_PRIORITY, "SONICLE - data %d: %s", 1, data-sql[1]);
and I get these:
SONICLE - data 0:
7b4e528276cc9f8041f7de2bf899afd7ef82628fc138a495febf11afd5b0349a
SONICLE - data 1: \366^B
SONICLE - data 0:
9b67015fc956ac43b117227d67254263b7c72135e2f6be0744401eac8a0b304f
SONICLE - data 1: *^C
does this give you any clue?
I suspect my system configuration needs something different to treat numbers in
prepared statements.
----------------------------------------------------------------------------------
Da: Janos SUTO
A: Piler User
Data: 21 luglio 2015 21.55.11 CEST
Oggetto: Re: pilerimport mysql_stmt_execute errors on XStreamOS/illumos
On 2015-07-21 17:11, Gabriele Bulfon wrote:
Looks like the statement is prepared in store_attachments functions,
of attachement.c, called by message.c,
using SQL_PREPARED_STMT_GET_ATTACHMENT_ID_BY_SIGNATURE.
How can I check the binding here?
look at the code :-) You should check the difference from the stock
source
files. It's difficult to say anything more specific, I can't see what
you
actually have.
Janos