SQLite

Check-in [4dd7cfaa58]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Preserve 64-bit last insert rowids across triggers. (CVS 2779)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4dd7cfaa587fd5f76a0b60db0f02d5f57f801564
User & Date: drh 2005-11-25 02:43:51.000
Context
2005-11-25
08:47
Check the return code of full_fsync() when used to sync a directory fd. (CVS 2780) (check-in: 84aae3b0ae user: danielk1977 tags: trunk)
02:43
Preserve 64-bit last insert rowids across triggers. (CVS 2779) (check-in: 4dd7cfaa58 user: drh tags: trunk)
2005-11-24
23:14
The --enable-cross-thread-connect configuration option or the -DSQLITE_ALLOW_XTHREAD_CONNECT compile-time option permits database connections to be moved across threads. This will cause latch-ups and failures on some linux systems such as RedHat-9. Do not use these options if you want a portable build. (CVS 2778) (check-in: 84aa4d5800 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeInt.h.
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
** Elements of Context structure type make up the ContextStack, which is
** updated by the ContextPush and ContextPop opcodes (used by triggers).
** The context is pushed before executing a trigger a popped when the
** trigger finishes.
*/
typedef struct Context Context;
struct Context {
  int lastRowid;    /* Last insert rowid (sqlite3.lastRowid) */
  int nChange;      /* Statement changes (Vdbe.nChanges)     */
  Fifo sFifo;       /* Records that will participate in a DELETE or UPDATE */
};

/*
** An instance of the virtual machine.  This structure contains the complete
** state of the virtual machine.







|







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
** Elements of Context structure type make up the ContextStack, which is
** updated by the ContextPush and ContextPop opcodes (used by triggers).
** The context is pushed before executing a trigger a popped when the
** trigger finishes.
*/
typedef struct Context Context;
struct Context {
  i64 lastRowid;    /* Last insert rowid (sqlite3.lastRowid) */
  int nChange;      /* Statement changes (Vdbe.nChanges)     */
  Fifo sFifo;       /* Records that will participate in a DELETE or UPDATE */
};

/*
** An instance of the virtual machine.  This structure contains the complete
** state of the virtual machine.
Changes to test/lastinsert.test.
336
337
338
339
340
341
342















343
344
345
346
} {0 105}

do_test lastinsert-7.6 {
    catchsql {
        select rout from rid where k=2;
    }
} {0 1205}
















} ;# ifcapable (view && trigger)

finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
} {0 105}

do_test lastinsert-7.6 {
    catchsql {
        select rout from rid where k=2;
    }
} {0 1205}

do_test lastinsert-8.1 {
  db close
  sqlite3 db test.db
  execsql {
    CREATE TABLE t2(x INTEGER PRIMARY KEY, y);
    CREATE TABLE t3(a, b);
    CREATE TRIGGER after_t2 AFTER INSERT ON t2 BEGIN
      INSERT INTO t3 VALUES(new.x, new.y);
    END;
    INSERT INTO t2 VALUES(5000000000, 1);
    SELECT last_insert_rowid();
  }
} 5000000000


} ;# ifcapable (view && trigger)

finish_test