ok, let me know how it turns out.

Janos

On 2015-07-24 10:32, Gabriele Bulfon wrote:
Sorry for the typo in printf, now I get correct debug for numerical
parameters.

I found the problem is not during the select of attachements, but
during insert into:

4000000055d97d9d09ddb7fc006b3db79185: sql=INSERT INTO attachment
(`piler_id`,`attachment_id`,`sig`,`name`,`type`,`size`,`ptr`)
VALUES(?,?,?,?,?,?,?)

p_exec_query: param 0 - type 254 - length 36 - content
4000000055d97d9d09ddb7fc006b3db79185
p_exec_query: param 1 - type 3 - length 0 - content 1
p_exec_query: param 2 - type 254 - length 64 - content
0a2ae595399a2e82af7a7a65d737e54f1993f7f606119bd97a24874654ef10ac
p_exec_query: param 3 - type 254 - length 12 - content daticert.xml
p_exec_query: param 4 - type 254 - length 15 - content application/xml
p_exec_query: param 5 - type 3 - length 0 - content 809
p_exec_query: param 6 - ...[ I miss the debug here]...

still trying to figure out what is the data that may be bad to
insert...

-------------------------

DA: Gabriele Bulfon <[email protected]>
A: Piler User <[email protected]>
DATA: 23 luglio 2015 10.39.06 CEST
OGGETTO: Re: pilerimport mysql_stmt_execute errors on
XStreamOS/illumos

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 <[email protected]>
A: Piler User <[email protected]>
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


Reply via email to