Browse code

- add a new define 'ORACLE_USRLOC' as short term fix before the code freeze - in 1.5 this will be removed again and fixed by introduction of some new DB API functions, as discussed on the devel list

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4290 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 02/06/2008 10:51:04
Showing 3 changed files
... ...
@@ -54,7 +54,11 @@ Chapter 1. User's Guide
54 54
 1.1. Overview
55 55
 
56 56
    This is a module which provides Oracle connectivity for
57
-   OpenSER. It implements the DB API defined in OpenSER.
57
+   OpenSER. It implements the DB API defined in OpenSER. If you
58
+   want to use the nathelper module, or any other modules that
59
+   calls the get_all_ucontacts API export from usrloc, then you
60
+   need to set the DORACLE_USRLOC define in the Makefile.defs file
61
+   before compilation.
58 62
 
59 63
 1.2. Dependencies
60 64
 
... ...
@@ -8,7 +8,11 @@
8 8
 	<title>Overview</title>
9 9
 	<para>
10 10
 		This is a module which provides Oracle connectivity for OpenSER.
11
-		It implements the DB API defined in OpenSER.
11
+		It implements the DB API defined in OpenSER. If you want to use
12
+		the nathelper module, or any other modules that calls the
13
+		get_all_ucontacts API export from usrloc, then you need to set
14
+		the <emphasis>DORACLE_USRLOC</emphasis> define in the Makefile.defs
15
+		file before compilation.
12 16
 	</para>
13 17
 	</section>
14 18
 
... ...
@@ -111,8 +111,13 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,
111 111
 	for (dom = root; dom!=NULL ; dom=dom->next) {
112 112
 		/* build query */
113 113
 		i = snprintf( query_buf, sizeof(query_buf), "select %.*s, %.*s, %.*s,"
114
+#ifdef ORACLE_USRLOC
115
+			" %.*s, %.*s from %s where %.*s > %.*s and "
116
+			"bitand(%.*s, %d) = %d and mod(id, %u) = %u",
117
+#else
114 118
 			" %.*s, %.*s from %s where %.*s > %.*s and %.*s & %d = %d and "
115 119
 			"id %% %u = %u",
120
+#endif
116 121
 			received_col.len, received_col.s,
117 122
 			contact_col.len, contact_col.s,
118 123
 			sock_col.len, sock_col.s,