diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-24 15:00:47 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-24 15:00:47 +0000 |
commit | 976246cc7e4d8b673fc62fe6daa61c76d94af1af (patch) | |
tree | b61ea3f5bbd8fa025587754bc90c3fd43889337c /src/interfaces/libpq/fe-exec.c | |
parent | cf4d885c67744637d82f6fec657e8205578c5905 (diff) | |
download | postgresql-976246cc7e4d8b673fc62fe6daa61c76d94af1af.tar.gz postgresql-976246cc7e4d8b673fc62fe6daa61c76d94af1af.zip |
The cstring datatype can now be copied, passed around, etc. The typlen
value '-2' is used to indicate a variable-width type whose width is
computed as strlen(datum)+1. Everything that looks at typlen is updated
except for array support, which Joe Conway is working on; at the moment
it wouldn't work to try to create an array of cstring.
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 3ff32daaeb1..0d1b7ad05ba 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.120 2002/06/20 20:29:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.121 2002/08/24 15:00:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1138,14 +1138,10 @@ getRowDescriptions(PGconn *conn) /* * Since pqGetInt treats 2-byte integers as unsigned, we need to - * coerce the special value "-1" to signed form. (-1 is sent for - * variable-length fields.) Formerly, libpq effectively did a - * sign-extension on the 2-byte value by storing it in a signed - * short. Now we only coerce the single value 65535 == -1; values - * 32768..65534 are taken as valid field lengths. + * coerce the result to signed form. */ - if (typlen == 0xFFFF) - typlen = -1; + typlen = (int) ((int16) typlen); + result->attDescs[i].name = pqResultStrdup(result, conn->workBuffer.data); result->attDescs[i].typid = typid; |