Enable the SQLITE_ENABLE_NULL_TRIM option for WITHOUT ROWID tables.

FossilOrigin-Name: 54836270c9c0bfa5910f7ad74ec238b9d7ddee5f
This commit is contained in:
drh 2017-02-14 20:00:16 +00:00
parent d2f92c26d5
commit 7e4acf7b44
3 changed files with 15 additions and 9 deletions

@ -1,5 +1,5 @@
C More\srealistic\slengths\sof\sstring\svalues\sin\sspeedtest1\swith\s--testset\sorm.
D 2017-02-14T16:30:13.697
C Enable\sthe\sSQLITE_ENABLE_NULL_TRIM\soption\sfor\sWITHOUT\sROWID\stables.
D 2017-02-14T20:00:16.259
F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 067a6766f800cc8d72845ab61f8de4ffe8f3fc99
@ -356,7 +356,7 @@ F src/hash.c 63d0ee752a3b92d4695b2b1f5259c4621b2cfebd
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 444354c23d4d140a57d6eb46f34e376a7f8f62e8
F src/insert.c 891f6789bafca1f0a3b4f7cbb9c363229eaec828
F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
F src/loadext.c a68d8d1d14cf7488bb29dc5311cb1ce9a4404258
F src/main.c e207b81542d13b9f13d61e78ca441f9781f055b0
@ -1555,7 +1555,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 58b2f911eec2e3eb9944dd6d8573ff5c7bd43f70
R 20b26eda0719e5594bae6bc77f8993f3
P e4731fd65f9698817690b741cc454f25e8e871e6
R 239d7ae4b4c76fa68b6a3d5959c5ddbe
U drh
Z ceef40c49fe3ba25325b7e3939c1bded
Z 558f1297c34d38d9f2c9884a0e7f3db0

@ -1 +1 @@
e4731fd65f9698817690b741cc454f25e8e871e6
54836270c9c0bfa5910f7ad74ec238b9d7ddee5f

@ -1527,6 +1527,9 @@ void sqlite3GenerateConstraintChecks(
}
sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn, aRegIdx[ix]);
VdbeComment((v, "for %s", pIdx->zName));
#ifdef SQLITE_ENABLE_NULL_TRIM
if( pIdx->idxType==2 ) sqlite3SetMakeRecordP5(v, pIdx->pTable);
#endif
/* In an UPDATE operation, if this index is the PRIMARY KEY index
** of a WITHOUT ROWID table and there has been no change the
@ -1682,8 +1685,11 @@ void sqlite3SetMakeRecordP5(Vdbe *v, Table *pTab){
** version 2 and later (SQLite version 3.1.4, 2005-02-20). */
if( pTab->pSchema->file_format<2 ) return;
for(i=pTab->nCol; i>1 && pTab->aCol[i-1].pDflt==0; i--){}
sqlite3VdbeChangeP5(v, i);
for(i=pTab->nCol-1; i>0; i--){
if( pTab->aCol[i].pDflt!=0 ) break;
if( pTab->aCol[i].colFlags & COLFLAG_PRIMKEY ) break;
}
sqlite3VdbeChangeP5(v, i+1);
}
#endif