Kernel Errors 348 and 351

Andrew Sinning andrew at learningware.com
Wed Jun 29 15:40:27 CDT 2005


The error which was documented as fixed in v.1.10b20 in the release notes:

"[KERNEL][BUG] Corruption of db file if table have VarChar field. Can 
Happens if do a lots of updates/deelted with no flush."

So, I'm doing some testing here to verify fix in later build.  I must be 
doing something terribly wrong.  This can't be right.

In version 1.11:

I have a simple table with just two fields, an id and a 1024 varChar:

CREATE TABLE test_varChar (
    id UMedium NOT NULL,
    string VarChar(1024,'ASCII') NOT NULL
);

I have a test function in Director which adds 1500 new records to the 
table.  Each new record contains about 850 characters in field 
"string".  After adding 1500 new records, it flushes the db and then 
reports the total number of records in the table.  Each time I run the 
test function, the number of records goes up by 1500, as you would expect:
--1500
--3000
--4500
... etc.
BUT, when it gets to 14763 records, it stops getting bigger.  It's as if 
the db has maxed out at 14763 records.

So the next time, I add just 100 records between each flush.  This time 
it tops out at 14811.

Then, I change the script so that the db gets flush after every single 
new record.  This time it tops out at 14763 records.

I have no idea what I am doing wrong.  Here's what my Add record 
function looks like:

on WriteVarCharTest me, id, string
  if voidP(id) then id = me.NextIndex("varCharTestId") -- this using 
another table to increment the index "varCharTestId"
  -- table
  sql = "SELECT * FROM test_varChar WHERE id = "&id
  theCursor = new(xtra "VCursor", GetRef(dbConn), sql, kClient, 
kReadWrite, kForwardOnly)
  -- the insert list
  insertList = [#id:id,#string:string]
  -- update/add the record
  if GetRecordCount(theCursor) = 0 then -- new
    AddRecord(theCursor,insertList)
  else
    UpdateRecord(theCursor,insertList) -- existing
  end if
  SetBlank(theCursor)
end

By the way, I have verified that the function which increments the "id" 
is working.  It continues to increment the id each time a new record is 
added.

Thanks.


More information about the Valentina mailing list