SQLite

Check-in [f14339c54b]
Login

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

Overview
Comment:Adjust a test case in triggerC.test to handle non-default SQLITE_MAX_TRIGGER_DEPTH settings.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f14339c54bdeabc68c1e05b2c63ee95226f184e0
User & Date: shaneh 2011-06-22 14:43:59.375
Context
2011-06-22
15:21
Print a warning in oserror-1.1.1 that a valgrind warning might occur but that it is benign. (check-in: 13e96376e1 user: drh tags: trunk)
14:43
Adjust a test case in triggerC.test to handle non-default SQLITE_MAX_TRIGGER_DEPTH settings. (check-in: f14339c54b user: shaneh tags: trunk)
14:21
Add a flush of stdout so some test code reading from a command pipe works correctly on Windows. (check-in: 6705f21eff user: shaneh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/triggerC.test.
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
253
      INSERT INTO t2 VALUES(10);
      SELECT * FROM t2;
    }
  } $rc
}

do_test triggerC-2.2 {
  execsql {
    CREATE TABLE t22(x);

    CREATE TRIGGER t22a AFTER INSERT ON t22 BEGIN
      INSERT INTO t22 SELECT x + (SELECT max(x) FROM t22) FROM t22;
    END;
    CREATE TRIGGER t22b BEFORE INSERT ON t22 BEGIN
      SELECT CASE WHEN (SELECT count(*) FROM t22) >= 100
                  THEN RAISE(IGNORE)
                  ELSE NULL END;
    END;

    INSERT INTO t22 VALUES(1);
    SELECT count(*) FROM t22;
  }

} {100}

do_test triggerC-2.3 {
  execsql "
    CREATE TABLE t23(x PRIMARY KEY);

    CREATE TRIGGER t23a AFTER INSERT ON t23 BEGIN
      INSERT INTO t23 VALUES(new.x + 1);







|






|






<
>
|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244

245
246
247
248
249
250
251
252
253
      INSERT INTO t2 VALUES(10);
      SELECT * FROM t2;
    }
  } $rc
}

do_test triggerC-2.2 {
  execsql "
    CREATE TABLE t22(x);

    CREATE TRIGGER t22a AFTER INSERT ON t22 BEGIN
      INSERT INTO t22 SELECT x + (SELECT max(x) FROM t22) FROM t22;
    END;
    CREATE TRIGGER t22b BEFORE INSERT ON t22 BEGIN
      SELECT CASE WHEN (SELECT count(*) FROM t22) >= [expr $SQLITE_MAX_TRIGGER_DEPTH / 2]
                  THEN RAISE(IGNORE)
                  ELSE NULL END;
    END;

    INSERT INTO t22 VALUES(1);
    SELECT count(*) FROM t22;

  "
} [list [expr $SQLITE_MAX_TRIGGER_DEPTH / 2]]

do_test triggerC-2.3 {
  execsql "
    CREATE TABLE t23(x PRIMARY KEY);

    CREATE TRIGGER t23a AFTER INSERT ON t23 BEGIN
      INSERT INTO t23 VALUES(new.x + 1);