/ Check-in [548532fd]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Add test cases for the fix in [f12ed3ce]. No problems discovered.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 548532fdcf84d565c17aed79a6b595e8b62a3ab4
User & Date: dan 2017-01-03 08:11:24
Context
2017-01-03
11:59
Fix a typo on a comment. No code changes. check-in: abc27b60 user: drh tags: trunk
08:11
Add test cases for the fix in [f12ed3ce]. No problems discovered. check-in: 548532fd user: dan tags: trunk
01:24
Fix the row-values in UPDATE statements within TRIGGER problem identified by ticket [8c9458e7]. check-in: f12ed3ce user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/rowvalue.test.

350
351
352
353
354
355
356
357







































358
  UPDATE t16b SET x=7;
  SELECT * FROM t16a;
} {7 8 9}
do_execsql_test 16.2 {
  UPDATE t16b SET x=97;
  SELECT * FROM t16a;
} {97 98 99}








































finish_test








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

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
  UPDATE t16b SET x=7;
  SELECT * FROM t16a;
} {7 8 9}
do_execsql_test 16.2 {
  UPDATE t16b SET x=97;
  SELECT * FROM t16a;
} {97 98 99}

do_execsql_test 16.3 {
  CREATE TABLE t16c(a, b, c, d, e);
  INSERT INTO t16c VALUES(1, 'a', 'b', 'c', 'd');
  CREATE TRIGGER t16c1 AFTER INSERT ON t16c BEGIN
    UPDATE t16c SET (c, d) = (SELECT 'A', 'B'), (e, b) = (SELECT 'C', 'D')
      WHERE a = new.a-1;
  END;

  SELECT * FROM t16c;
} {1 a b c d}

do_execsql_test 16.4 {
  INSERT INTO t16c VALUES(2, 'w', 'x', 'y', 'z');
  SELECT * FROM t16c;
} {
  1 D A B C 
  2 w x y z
}

do_execsql_test 16.5 {
  DROP TRIGGER t16c1;
  PRAGMA recursive_triggers = 1;
  INSERT INTO t16c VALUES(3, 'i', 'ii', 'iii', 'iv');
  CREATE TRIGGER t16c1 AFTER UPDATE ON t16c WHEN new.a>1 BEGIN
    UPDATE t16c SET (e, d) = (
      SELECT b, c FROM t16c WHERE a = new.a-1
    ), (c, b) = (
      SELECT d, e FROM t16c WHERE a = new.a-1
    ) WHERE a = new.a-1;
  END;

  UPDATE t16c SET a=a WHERE a=3;
  SELECT * FROM t16c;
} {
  1 C B A D
  2 z y x w
  3 i ii iii iv
}

finish_test