forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf180290
committed
ecpg: Fix handling of strings in ORACLE compat code with SQLDA
When compiled with -C ORACLE, ecpg_get_data() had a one-off issue whereit would incorrectly store the null terminator byte to str[-1] whenvarcharsize is 0, which is something that can happen when using SQLDA.This would eat 1 byte from the previous field stored, corrupting theresults generated.All the callers of ecpg_get_data() estimate and allocate enough storagefor the data received, and the fix of this commit relies on thisassumption. Note that this maps to the case where no padding ortruncation is required.This issue has been introduced by3b7ab43 with the Oracle compatibilityoption, so backpatch down to v11.Author: Kyotaro HoriguchiDiscussion:https://postgr.es/m/20230410.173500.440060475837236886.horikyota.ntt@gmail.comBackpatch-through: 111 parenteef231e commitf180290
File tree
5 files changed
+310
-127
lines changed- src/interfaces/ecpg
- ecpglib
- test
- compat_oracle
- expected
5 files changed
+310
-127
lines changedLines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
578 | 578 |
| |
579 | 579 |
| |
580 | 580 |
| |
581 |
| - | |
| 581 | + | |
582 | 582 |
| |
583 | 583 |
| |
584 | 584 |
| |
| |||
638 | 638 |
| |
639 | 639 |
| |
640 | 640 |
| |
641 |
| - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
642 | 651 |
| |
643 | 652 |
| |
644 |
| - | |
| 653 | + | |
645 | 654 |
| |
646 | 655 |
| |
647 |
| - | |
| 656 | + | |
648 | 657 |
| |
649 | 658 |
| |
650 |
| - | |
| 659 | + | |
651 | 660 |
| |
652 | 661 |
| |
653 | 662 |
| |
|
Lines changed: 30 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 |
| |
6 | 10 |
| |
7 | 11 |
| |
| |||
20 | 24 |
| |
21 | 25 |
| |
22 | 26 |
| |
| 27 | + | |
| 28 | + | |
23 | 29 |
| |
24 | 30 |
| |
25 | 31 |
| |
| |||
53 | 59 |
| |
54 | 60 |
| |
55 | 61 |
| |
| 62 | + | |
56 | 63 |
| |
57 |
| - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
58 | 84 |
| |
| 85 | + | |
59 | 86 |
| |
60 | 87 |
| |
| 88 | + | |
| 89 | + | |
61 | 90 |
| |
62 | 91 |
| |
63 | 92 |
| |
|
0 commit comments
Comments
(0)