github.com/cockroachdb/pebble@v1.1.2/internal/keyspan/testdata/truncate (about) 1 build 2 1: b-d 3 2: d-f 4 3: f-h 5 ---- 6 1: b-d 7 2: d-f 8 3: f-h 9 10 11 truncate a-b 12 ---- 13 14 truncate a-c 15 ---- 16 1: bc 17 18 truncate a-d 19 ---- 20 1: b-d 21 22 truncate a-e 23 ---- 24 1: b-d 25 2: de 26 27 # The second range tombstone should be elided, as it starts after the 28 # specified file end key. 29 30 truncate a-e endKey=(d.SET.3) 31 ---- 32 1: b-d 33 34 # The second range tombstone should be back in the below example, as the 35 # specified end key has a trailer (RANGEDEL.2) exactly matching that of the 36 # rangedel tombstone's start key. 37 38 truncate a-e endKey=(d.RANGEDEL.2) 39 ---- 40 1: b-d 41 2: de 42 43 truncate a-e endKey=(d.SET.1) 44 ---- 45 1: b-d 46 2: de 47 48 # Similarly, truncate range tombstones that end before the start key. 49 50 truncate a-e startKey=(d.SET.3) 51 ---- 52 2: de 53 54 truncate a-e startKey=(c.SET.3) 55 ---- 56 1: b-d 57 2: de 58 59 truncate a-f 60 ---- 61 1: b-d 62 2: d-f 63 64 truncate a-g 65 ---- 66 1: b-d 67 2: d-f 68 3: fg 69 70 truncate a-h 71 ---- 72 1: b-d 73 2: d-f 74 3: f-h 75 76 77 truncate b-b 78 ---- 79 80 truncate b-c 81 ---- 82 1: bc 83 84 truncate b-d 85 ---- 86 1: b-d 87 88 truncate b-e 89 ---- 90 1: b-d 91 2: de 92 93 truncate b-f 94 ---- 95 1: b-d 96 2: d-f 97 98 truncate b-g 99 ---- 100 1: b-d 101 2: d-f 102 3: fg 103 104 truncate b-h 105 ---- 106 1: b-d 107 2: d-f 108 3: f-h 109 110 111 truncate c-c 112 ---- 113 114 truncate c-d 115 ---- 116 1: cd 117 118 truncate c-e 119 ---- 120 1: cd 121 2: de 122 123 truncate c-f 124 ---- 125 1: cd 126 2: d-f 127 128 truncate c-g 129 ---- 130 1: cd 131 2: d-f 132 3: fg 133 134 truncate c-h 135 ---- 136 1: cd 137 2: d-f 138 3: f-h 139 140 141 truncate d-d 142 ---- 143 144 truncate d-e 145 ---- 146 2: de 147 148 truncate d-f 149 ---- 150 2: d-f 151 152 truncate d-g 153 ---- 154 2: d-f 155 3: fg 156 157 truncate d-h 158 ---- 159 2: d-f 160 3: f-h 161 162 163 truncate e-e 164 ---- 165 166 truncate e-f 167 ---- 168 2: ef 169 170 truncate e-g 171 ---- 172 2: ef 173 3: fg 174 175 truncate e-h 176 ---- 177 2: ef 178 3: f-h 179 180 181 truncate f-f 182 ---- 183 184 truncate f-g 185 ---- 186 3: fg 187 188 truncate f-h 189 ---- 190 3: f-h 191 192 193 truncate g-g 194 ---- 195 196 truncate g-h 197 ---- 198 3: gh 199 200 # Regression test for https://github.com/cockroachdb/cockroach/issues/113973. 201 202 truncate-and-save-iter a-dd 203 ---- 204 ok 205 206 saved-iter 207 first 208 next 209 next 210 next 211 ---- 212 b-d:{(#1,RANGEDEL)} 213 d-dd:{(#2,RANGEDEL)} 214 <nil> 215 <nil> 216 217 saved-iter 218 seek-ge e 219 next 220 next 221 ---- 222 <nil> 223 <nil> 224 <nil> 225 226 saved-iter 227 seek-ge e 228 prev 229 prev 230 ---- 231 <nil> 232 d-dd:{(#2,RANGEDEL)} 233 b-d:{(#1,RANGEDEL)} 234 235 saved-iter 236 seek-lt e 237 prev 238 prev 239 ---- 240 d-dd:{(#2,RANGEDEL)} 241 b-d:{(#1,RANGEDEL)} 242 <nil> 243 244 saved-iter 245 seek-lt e 246 next 247 next 248 ---- 249 d-dd:{(#2,RANGEDEL)} 250 <nil> 251 <nil> 252 253 truncate-and-save-iter ee-h 254 ---- 255 ok 256 257 saved-iter 258 first 259 next 260 next 261 next 262 ---- 263 ee-f:{(#2,RANGEDEL)} 264 f-h:{(#3,RANGEDEL)} 265 <nil> 266 <nil> 267 268 saved-iter 269 seek-ge e 270 next 271 next 272 ---- 273 ee-f:{(#2,RANGEDEL)} 274 f-h:{(#3,RANGEDEL)} 275 <nil> 276 277 saved-iter 278 seek-ge e 279 prev 280 prev 281 ---- 282 ee-f:{(#2,RANGEDEL)} 283 <nil> 284 <nil> 285 286 saved-iter 287 seek-lt e 288 prev 289 prev 290 ---- 291 <nil> 292 <nil> 293 <nil> 294 295 saved-iter 296 seek-lt e 297 next 298 next 299 ---- 300 <nil> 301 ee-f:{(#2,RANGEDEL)} 302 f-h:{(#3,RANGEDEL)} 303 304 305 truncate-and-save-iter a-g 306 ---- 307 ok 308 309 saved-iter 310 seek-ge h 311 prev 312 seek-lt h 313 next 314 ---- 315 <nil> 316 f-g:{(#3,RANGEDEL)} 317 f-g:{(#3,RANGEDEL)} 318 <nil>