On 26/01/2009 12:37 PM, John Machin wrote:
> On 26/01/2009 12:17 PM, Rickard Westerlund wrote:

>> In any case, I prepared an isolated test case which can be gotten from
>> the link below. It contains source for the program as well as a
>> prepared database that is supposed to be updated by the call made from
>> the test program.
>> http://www.acc.umu.se/~onionkgt/tagdb_test.zip
> 
> Could apparent lack of activity be due to the fact that "ret" is used 
> but not initialised in the following function?
> 

[open function snipped]

You are supposed to be demonstrating that there's an error, and trying 
to pinpoint where it occurs.

I strongly suggest that you:

(1) work out a case that causes the problem and hard-code the values 
into the demo program, or *PRINT* the six values that you are binding, 
so that we (that includes you!) can check that those values cause the 
conditions to be true

(2) *CHECK* (and print!) the return value from each sqlite3_ function.

        /* Update the table. */
        for (i = 0; i < sizeof(updates)/sizeof(*updates); i++) {
                sqlite3_prepare_v2(db, updates[i], -1, &stmt, NULL);
                sqlite3_bind_int(stmt, 1, src_lft);
                sqlite3_bind_int(stmt, 2, src_rgt);
                sqlite3_bind_int(stmt, 3, move);
                sqlite3_bind_int(stmt, 4, displacement);
                sqlite3_bind_int(stmt, 5, affected_lft);
                sqlite3_bind_int(stmt, 6, affected_rgt);
                sqlite3_step(stmt);
                sqlite3_finalize(stmt);
        }
Is that what your real code looks like? How do you know that that "for" 
statement is actually executed?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to