summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/data.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-07-27 10:29:11 +0900
committerMichael Paquier <michael@paquier.xyz>2020-07-27 10:29:11 +0900
commit61a4a3a62a98bb7508a86d00900e80e23ebf2b63 (patch)
tree95fbd0d33677ab67a1d14590d2e2e7ff54c43ca8 /src/interfaces/ecpg/ecpglib/data.c
parentbdaa84e38932de43fca89b20a5078bf92ea356e4 (diff)
Fix handling of structure for bytea data type in ECPG
Some code paths dedicated to bytea used the structure for varchar. This did not lead to any actual bugs, as bytea and varchar have the same definition, but it could become a trap if one of these definitions changes for a new feature or a bug fix. Issue introduced by 050710b. Author: Shenhao Wang Reviewed-by: Vignesh C, Michael Paquier Discussion: https://postgr.es/m/07ac7dee1efc44f99d7f53a074420177@G08CNEXMBPEKD06.g08.fujitsu.local Backpatch-through: 12
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 81f94cc12b8..9cf0292e02f 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -529,8 +529,8 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
case ECPGt_bytea:
{
- struct ECPGgeneric_varchar *variable =
- (struct ECPGgeneric_varchar *) (var + offset * act_tuple);
+ struct ECPGgeneric_bytea *variable =
+ (struct ECPGgeneric_bytea *) (var + offset * act_tuple);
long dst_size,
src_size,
dec_size;