1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix a problem in fkey.c when a child key is the IPK of its table.

FossilOrigin-Name: 8a000a8aae4d356e68acf2bc1788d2c40279522c
This commit is contained in:
dan
2009-09-24 15:16:33 +00:00
parent 46803c3e0b
commit 8c430041f5
3 changed files with 9 additions and 19 deletions

View File

@@ -310,7 +310,7 @@ static void fkLookupParent(
if( pIdx==0 ){
/* If pIdx is NULL, then the parent key is the INTEGER PRIMARY KEY
** column of the parent table (table pTab). */
int iReg = pFKey->aCol[0].iFrom + regData + 1;
int iReg = aiCol[0] + regData + 1;
sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, iReg);
sqlite3VdbeAddOp2(v, OP_Goto, 0, iOk);