/ Check-in [1bc2d046]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem causing LSM to add unnecessary padding to empty segments in compressed databases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1bc2d04645c5239ba9a30a13f6fb3c8cc46461c864e7927012bc0ad305eb705e
User & Date: dan 2017-11-08 11:14:53
Context
2017-11-09
03:55
Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID tables. This is a temporary fix for ticket [d4beea1633f1b88f] until a better solution can be found. check-in: 62fe56b5 user: drh tags: trunk
2017-11-08
11:14
Fix a problem causing LSM to add unnecessary padding to empty segments in compressed databases. check-in: 1bc2d046 user: dan tags: trunk
02:50
Improved comments used for documentation of sqlite3_vfs. No changes to code. check-in: db8f22d0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/lsm1/Makefile.

    39     39                $(LSMDIR)/lsm-test/lsmtest_main.c $(LSMDIR)/lsm-test/lsmtest_mem.c \
    40     40                $(LSMDIR)/lsm-test/lsmtest_tdb.c $(LSMDIR)/lsm-test/lsmtest_tdb3.c \
    41     41                $(LSMDIR)/lsm-test/lsmtest_util.c $(LSMDIR)/lsm-test/lsmtest_win32.c
    42     42   
    43     43   
    44     44   # all: lsm.so
    45     45   
    46         -LSMOPTS += -DLSM_MUTEX_PTHREADS=1 -I$(LSMDIR)
           46  +LSMOPTS += -DLSM_MUTEX_PTHREADS=1 -I$(LSMDIR) -DHAVE_ZLIB
    47     47   
    48     48   lsm.so:	$(LSMOBJ)
    49     49   	$(TCCX) -shared -o lsm.so $(LSMOBJ)
    50     50   
    51     51   %.o:	$(LSMDIR)/%.c $(LSMHDR) sqlite3.h
    52     52   	$(TCCX) $(LSMOPTS) -c $<
    53     53   	
    54     54   lsmtest$(EXE): $(LSMOBJ) $(LSMTESTSRC) $(LSMTESTHDR) sqlite3.o
    55     55   	# $(TCPPX) -c $(TOP)/lsm-test/lsmtest_tdb2.cc
    56         -	$(TCCX) $(LSMOPTS) $(LSMTESTSRC) $(LSMOBJ) sqlite3.o -o lsmtest$(EXE) $(THREADLIB)
           56  +	$(TCCX) $(LSMOPTS) $(LSMTESTSRC) $(LSMOBJ) sqlite3.o -o lsmtest$(EXE) $(THREADLIB) -lz

Changes to ext/lsm1/lsm_file.c.

  2799   2799   */
  2800   2800   int lsmFsSortedPadding(
  2801   2801     FileSystem *pFS, 
  2802   2802     Snapshot *pSnapshot,
  2803   2803     Segment *pSeg
  2804   2804   ){
  2805   2805     int rc = LSM_OK;
  2806         -  if( pFS->pCompress ){
         2806  +  if( pFS->pCompress && pSeg->iFirst ){
  2807   2807       Pgno iLast2;
  2808   2808       Pgno iLast = pSeg->iLastPg;     /* Current last page of segment */
  2809   2809       int nPad;                       /* Bytes of padding required */
  2810   2810       u8 aSz[3];
  2811   2811   
  2812   2812       iLast2 = (1 + iLast/pFS->szSector) * pFS->szSector - 1;
  2813   2813       assert( fsPageToBlock(pFS, iLast)==fsPageToBlock(pFS, iLast2) );