/ Check-in [9a2dd187]
Login

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

Overview
Comment:Make sure sufficient VDBE registers are allocated for an INSERT...SELECT when there is an idlist on the insert table that includes an explicit rowid. Ticket [e9654505cfda93610585fde5a9bbf2e730c8a8d5]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9a2dd18776cc7003752980be0a0920a8799e5f35
User & Date: drh 2014-05-23 11:48:57
Original Comment: Make sure sufficient VDBE registers are allocated for an INSERT...SELECT when there is an idlist on the insert table that includes an explicit rowid. Ticket [9654505cfda93610585fde5a9bbf2e730c8a8d5]
Context
2014-05-23
12:03
In the command-line shell, if three or more interrupt signals (control-c) are received in a row without a response from sqlite3_interrupt() then call exit(1) immediately. This allows control-C to interrupt the shell even if it is stuck in a computation or loop that does not involve the VDBE. check-in: b5cde571 user: drh tags: trunk
11:48
Make sure sufficient VDBE registers are allocated for an INSERT...SELECT when there is an idlist on the insert table that includes an explicit rowid. Ticket [e9654505cfda93610585fde5a9bbf2e730c8a8d5] check-in: 9a2dd187 user: drh tags: trunk
2014-05-22
09:58
Add a test for the EQP output of a skip-scan query that uses the PK index of a WITHOUT ROWID table. check-in: 10238fad user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/insert.c.

610
611
612
613
614
615
616

617
618
619
620
621
622
623
          }
          break;
        }
      }
      if( j>=pTab->nCol ){
        if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){
          ipkColumn = i;

        }else{
          sqlite3ErrorMsg(pParse, "table %S has no column named %s",
              pTabList, 0, pColumn->a[i].zName);
          pParse->checkSchema = 1;
          goto insert_cleanup;
        }
      }







>







610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
          }
          break;
        }
      }
      if( j>=pTab->nCol ){
        if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){
          ipkColumn = i;
          bIdListInOrder = 0;
        }else{
          sqlite3ErrorMsg(pParse, "table %S has no column named %s",
              pTabList, 0, pColumn->a[i].zName);
          pParse->checkSchema = 1;
          goto insert_cleanup;
        }
      }

Changes to test/insert.test.

408
409
410
411
412
413
414























415
416
417
418
do_execsql_test insert-11.1 {
  CREATE TABLE t11a AS SELECT '123456789' AS x;
  CREATE TABLE t11b (a INTEGER PRIMARY KEY, b, c);
  INSERT INTO t11b SELECT x, x, x FROM t11a;
  SELECT quote(a), quote(b), quote(c) FROM t11b;
} {123456789 '123456789' '123456789'}

























integrity_check insert-99.0

finish_test







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




408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
do_execsql_test insert-11.1 {
  CREATE TABLE t11a AS SELECT '123456789' AS x;
  CREATE TABLE t11b (a INTEGER PRIMARY KEY, b, c);
  INSERT INTO t11b SELECT x, x, x FROM t11a;
  SELECT quote(a), quote(b), quote(c) FROM t11b;
} {123456789 '123456789' '123456789'}


# More columns of input than there are columns in the table.
# Ticket http://www.sqlite.org/src/info/e9654505cfda9361
#
do_execsql_test insert-12.1 {
  CREATE TABLE t12a(a,b,c,d,e,f,g);
  INSERT INTO t12a VALUES(101,102,103,104,105,106,107);
  CREATE TABLE t12b(x);
  INSERT INTO t12b(x,rowid,x,x,x,x,x) SELECT * FROM t12a;
  SELECT rowid, x FROM t12b;
} {102 101}
do_execsql_test insert-12.2 {
  CREATE TABLE tab1( value INTEGER);
  INSERT INTO tab1 (value, _rowid_) values( 11, 1);
  INSERT INTO tab1 (value, _rowid_) SELECT 22,999;
  SELECT * FROM tab1;
} {11 22}
do_execsql_test insert-12.3 {
  CREATE TABLE t12c(a, b DEFAULT 'xyzzy', c);
  INSERT INTO t12c(a, rowid, c) SELECT 'one', 999, 'two';
  SELECT * FROM t12c;
} {one xyzzy two}


integrity_check insert-99.0

finish_test