yiskang / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

textfixture fails running rollback.test #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open testfixture project, set to the DEBUG build
2. In test/^testscripts.txt setup the following test:
source $testdir/rollback.test
3. Start running in DEBUG mode

rollback-1.5... Expected: [SQLITE_ERROR]     Got: [SQLITE_ROW]

This is testing 2 connections where one deletes the table out from
underneath the 2nd  and then we try to continue with the first SELECT statement

Need to determine the root cause of this error.  It may be a non-error and
simply caused by the stored compiled statements in the test harness or a
serious error related to the shared Btree structure not being shared correctly

Original issue reported on code.google.com by noah.hart@gmail.com on 8 Aug 2009 at 2:49

GoogleCodeExporter commented 8 years ago
This is due to a typo in btree_c.cs

    //#define restoreCursorPosition(p) \
    //  (p.eState>=CURSOR_REQUIRESEEK ? \
    //         btreeRestoreCursorPosition(p) : \
    //         SQLITE_OK)
    static int restoreCursorPosition(BtCursor pCur)
    {
      if (pCur.eState == CURSOR_REQUIRESEEK)
        return btreeRestoreCursorPosition(pCur);
      else
        return SQLITE_OK;
    }

should be

    //#define restoreCursorPosition(p) \
    //  (p.eState>=CURSOR_REQUIRESEEK ? \
    //         btreeRestoreCursorPosition(p) : \
    //         SQLITE_OK)
    static int restoreCursorPosition(BtCursor pCur)
    {
      if (pCur.eState >= CURSOR_REQUIRESEEK)      // <-- typo is here, >= instead of ==
        return btreeRestoreCursorPosition(pCur);
      else
        return SQLITE_OK;
    }

Original comment by enzinol@gmail.com on 8 Sep 2009 at 8:10

GoogleCodeExporter commented 8 years ago
confirmed fixed with 9/13 checkin

Original comment by noah.hart@gmail.com on 13 Sep 2009 at 2:15