/ 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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

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

Changes to test/insert.test.

   408    408   do_execsql_test insert-11.1 {
   409    409     CREATE TABLE t11a AS SELECT '123456789' AS x;
   410    410     CREATE TABLE t11b (a INTEGER PRIMARY KEY, b, c);
   411    411     INSERT INTO t11b SELECT x, x, x FROM t11a;
   412    412     SELECT quote(a), quote(b), quote(c) FROM t11b;
   413    413   } {123456789 '123456789' '123456789'}
   414    414   
          415  +
          416  +# More columns of input than there are columns in the table.
          417  +# Ticket http://www.sqlite.org/src/info/e9654505cfda9361
          418  +#
          419  +do_execsql_test insert-12.1 {
          420  +  CREATE TABLE t12a(a,b,c,d,e,f,g);
          421  +  INSERT INTO t12a VALUES(101,102,103,104,105,106,107);
          422  +  CREATE TABLE t12b(x);
          423  +  INSERT INTO t12b(x,rowid,x,x,x,x,x) SELECT * FROM t12a;
          424  +  SELECT rowid, x FROM t12b;
          425  +} {102 101}
          426  +do_execsql_test insert-12.2 {
          427  +  CREATE TABLE tab1( value INTEGER);
          428  +  INSERT INTO tab1 (value, _rowid_) values( 11, 1);
          429  +  INSERT INTO tab1 (value, _rowid_) SELECT 22,999;
          430  +  SELECT * FROM tab1;
          431  +} {11 22}
          432  +do_execsql_test insert-12.3 {
          433  +  CREATE TABLE t12c(a, b DEFAULT 'xyzzy', c);
          434  +  INSERT INTO t12c(a, rowid, c) SELECT 'one', 999, 'two';
          435  +  SELECT * FROM t12c;
          436  +} {one xyzzy two}
          437  +
   415    438   
   416    439   integrity_check insert-99.0
   417    440   
   418    441   finish_test