OSSP CVS Repository

ossp - Check-in [5976]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5976
Date: 2007-Oct-12 22:34:47 (local)
2007-Oct-12 20:34:47 (UTC)
User:rse
Branch:
Comment: PostgreSQL bindings: use SET_VARSIZE() instead of assigning to bytea->v_len under PostgreSQL >= 8.3
Tickets:
Inspections:
Files:
ossp-pkg/uuid/ChangeLog      1.148 -> 1.149     4 inserted, 0 deleted
ossp-pkg/uuid/pgsql/uuid.c      1.8 -> 1.9     4 inserted, 0 deleted

ossp-pkg/uuid/ChangeLog 1.148 -> 1.149

--- ChangeLog    2007/08/28 12:26:37     1.148
+++ ChangeLog    2007/10/12 20:34:47     1.149
@@ -13,6 +13,10 @@
 
   Changes between 1.5.1 and 1.6.0 (31-Jul-2006 to 19-May-2007)
 
+   o PostgreSQL bindings: use SET_VARSIZE() instead
+     of assigning to bytea->v_len under PostgreSQL >= 8.3
+     [Ralf S. Engelschall]
+
    o Upgrade build environment to GNU libtool 1.5.24
      [Ralf S. Engelschall]
 


ossp-pkg/uuid/pgsql/uuid.c 1.8 -> 1.9

--- uuid.c       2007/01/01 18:14:58     1.8
+++ uuid.c       2007/10/12 20:34:47     1.9
@@ -200,7 +200,11 @@
     if ((uuid_bytea = (bytea *)palloc(VARHDRSZ + UUID_LEN_BIN)) == NULL)
         ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
                 errmsg("failed to allocate UUID bytea")));
+#if defined(SET_VARSIZE) /* PostgreSQL >= 8.3 */
+    SET_VARSIZE(uuid_bytea, VARHDRSZ + UUID_LEN_BIN);
+#else
     uuid_bytea->vl_len = VARHDRSZ + UUID_LEN_BIN;
+#endif
     memcpy(uuid_bytea->vl_dat, uuid_datum->uuid_bin, UUID_LEN_BIN);
 
     /* return UUID bytea */

CVSTrac 2.0.1