- Notifications
You must be signed in to change notification settings - Fork5
Commitf8ace54
committed
Fix type-safety problem with parallel aggregate serial/deserialization.
The original specification for this called for the deserialization functionto have signature "deserialize(serialtype) returns transtype", which is asecurity violation if transtype is INTERNAL (which it always would be inpractice) and serialtype is not (which ditto). The patch blithely overrodethe opr_sanity check for that, which was sloppy-enough work in itself,but the indisputable reason this cannot be allowed to stand is that CREATEFUNCTION will reject such a signature and thus it'd be impossible forextensions to create parallelizable aggregates.The minimum fix to make the signature type-safe is to add a second, dummyargument of type INTERNAL. But to lock it down a bit more and make misuseof INTERNAL-accepting functions less likely, let's get rid of the abilityto specify a "serialtype" for an aggregate and just say that the onlyuseful serialtype is BYTEA --- which, in practice, is the only interestingvalue anyway, due to the usefulness of the send/recv infrastructure forthis purpose. That means we only have to allow "serialize(internal)returns bytea" and "deserialize(bytea, internal) returns internal" asthe signatures for these support functions.In passing fix bogus signature of int4_avg_combine, which I found thanksto adding an opr_sanity check on combinefunc signatures.catversion bump due to removing pg_aggregate.aggserialtype and adjustingsignatures of assorted built-in functions.David Rowley and Tom LaneDiscussion: <27247.1466185504@sss.pgh.pa.us>1 parente45e990 commitf8ace54
File tree
18 files changed
+506
-715
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- executor
- optimizer/util
- parser
- utils/adt
- bin/pg_dump
- include
- catalog
- parser
- test/regress
- expected
- sql
18 files changed
+506
-715
lines changedLines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 | 466 |
| |
473 | 467 |
| |
474 | 468 |
| |
|
Lines changed: 49 additions & 52 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
34 | 33 |
| |
35 | 34 |
| |
36 | 35 |
| |
| |||
50 | 49 |
| |
51 | 50 |
| |
52 | 51 |
| |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 | 52 |
| |
58 | 53 |
| |
59 | 54 |
| |
| |||
72 | 67 |
| |
73 | 68 |
| |
74 | 69 |
| |
75 |
| - | |
76 | 70 |
| |
77 | 71 |
| |
78 | 72 |
| |
| |||
255 | 249 |
| |
256 | 250 |
| |
257 | 251 |
| |
258 |
| - | |
| 252 | + | |
259 | 253 |
| |
260 | 254 |
| |
261 | 255 |
| |
| |||
412 | 406 |
| |
413 | 407 |
| |
414 | 408 |
| |
415 |
| - | |
416 |
| - | |
417 |
| - | |
418 |
| - | |
419 |
| - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
420 | 413 |
| |
421 | 414 |
| |
422 | 415 |
| |
423 |
| - | |
424 |
| - | |
425 |
| - | |
426 |
| - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
427 | 432 |
| |
428 | 433 |
| |
429 | 434 |
| |
430 | 435 |
| |
431 |
| - | |
432 |
| - | |
433 |
| - | |
434 |
| - | |
435 |
| - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
436 | 443 |
| |
437 |
| - | |
| 444 | + | |
438 | 445 |
| |
439 |
| - | |
440 |
| - | |
441 |
| - | |
442 |
| - | |
443 |
| - | |
444 |
| - | |
445 |
| - | |
446 |
| - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
447 | 454 |
| |
448 | 455 |
| |
449 | 456 |
| |
| |||
452 | 459 |
| |
453 | 460 |
| |
454 | 461 |
| |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
463 | 469 |
| |
464 | 470 |
| |
465 | 471 |
| |
| |||
470 | 476 |
| |
471 | 477 |
| |
472 | 478 |
| |
473 |
| - | |
| 479 | + | |
474 | 480 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 |
| - | |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
488 | 485 |
| |
489 | 486 |
| |
490 | 487 |
| |
|
Lines changed: 11 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
70 |
| - | |
71 | 70 |
| |
72 | 71 |
| |
73 | 72 |
| |
| |||
440 | 439 |
| |
441 | 440 |
| |
442 | 441 |
| |
443 |
| - | |
444 |
| - | |
445 |
| - | |
| 442 | + | |
446 | 443 |
| |
447 | 444 |
| |
448 | 445 |
| |
449 |
| - | |
| 446 | + | |
450 | 447 |
| |
451 | 448 |
| |
452 | 449 |
| |
453 | 450 |
| |
454 | 451 |
| |
455 |
| - | |
| 452 | + | |
456 | 453 |
| |
457 | 454 |
| |
458 | 455 |
| |
459 | 456 |
| |
460 |
| - | |
| 457 | + | |
461 | 458 |
| |
462 | 459 |
| |
463 | 460 |
| |
464 |
| - | |
465 |
| - | |
| 461 | + | |
466 | 462 |
| |
467 | 463 |
| |
468 | 464 |
| |
469 |
| - | |
| 465 | + | |
| 466 | + | |
470 | 467 |
| |
471 |
| - | |
| 468 | + | |
472 | 469 |
| |
473 | 470 |
| |
474 | 471 |
| |
475 |
| - | |
| 472 | + | |
476 | 473 |
| |
477 | 474 |
| |
478 | 475 |
| |
479 | 476 |
| |
480 |
| - | |
| 477 | + | |
481 | 478 |
| |
482 | 479 |
| |
483 | 480 |
| |
| |||
661 | 658 |
| |
662 | 659 |
| |
663 | 660 |
| |
664 |
| - | |
665 | 661 |
| |
666 | 662 |
| |
667 | 663 |
| |
| |||
688 | 684 |
| |
689 | 685 |
| |
690 | 686 |
| |
691 |
| - | |
692 |
| - | |
| 687 | + | |
693 | 688 |
| |
694 | 689 |
| |
695 | 690 |
| |
|
Lines changed: 8 additions & 61 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
76 | 75 |
| |
77 | 76 |
| |
78 | 77 |
| |
| |||
88 | 87 |
| |
89 | 88 |
| |
90 | 89 |
| |
91 |
| - | |
92 | 90 |
| |
93 | 91 |
| |
94 | 92 |
| |
| |||
164 | 162 |
| |
165 | 163 |
| |
166 | 164 |
| |
167 |
| - | |
168 |
| - | |
169 | 165 |
| |
170 | 166 |
| |
171 | 167 |
| |
| |||
333 | 329 |
| |
334 | 330 |
| |
335 | 331 |
| |
336 |
| - | |
| 332 | + | |
337 | 333 |
| |
338 | 334 |
| |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
| 335 | + | |
343 | 336 |
| |
344 | 337 |
| |
345 | 338 |
| |
346 | 339 |
| |
347 |
| - | |
| 340 | + | |
348 | 341 |
| |
349 |
| - | |
350 |
| - | |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 | 342 |
| |
387 |
| - | |
| 343 | + | |
388 | 344 |
| |
389 | 345 |
| |
390 |
| - | |
391 |
| - | |
| 346 | + | |
392 | 347 |
| |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
403 | 351 |
| |
404 | 352 |
| |
405 | 353 |
| |
| |||
493 | 441 |
| |
494 | 442 |
| |
495 | 443 |
| |
496 |
| - | |
497 | 444 |
| |
498 | 445 |
| |
499 | 446 |
| |
|
0 commit comments
Comments
(0)