forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7ee7ee1
committed
BLOBs containing NUL characters (ASCII 0) can be written to the
database, but they get truncated at the first NUL by lo_readwhen they are read back. The reason for this is that lo_read inPg.xs is using the default: OUTPUT: RETVAL bufwhich uses C's strlen() to work out the length of the scalar.The code ought to read something more like: OUTPUT: RETVAL buf sv_setpvn((SV*)ST(2), buf, RETVAL);I am not sure if this needs to be done on both lo_read methodsin this file, but I changed both and have not since had anyproblems with truncated BLOBs.Douglas Thomson <dougt@mugc.cc.monash.edu.au>1 parent714efa8 commit7ee7ee1
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| |||
0 commit comments
Comments
(0)