/ Check-in [5b4c0f2d]
Login

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

Overview
Comment:Remove code from the constraint checker that generates virtual column values with the incorrect time. Turns out the the regular code for all other columns works correctly and so the incorrect special-case code is not actually needed. Fix for ticket [3ea175512444b0d1].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5b4c0f2ddc6f324e23bbde0ee3d1ab672cfe8ab5044c9b693f4c33cdd75c211e
User & Date: drh 2019-10-26 23:51:44
Context
2019-10-27
22:22
Improved detection of attempts to use a generated column as part of the primary key. Ticket [91e86951016a6802] check-in: 6d1bbba9 user: drh tags: trunk
2019-10-26
23:51
Remove code from the constraint checker that generates virtual column values with the incorrect time. Turns out the the regular code for all other columns works correctly and so the incorrect special-case code is not actually needed. Fix for ticket [3ea175512444b0d1]. check-in: 5b4c0f2d user: drh tags: trunk
18:56
Remove redundant code resulting from a merge error on the previous check-in. check-in: 713fe86b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/insert.c.

1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
        sqlite3ExprCodeCopy(pParse, pIdx->aColExpr->a[i].pExpr, regIdx+i);
        pParse->iSelfTab = 0;
        VdbeComment((v, "%s column %d", pIdx->zName, i));
      }else if( iField==XN_ROWID || iField==pTab->iPKey ){
        x = regNewData;
        sqlite3VdbeAddOp2(v, OP_IntCopy, x, regIdx+i);
        VdbeComment((v, "rowid"));
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
      }else if( pTab->aCol[iField].colFlags & COLFLAG_VIRTUAL ){
        pParse->iSelfTab = -(regNewData+1);
        sqlite3ExprCodeCopy(pParse, pTab->aCol[iField].pDflt, regIdx+i);
        pParse->iSelfTab = 0;
        VdbeComment((v, "%s column %d", pIdx->zName, i));
#endif
      }else{
        testcase( sqlite3TableColumnToStorage(pTab, iField)!=iField );
        x = sqlite3TableColumnToStorage(pTab, iField) + regNewData + 1;
        sqlite3VdbeAddOp2(v, OP_SCopy, x, regIdx+i);
        VdbeComment((v, "%s", pTab->aCol[iField].zName));
      }
    }







<
<
<
<
<
<
<







1858
1859
1860
1861
1862
1863
1864







1865
1866
1867
1868
1869
1870
1871
        sqlite3ExprCodeCopy(pParse, pIdx->aColExpr->a[i].pExpr, regIdx+i);
        pParse->iSelfTab = 0;
        VdbeComment((v, "%s column %d", pIdx->zName, i));
      }else if( iField==XN_ROWID || iField==pTab->iPKey ){
        x = regNewData;
        sqlite3VdbeAddOp2(v, OP_IntCopy, x, regIdx+i);
        VdbeComment((v, "rowid"));







      }else{
        testcase( sqlite3TableColumnToStorage(pTab, iField)!=iField );
        x = sqlite3TableColumnToStorage(pTab, iField) + regNewData + 1;
        sqlite3VdbeAddOp2(v, OP_SCopy, x, regIdx+i);
        VdbeComment((v, "%s", pTab->aCol[iField].zName));
      }
    }