1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Experimental enhancement to automatically trim NULL values from the end of

records, for a reduced disk footprint.  This change also involves increasing
the P5 operand from 8 to 16 bits.

FossilOrigin-Name: 118ded403b95050b74ae2b03919c43d614094a32
This commit is contained in:
drh
2017-01-25 14:58:27 +00:00
parent 7888d14caa
commit 585ce1923c
7 changed files with 48 additions and 16 deletions

View File

@@ -2777,6 +2777,18 @@ case OP_MakeRecord: {
}while( zAffinity[0] );
}
/* NULLs can be safely trimmed from the end of the record, as long as
** as the schema format is 2 or more and none of the omitted columns
** have a non-NULL default value. Also, the record must be left with
** at least one field. If P5>0 then it will be one more than the
** index of the right-most column with a non-NULL default value */
if( pOp->p5 ){
while( (pLast->flags & MEM_Null)!=0 && nField>pOp->p5 ){
pLast--;
nField--;
}
}
/* Loop through the elements that will make up the record to figure
** out how much space is required for the new record.
*/