/ Check-in [5d01426d]
Login

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

Overview
Comment:Make sure "rowid" columns are correctly resolved in joins between normal tables and WITHOUT ROWID tables. Fix for ticket [c34d0557f740c45070].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5d01426ddfb2d47c57f93f71378594e637424be0
User & Date: drh 2014-02-12 14:43:52
Context
2014-02-12
21:31
Remove the "rowid cache" that sought to remember the largest rowid for a table and thereby speed up OP_NewRowid. That cache was ineffective. Removing it results in a performance increase of 0.4%, less memory usage, and a slightly smaller library size. check-in: 56bc5ce8 user: drh tags: trunk
14:43
Make sure "rowid" columns are correctly resolved in joins between normal tables and WITHOUT ROWID tables. Fix for ticket [c34d0557f740c45070]. check-in: 5d01426d user: drh tags: trunk
2014-02-11
16:24
Increase the version number to 3.8.4 check-in: 0a8bcbbd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/resolve.c.

   376    376         }
   377    377       }
   378    378   #endif /* !defined(SQLITE_OMIT_TRIGGER) */
   379    379   
   380    380       /*
   381    381       ** Perhaps the name is a reference to the ROWID
   382    382       */
   383         -    assert( pTab!=0 || cntTab==0 );
   384         -    if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) && HasRowid(pTab) ){
          383  +    if( cnt==0 && cntTab==1 && pMatch && sqlite3IsRowid(zCol)
          384  +     && HasRowid(pMatch->pTab) ){
   385    385         cnt = 1;
   386    386         pExpr->iColumn = -1;     /* IMP: R-44911-55124 */
   387    387         pExpr->affinity = SQLITE_AFF_INTEGER;
   388    388       }
   389    389   
   390    390       /*
   391    391       ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z

Changes to test/without_rowid1.test.

   195    195     INSERT INTO t4 VALUES('ii');
   196    196     INSERT INTO t4 VALUES('iii');
   197    197   
   198    198     INSERT INTO t3 SELECT * FROM t4;
   199    199     SELECT * FROM t3;
   200    200   } {i ii iii}
   201    201     
   202         -finish_test
          202  +############################################################################
          203  +# Ticket [c34d0557f740c450709d6e33df72d4f3f651a3cc]
          204  +# Name resolution issue with WITHOUT ROWID
          205  +#
          206  +do_execsql_test 4.1 {
          207  +  CREATE TABLE t41(a PRIMARY KEY) WITHOUT ROWID;
          208  +  INSERT INTO t41 VALUES('abc');
          209  +  CREATE TABLE t42(x);
          210  +  INSERT INTO t42 VALUES('xyz');
          211  +  SELECT t42.rowid FROM t41, t42;
          212  +} {1}
          213  +do_execsql_test 4.2 {
          214  +  SELECT t42.rowid FROM t42, t41;
          215  +} {1}
   203    216   
          217  +finish_test