- Notifications
You must be signed in to change notification settings - Fork28
Commitd08c44f
committed
Fix mvdistinct and dependencies size calculations
The formulas used to calculate size while (de)serializing mvndistinctand functional dependencies were based on offset() of the structs. Butthat is incorrect, because the structures are not copied directly, wewe copy the individual fields directly.At the moment this works fine, because there is no alignment paddingon any platform we support. But it might break if we ever added somefields into any of the structs, for example. It's also confusing.Fixed by reworking the macros to directly sum sizes of serializedfields. The macros are now useful only for serialiation, so there isno point in keeping them in the public header file. So make themprivate by moving them to the .c files.Also adds a couple more asserts to check the serialization, and fixesan incorrect allocation of MVDependency instead of (MVDependency *).Reported-By: Tom LaneDiscussion:https://postgr.es/m/29785.1555365602@sss.pgh.pa.us1 parentbfbc150 commitd08c44f
File tree
3 files changed
+56
-40
lines changed- src
- backend/statistics
- include/statistics
3 files changed
+56
-40
lines changedLines changed: 29 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 |
| |
36 | 50 |
| |
37 | 51 |
| |
| |||
408 | 422 |
| |
409 | 423 |
| |
410 | 424 |
| |
411 |
| - | |
| 425 | + | |
412 | 426 |
| |
413 | 427 |
| |
414 | 428 |
| |
| |||
436 | 450 |
| |
437 | 451 |
| |
438 | 452 |
| |
439 |
| - | |
440 |
| - | |
| 453 | + | |
441 | 454 |
| |
442 | 455 |
| |
443 | 456 |
| |
444 |
| - | |
| 457 | + | |
445 | 458 |
| |
446 | 459 |
| |
447 | 460 |
| |
| |||
461 | 474 |
| |
462 | 475 |
| |
463 | 476 |
| |
464 |
| - | |
465 |
| - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
466 | 482 |
| |
467 | 483 |
| |
468 | 484 |
| |
469 | 485 |
| |
| 486 | + | |
470 | 487 |
| |
471 | 488 |
| |
472 | 489 |
| |
| 490 | + | |
| 491 | + | |
| 492 | + | |
473 | 493 |
| |
474 | 494 |
| |
475 | 495 |
| |
| |||
487 | 507 |
| |
488 | 508 |
| |
489 | 509 |
| |
490 |
| - | |
| 510 | + | |
491 | 511 |
| |
492 |
| - | |
| 512 | + | |
493 | 513 |
| |
494 | 514 |
| |
495 | 515 |
| |
| |||
519 | 539 |
| |
520 | 540 |
| |
521 | 541 |
| |
522 |
| - | |
523 |
| - | |
524 |
| - | |
| 542 | + | |
525 | 543 |
| |
526 | 544 |
| |
527 | 545 |
| |
|
Lines changed: 26 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
46 | 60 |
| |
47 | 61 |
| |
48 | 62 |
| |
| |||
168 | 182 |
| |
169 | 183 |
| |
170 | 184 |
| |
171 |
| - | |
172 |
| - | |
| 185 | + | |
173 | 186 |
| |
174 | 187 |
| |
175 | 188 |
| |
| |||
178 | 191 |
| |
179 | 192 |
| |
180 | 193 |
| |
181 |
| - | |
| 194 | + | |
| 195 | + | |
182 | 196 |
| |
183 | 197 |
| |
184 | 198 |
| |
| |||
195 | 209 |
| |
196 | 210 |
| |
197 | 211 |
| |
198 |
| - | |
199 |
| - | |
| 212 | + | |
200 | 213 |
| |
201 | 214 |
| |
202 | 215 |
| |
| |||
218 | 231 |
| |
219 | 232 |
| |
220 | 233 |
| |
| 234 | + | |
221 | 235 |
| |
222 | 236 |
| |
223 | 237 |
| |
| 238 | + | |
| 239 | + | |
| 240 | + | |
224 | 241 |
| |
225 | 242 |
| |
226 | 243 |
| |
| |||
241 | 258 |
| |
242 | 259 |
| |
243 | 260 |
| |
244 |
| - | |
| 261 | + | |
245 | 262 |
| |
246 |
| - | |
| 263 | + | |
247 | 264 |
| |
248 | 265 |
| |
249 | 266 |
| |
| |||
272 | 289 |
| |
273 | 290 |
| |
274 | 291 |
| |
275 |
| - | |
276 |
| - | |
277 |
| - | |
| 292 | + | |
278 | 293 |
| |
279 | 294 |
| |
280 | 295 |
| |
| |||
285 | 300 |
| |
286 | 301 |
| |
287 | 302 |
| |
288 |
| - | |
| 303 | + | |
289 | 304 |
| |
290 | 305 |
| |
291 | 306 |
| |
|
Lines changed: 1 addition & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 | 32 |
| |
37 | 33 |
| |
38 | 34 |
| |
| |||
42 | 38 |
| |
43 | 39 |
| |
44 | 40 |
| |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
| 41 | + | |
52 | 42 |
| |
53 | 43 |
| |
54 | 44 |
| |
| |||
63 | 53 |
| |
64 | 54 |
| |
65 | 55 |
| |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 | 56 |
| |
71 | 57 |
| |
72 | 58 |
| |
| |||
75 | 61 |
| |
76 | 62 |
| |
77 | 63 |
| |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 | 64 |
| |
82 | 65 |
| |
83 | 66 |
| |
|
0 commit comments
Comments
(0)