forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit06c7234
committed
Second try at fixing numeric data passed through an ECPG SQLDA.
In commitecfd557, I removed sqlda.c's checks for ndigits != 0 on thegrounds that we should duplicate the state of the numeric value's digitbuffer even when all the digits are zeroes. However, that still isn'tquite right, because another possible state of the digit buffer isbuf == digits == NULL (this occurs for a NaN). As the code now stands,it'll invoke memcpy with a NULL source address and zero bytecount,which we know a few platforms crash on. Hence, reinstate the no-copyshort-circuit, but make it test specifically for buf != NULL rather thansome other condition. In hindsight, the ndigits test (added by commitf2ae9f9) was almost certainly meant to fix the NaN case not theall-zeroes case as the associated thread alleged.As before, back-patch to all supported versions.Discussion:https://postgr.es/m/1803D792815FC24D871C00D17AE95905C71161@g01jpexmbkw241 parent1b5d797 commit06c7234
File tree
5 files changed
+23
-16
lines changed- src/interfaces/ecpg
- ecpglib
- test
- expected
- sql
5 files changed
+23
-16
lines changedLines changed: 16 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
126 |
| - | |
| 126 | + | |
| 127 | + | |
127 | 128 |
| |
128 | 129 |
| |
129 | 130 |
| |
| |||
347 | 348 |
| |
348 | 349 |
| |
349 | 350 |
| |
350 |
| - | |
351 |
| - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
352 | 355 |
| |
353 |
| - | |
354 |
| - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
355 | 359 |
| |
356 | 360 |
| |
357 | 361 |
| |
| |||
533 | 537 |
| |
534 | 538 |
| |
535 | 539 |
| |
536 |
| - | |
537 |
| - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
538 | 544 |
| |
539 |
| - | |
540 |
| - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
541 | 548 |
| |
542 | 549 |
| |
543 | 550 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
| 231 | + | |
232 | 232 |
| |
233 | 233 |
| |
234 | 234 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
| 81 | + | |
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
| 98 | + | |
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
|
0 commit comments
Comments
(0)