Problem with TEXT field
Posted in 2003
Topics: Storage & Space Management, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design, Versions, Editions & End-of-Life
IDS 9.21.UC4 ESQL 9.16.UC1 Solaris 2.6 One of our clients use a very old C application which updates a TEXT field. I don't know what it does, but once it updates it causes informix to crash. From the af file I traced it to Informix bug 155840. I have little control over the application and when I saw that the crash is something to do with buffer and blob data type, I created a blob dbspace and moved that TEXT column to that dbspace. By doing that at least we don't have to deal with buffers. As I expected, this stopped crashing the server. However it created a new problem. After updating the text field, we can no longer process that row. Attempt to select that row results in error -602 (isam error -165). Attempt to delete that row results in error -240 (isam error -105). It is clear that the application is doing something wrong with the TEXT field. But why should it cause the server to behave like this. I think the server should insulate itself from application programming errors. Anyhow has anyone come across this bug? Any workaround. thanks. Ravi.
OK the problem has been found. What was happening was that the program was feeding a null string to loc_t.loc_buffer, even though the coding assumes that the string can never be null. I don't think a null string can be entered for a text field without a special indicator somewhere. I don't special indicator any where in the code. So informix was fooled into believing that the text field actually contains some value and records the field as a not null field. Later when that row is accessed and informix tries to open that row in blobspace, since there isn't any data there in the first place, we get error -602/-165. The code has been fixed and in case of null string, we generate "N/A". However it is lame that because of this programming error, the database should behave strangely. Ravi ----- Original Message ----- From: "rkusenet " <rkusenet@sympatico.ca> To: <ids@iiug.org> Sent: Friday, April 11, 2003 12:02 Subject: Problem with TEXT field [903] > IDS 9.21.UC4 > ESQL 9.16.UC1 > Solaris 2.6 > > One of our clients use a very old C application which updates a > TEXT field. I don't know what it does, but once it updates it > causes informix to crash. From the af file I traced it to Informix > bug 155840. > > I have little control over the application and when I saw that the > crash is something to do with buffer and blob data type, I created > a blob dbspace and moved that TEXT column to that dbspace. By doing > that at least we don't have to deal with buffers. As I expected, > this stopped crashing the server. However it created a new problem. > > After updating the text field, we can no longer process that row. > Attempt to select that row results in error -602 (isam error -165). > Attempt to delete that row results in error -240 (isam error -105). > > It is clear that the application is doing something wrong with the > TEXT field. But why should it cause the server to behave like this. > I think the server should insulate itself from application programming > errors. > > Anyhow has anyone come across this bug? Any workaround. > > thanks. > > Ravi. >