We're using Informix Online server 7.2 on an SGI Indy (It's
a small database, so that hardware is adequete)
We're using ESQL/C for the 'client' programs.
I encounter the following veery weird OnLine server crash:
I am doing dynamic SQL where some of the data to be
selected are TEXT blobs. (Which can make for some
pretty hairy code...) I select using a cursor, because
there are multiple results expected. The TEXT column
of the selection is a nullable field.
If the first selection from the cursor is a row with a NULL
in the TEXT column, but the second selection from the cursor has
a value in that TEXT column, the *SERVER* crashes hard with a
signal 11 (Segfault), and hence my client program gets a -25587
error (Network Receive Failed) from the FETCH.
Any help would be appreciated. Here's a little more detail about
what I am doing. If you want more detailed code, I can provide it.
This is for a publicly-funded project paid for by your tax dollars,
so there's no worry about non-disclosure-agreements. I can show
the exact code if need be.
The way I am cursoring is this (pseudo-code, since the actual
code to pull this off can be icky.)
PREPARE statement string
DECLARE cursor using the statement string
ALLOCATE DESCRIPTOR
OPEN cursor
DESCRIBE statement USING descriptor
For each field I expect in the select:
|
| If I expect this to be a TEXT field:
| |
| | SET DESCRIPTOR to tell it to alloc space for the blob:
( In other words, this ESQL/C code: )
..stuff..->loc_loctype = LOCMEMORY;
..stuff..->loc_bufsize = -1; /* make ESQL alloc it */
..stuff..->loc_mflags = 0;
..stuff..->loc_oflags = 0;
| |
| END
|
END
For each row in the cursor:
|
| FETCH cursor USING descriptor
|
| FOR EACH value in the descriptor:
| |
| | GET DISCRIPTOR - pull this value out and into a host variable.
| |
| END
|
END
I fully suspect that I am doing something wrong here, in relation to
the TEXT blobs, but it just happens to be something that the Informix
server isn't properly error-handling for, so it dies a horrible
death (taking down anything else that happens to be running
off the same DB server.)
--
Steve Mading: madings@execpc.com http://www.execpc.com/~madings