Commit cea2cdc
committed
sql: fix REPLACE routine logic with multiple DEFAULT expressions
When we added support for DEFAULT expressions in routine signatures in
41cb974, we introduced a bug for
REPLACE functionality. Namely, we need to store the type-checked
serialized representation of the default expressions in the proto, so
the expressions in the existing Overload must also have been
type-checked (so that we can find the correct signature in the proto to
update). However, we had the incorrect short-circuiting behavior when
type-checking existing default expressions where we'd stop once
a "signature change" is discovered. The fix is simple - we need to
type-check all default expressions separately from checking whether the
signature has changed.
Release note (bug fix): Previously, CockroachDB could encounter an
internal error when replacing (via CREATE OR REPLACE stmt)
a user-defined function or a stored procedure when multiple DEFAULT
expressions are included in the old signature. The bug has been present
since v24.2 (when support for DEFAULT expressions was added) and is now
fixed.1 parent 8cbf680 commit cea2cdc
File tree
5 files changed
+78
-4
lines changed- pkg
- ccl/logictestccl/testdata/logic_test
- sql
- logictest/testdata/logic_test
5 files changed
+78
-4
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
883 | 902 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1051 | 1070 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
325 | 329 | | |
| 330 | + | |
| 331 | + | |
326 | 332 | | |
327 | 333 | | |
328 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
769 | 784 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
917 | 932 | | |
0 commit comments