Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix a compressed mode bug unrelated to the free block list. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | freelist-rework |
Files: | files | file ages | folders |
SHA1: |
6bf6b00b8b3e47f0571400de0e76cd6c |
User & Date: | dan 2012-10-31 16:37:01.291 |
Context
2012-10-31
| ||
18:46 | Remove dead code. Fix a read-lock related problem causing the multi-threaded tests to fail. check-in: f512ea3c4d user: dan tags: freelist-rework | |
16:37 | Fix a compressed mode bug unrelated to the free block list. check-in: 6bf6b00b8b user: dan tags: freelist-rework | |
11:15 | Improve the complex assert() used to check that database file blocks are not leaked or over-allocated. check-in: 1ac4435e5c user: dan tags: freelist-rework | |
Changes
Changes to src/lsm_file.c.
︙ | |||
185 186 187 188 189 190 191 | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + + | lsm_file *fdDb; /* Database file */ lsm_file *fdLog; /* Log file */ int szSector; /* Database file sector size */ /* If this is a compressed database, a pointer to the compression methods. ** For an uncompressed database, a NULL pointer. */ lsm_compress *pCompress; |
︙ | |||
554 555 556 557 558 559 560 | 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | - + + | pPg = pNext; } if( pFS->fdDb ) lsmEnvClose(pFS->pEnv, pFS->fdDb ); if( pFS->fdLog ) lsmEnvClose(pFS->pEnv, pFS->fdLog ); lsmFree(pEnv, pFS->pLsmFile); lsmFree(pEnv, pFS->apHash); |
︙ | |||
1011 1012 1013 1014 1015 1016 1017 | 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | - + + + + + + - + + + + + + - - + + + | } rc = fsBlockNext(pFS, fsPageToBlock(pFS, iOff), &iBlk); *piRes = fsFirstPageOnBlock(pFS, iBlk) + iAdd - (iEob - iOff + 1); return rc; } |
︙ | |||
1043 1044 1045 1046 1047 1048 1049 | 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 | - + | lsm_compress *p = pFS->pCompress; i64 iOff = pPg->iPg; u8 aSz[3]; int rc; assert( p && pPg->nCompress==0 ); |
︙ | |||
1067 1068 1069 1070 1071 1072 1073 | 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | - + - - + + | } }else{ rc = fsAddOffset(pFS, iOff, 3, &iOff); if( rc==LSM_OK ){ if( pPg->nCompress>pFS->nBuffer ){ rc = LSM_CORRUPT_BKPT; }else{ |
︙ | |||
1843 1844 1845 1846 1847 1848 1849 | 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 | - + - + | ** ** If buffer pFS->aBuffer[] has not been allocated then this function ** allocates it. If this fails, LSM_NOMEM is returned. Otherwise, LSM_OK. */ static int fsCompressIntoBuffer(FileSystem *pFS, Page *pPg){ lsm_compress *p = pFS->pCompress; |
︙ | |||
1879 1880 1881 1882 1883 1884 1885 | 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 | - + | rc = fsCompressIntoBuffer(pFS, pPg); /* Serialize the compressed size into buffer aSz[] */ putRecordSize(aSz, pPg->nCompress, 0); /* Write the serialized page record into the database file. */ pPg->iPg = fsAppendData(pFS, pPg->pSeg, aSz, sizeof(aSz), &rc); |
︙ | |||
1949 1950 1951 1952 1953 1954 1955 | 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 | - - + + | assert( nPad>=0 ); if( nPad>=6 ){ pSeg->nSize += nPad; nPad -= 6; putRecordSize(aSz, nPad, 1); fsAppendData(pFS, pSeg, aSz, sizeof(aSz), &rc); |
︙ |