[SR-Dev] git:janakj/postgres: Handle conversion between DB_BITMAP and postgresql int8 type.

Jan Janak jan at iptel.org
Sun Feb 15 18:55:28 CET 2009


Module: sip-router
Branch: janakj/postgres
Commit: a0d729889a1d5faea3eb2d73ca170698f63624b3
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a0d729889a1d5faea3eb2d73ca170698f63624b3

Author: Maxim Sobolev <sobomax at sippysoft.com>
Committer: Maxim Sobolev <sobomax at sippysoft.com>
Date:   Wed May 21 04:18:42 2008 +0000

Handle conversion between DB_BITMAP and postgresql int8 type.

---

 modules/db_postgres/pg_fld.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/db_postgres/pg_fld.c b/modules/db_postgres/pg_fld.c
index a9690a5..fb1d6fb 100644
--- a/modules/db_postgres/pg_fld.c
+++ b/modules/db_postgres/pg_fld.c
@@ -542,6 +542,7 @@ int pg_check_pg2fld(db_fld_t* fld, pg_type_t* types)
 		case DB_BITMAP:
 			if (pfld->oid == types[PG_INT2].oid) continue;
 			if (pfld->oid == types[PG_INT4].oid) continue;
+			if (pfld->oid == types[PG_INT8].oid) continue;
 			if (pfld->oid == types[PG_BIT].oid) continue;
 			if (pfld->oid == types[PG_VARBIT].oid) continue;
 			break;
@@ -811,6 +812,8 @@ int pg_pg2fld(db_fld_t* dst, PGresult* src, int row,
 				ret |= pg_int2_2_db_int(dst + i, val, len);
 			else if (type == types[PG_INT4].oid)
 				ret |= pg_int4_2_db_int(dst + i, val, len);
+			else if (type == types[PG_INT8].oid)
+				ret |= pg_int8_2_db_int(dst + i, val, len);
 			else if (type == types[PG_BIT].oid)
 				ret |= pg_bit2db_int(dst + i, val, len);
 			else if (type == types[PG_VARBIT].oid)




More information about the sr-dev mailing list