mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-21 09:00:59 +03:00
Many new test cases added, that mostly work. Currently 18 errors in
without_rowid3.test. Also there is a hack marked by a /*FIXME*/ comment on at fkey.c:547 that needs fixing. FossilOrigin-Name: 39e32187b66405e00dbd44685f6cdd269c90f5e5
This commit is contained in:
@@ -1653,6 +1653,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
|
||||
assert( pParse->pNewTable==pTab );
|
||||
pPk = sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0);
|
||||
if( pPk==0 ) return;
|
||||
pPk->autoIndex = 2;
|
||||
pTab->iPKey = -1;
|
||||
}else{
|
||||
pPk = sqlite3PrimaryKeyIndex(pTab);
|
||||
|
||||
@@ -399,8 +399,6 @@ void sqlite3DeleteFrom(
|
||||
*/
|
||||
sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite,
|
||||
iTabCur, &iDataCur, &iIdxCur);
|
||||
assert( iDataCur!=iTabCur );
|
||||
assert( iDataCur>=iIdxCur );
|
||||
|
||||
/* Loop over the primary keys to be deleted. */
|
||||
addr = sqlite3VdbeAddOp1(v, OP_Rewind, iEph);
|
||||
|
||||
@@ -544,7 +544,7 @@ static void fkScanChildren(
|
||||
** is taking place as part of a DELETE operation (operation D.2), omit the
|
||||
** row being deleted from the scan by adding ($rowid != rowid) to the WHERE
|
||||
** clause, where $rowid is the rowid of the row being deleted. */
|
||||
if( pTab==pFKey->pFrom && nIncr>0 ){
|
||||
if( pTab==pFKey->pFrom && nIncr>0 && HasRowid(pTab) /*FIXME*/ ){
|
||||
Expr *pEq; /* Expression (pLeft = pRight) */
|
||||
Expr *pLeft; /* Value from parent table row */
|
||||
Expr *pRight; /* Column ref to child table */
|
||||
|
||||
@@ -178,6 +178,10 @@ int sqlite3_blob_open(
|
||||
pTab = 0;
|
||||
sqlite3ErrorMsg(pParse, "cannot open virtual table: %s", zTable);
|
||||
}
|
||||
if( pTab && !HasRowid(pTab) ){
|
||||
pTab = 0;
|
||||
sqlite3ErrorMsg(pParse, "cannot open table without rowid: %s", zTable);
|
||||
}
|
||||
#ifndef SQLITE_OMIT_VIEW
|
||||
if( pTab && pTab->pSelect ){
|
||||
pTab = 0;
|
||||
|
||||
Reference in New Issue
Block a user