/ Check-in [8a000a8a]
Login

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

Overview
Comment:Fix a problem in fkey.c when a child key is the IPK of its table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8a000a8aae4d356e68acf2bc1788d2c40279522c
User & Date: dan 2009-09-24 15:16:34
Context
2009-09-24
16:52
Fix a bug in the code for REPLACE conflict handling on IPK columns when there are no indexes on the table. Triggers and foreign key processing were being bypassed. check-in: beb2094f user: dan tags: trunk
15:16
Fix a problem in fkey.c when a child key is the IPK of its table. check-in: 8a000a8a user: dan tags: trunk
14:27
Remove the ALWAYS() added by the previous check-in. It is not needed. check-in: 36568963 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/fkey.c.

   306    306       int iReg = aiCol[i] + regData + 1;
   307    307       sqlite3VdbeAddOp2(v, OP_IsNull, iReg, iOk);
   308    308     }
   309    309   
   310    310     if( pIdx==0 ){
   311    311       /* If pIdx is NULL, then the parent key is the INTEGER PRIMARY KEY
   312    312       ** column of the parent table (table pTab).  */
   313         -    int iReg = pFKey->aCol[0].iFrom + regData + 1;
          313  +    int iReg = aiCol[0] + regData + 1;
   314    314       sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
   315    315       sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, iReg);
   316    316       sqlite3VdbeAddOp2(v, OP_Goto, 0, iOk);
   317    317       sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2);
   318    318     }else{
   319    319       int regRec = sqlite3GetTempReg(pParse);
   320    320       KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);