Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch autoinc-enhancement Excluding Merge-Ins
This is equivalent to a diff from 1774f1c3 to 3e3849a9
2018-03-20
| ||
13:44 | Avoid unnecessary write to the sqlite_sequence table when an insert is done into an autoincrement table with an application-specified rowid that is less than the maximum. (check-in: ec7addc8 user: drh tags: trunk) | |
2018-03-16
| ||
20:23 | Detect databases whose schema is corrupted using a CREATE TABLE AS statement and issue an appropriate error message. (check-in: d75e6765 user: drh tags: trunk) | |
19:10 | Fix a parsing issue associated with a corrupt sqlite_master table. (check-in: 5f779ff6 user: mistachkin tags: corrupt-schema) | |
18:46 | Avoid writing the sqlite_sequence table when it has not actually changed. (Closed-Leaf check-in: 3e3849a9 user: drh tags: autoinc-enhancement) | |
07:49 | Fix a problem in test script thread001.test causing a spurious "-1 files were left open" error when run separately. Cherrypick of [1774f1c3b]. (check-in: 6cf8172d user: dan tags: branch-3.19) | |
07:48 | Fix a problem in test script thread001.test causing a spurious "-1 files were left open" error when run separately. (check-in: 1774f1c3 user: dan tags: trunk) | |
2018-03-15
| ||
17:46 | Fix a typo in a comment used to generate documentation. No code changes. (check-in: f1784aff user: drh tags: trunk) | |
Changes to src/insert.c.
︙ | |||
206 207 208 209 210 211 212 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | - + - - - + + + + | ** ** There is at most one AutoincInfo structure per table even if the ** same table is autoincremented multiple times due to inserts within ** triggers. A new AutoincInfo structure is created if this is the ** first use of table pTab. On 2nd and subsequent uses, the original ** AutoincInfo structure is used. ** |
︙ | |||
238 239 240 241 242 243 244 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | - + | if( pInfo==0 ) return 0; pInfo->pNext = pToplevel->pAinc; pToplevel->pAinc = pInfo; pInfo->pTab = pTab; pInfo->iDb = iDb; pToplevel->nMem++; /* Register to hold name of table */ pInfo->regCtr = ++pToplevel->nMem; /* Max rowid register */ |
︙ | |||
266 267 268 269 270 271 272 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | - + - + + + - - - - + + + + - + + + + - + | assert( sqlite3IsToplevel(pParse) ); assert( v ); /* We failed long ago if this is not so */ for(p = pParse->pAinc; p; p = p->pNext){ static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList autoInc[] = { /* 0 */ {OP_Null, 0, 0, 0}, |
︙ | |||
339 340 341 342 343 344 345 346 347 348 349 350 351 352 | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | + + | VdbeOp *aOp; Db *pDb = &db->aDb[p->iDb]; int iRec; int memId = p->regCtr; iRec = sqlite3GetTempReg(pParse); assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) ); sqlite3VdbeAddOp3(v, OP_Le, memId+2, sqlite3VdbeCurrentAddr(v)+7, memId); VdbeCoverage(v); sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite); aOp = sqlite3VdbeAddOpList(v, ArraySize(autoIncEnd), autoIncEnd, iLn); if( aOp==0 ) break; aOp[0].p1 = memId+1; aOp[1].p2 = memId+1; aOp[2].p1 = memId-1; aOp[2].p3 = iRec; |
︙ |