Subject Sqlda mispraes or data corruption ?
Author rgammans@computer-surgery.co.uk
Hi

I've been having some problem with executing the following
query:-
UPDATE client SET title = ?,name = ?,streetaddress = ?,
street = ?,district = ?,town = ?,county = ?,postcode = ?,
telephonenumber = ?,telephonenumber2 = ?,facsimilenumber = ?,
emailaddress = ?,clienttype = ?,brochuresent = ?,siccode = ?,
center = ?,enquirysource = ?,enqdate = ?,onmaillist = ?,
contactname = ?,jobtitle = ? WHERE id = 9

My applciation uses odbc, and the odbc driver in question is the
firebird OdbcJdbc one, but I can't seem to find any bug there, and I am
supsicious of lower layers (libgds.so) although I don't know the
firebird code well enough to know what to look for with a debugger.
I'm using version LI-V6.2.941 Firebird 1.0 of firebird in classic
server configuration for debugging but see this same issue with
release v1.0.0 and v1.0.2 classic servers.

Originally I was seeing a foriegn key intergirty constriant voialation
reported , but when I examined the Sqlda on (by setting a breakpoint on
isc_dsql_execute() ) it had data it which shouldn't break that
constraint, and I cound verify this by stting that field in the query
manually via isql.

I removed the constraint from the table and saw what can be
best described as data corruption, in that the wrong data went in
the wrong fields and in at least one case a trialling charaters from
another field got inserted into a different one. (eg, telphonenumber
should have been set to '0123456789' and clienttype got set to
'789', telephone number got NULL) I haven't been able to track any
obvious sqldata pointer offset error but I wouldn't say I've ruled it
out either.

Anyway at this point I replaced the contraint and have captured
the error messages. (And the sqda structure but I a haven't
included it as its a 200K postscipt file - I can send it on request
or make it available on a webpage).

Oddly though I have noticed I get two different error messages depending
on my access mode set in the dirver. If I access the server via
the network, either to localhost:filename , or remotehost:filename
I see the following error:-
ODBC DEBUG MESSAGE from DispAllErrors()
=======================================
SQL State = HY000
Native Error Code = 335544347
Error Message = validation error for column ENQDATE, value "*** null ***"
Debug: SQL State = HY000
Native Error Code = 335544347
Error Message = validation error for column ENQDATE, value "*** null ***"

Which is odd anyway as the appriopriate sqltype is 570 , so the sqlda cannot
represent a null value, or have I missed something here

But then if I access the file directly eg, by using database 'filename',
I get this error message instead:-
ODBC DEBUG MESSAGE from DispAllErrors()
=======================================
SQL State = HY000
Native Error Code = 335544569
Error Message = Dynamic SQL Error
SQL error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables
Debug: SQL State = HY000
Native Error Code = 335544569
Error Message = Dynamic SQL Error
SQL error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables

Which is admittedly more interesting , but I can't see any problem with
the sqlda, I have traced through UTLD_parse_sqlda() and I think this
function doing the right thing but I'm not sure what the DASUP structure
is supposed to look like, or where else further down inside firebird
to look for problems.

(Oh Interestingly enough I've tried the Easysoft driver and it does
the same.)

This is becoming a bit of a showstopper for me, so even the slightest
clue as to where I can look next will be appriecated.

TTFN
--
Roger. Home| http://www.sandman.uklinux.net/
Master of Peng Shui. (Ancient oriental art of Penguin Arranging)
GPG Key FPR: CFF1 F383 F854 4E6A 918D 5CFF A90D E73B 88DE 0B3E
Work|Independent Systems Consultant | http://www.firstdatabase.co.uk/


[Non-text portions of this message have been removed]