Mailing List Archive



Back to the month index Back to the list index

sbeer@ibm.net
Tue, 01 Apr 97 13:28:36 +0000


Message-Id: <9704011841.AA0068@YOUR-HOST-NAME>
Date: Tue, 01 Apr 97 13:28:36 +0000
From: sbeer@ibm.net
Subject: [mSQL] Updated fix for NOT NULL bug in Beta 5

After some more testing regarding this bug and Larry Stone's
suggested fix, I discovered that the 'offset' member is zeroed
prior to the null testing, thus is cannot be used. The solution
appears to be simpler, using the dataLength member instead of
the length member (see patch below). Using this technique
all the test cases I had up to now seem to work OK.

When testing this you must also set the Insert values
to NULL (while being defined as NOT NULL) and test
that they are properly flagged as errors.

Note that the index null check uses similar logic so it must
also be fixed in the same way.

This difference appears to be related to the new alignment
scheme, and may influence other cases where a choice between
length and dataLength is needed.

//----------------------------------------------------------
// Steve Beer
// sbeer@ibm.net

--- msqldb.c.orig Mon Mar 17 00:33:19 1997
+++ msqldb.c Tue Apr 1 13:21:57 1997
@@ -545,7 +545,7 @@
                         msqlTrace(TRACE_OUT,"checkNullFields()");
                         return(-1);
                 }
- offset += curField->length + 1;
+ offset += curField->dataLength + 1;
                 curField = curField->next;
         }
         msqlTrace(TRACE_OUT,"checkNullFields()");
--- index.c.orig Sun Mar 9 21:25:13 1997
+++ index.c Tue Apr 1 13:17:17 1997
@@ -399,7 +399,7 @@
                        curField = entry->def;
                        while(curField && field)
                        {
- offset += curField->length + 1;
+ offset += curField->dataLength + 1;
                         curField = curField->next;
                         field--;
                 }
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!