1 /*-
2 * Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.
3 *
4 * See the file LICENSE for license information.
5 *
6 * $Id$
7 */
8
9 #ifndef HAVE_REPLICATION
10 #include "db_config.h"
11
12 #include "db_int.h"
13 #include "dbinc/db_page.h"
14 #include "dbinc/db_am.h"
15
16 /*
17 * If the library wasn't compiled with replication support, various routines
18 * aren't available. Stub them here, returning an appropriate error.
19 */
20 static int __db_norep __P((ENV *));
21
22 /*
23 * __db_norep --
24 * Error when a Berkeley DB build doesn't include replication support.
25 */
26 static int
__db_norep(env)27 __db_norep(env)
28 ENV *env;
29 {
30 __db_errx(env, DB_STR("3581",
31 "library build did not include support for replication"));
32 return (DB_OPNOTSUP);
33 }
34
35 int
__db_rep_enter(dbp,checkgen,checklock,return_now)36 __db_rep_enter(dbp, checkgen, checklock, return_now)
37 DB *dbp;
38 int checkgen, checklock, return_now;
39 {
40 COMPQUIET(checkgen, 0);
41 COMPQUIET(checklock, 0);
42 COMPQUIET(return_now, 0);
43 return (__db_norep(dbp->env));
44 }
45
46 int
__env_rep_enter(env,checklock)47 __env_rep_enter(env, checklock)
48 ENV *env;
49 int checklock;
50 {
51 COMPQUIET(checklock, 0);
52 return (__db_norep(env));
53 }
54
55 int
__env_db_rep_exit(env)56 __env_db_rep_exit(env)
57 ENV *env;
58 {
59 return (__db_norep(env));
60 }
61
62 int
__op_rep_enter(env,local_nowait,obey_user)63 __op_rep_enter(env, local_nowait, obey_user)
64 ENV *env;
65 int local_nowait, obey_user;
66 {
67 COMPQUIET(local_nowait, 0);
68 COMPQUIET(obey_user, 0);
69 return (__db_norep(env));
70 }
71
72 int
__op_rep_exit(env)73 __op_rep_exit(env)
74 ENV *env;
75 {
76 return (__db_norep(env));
77 }
78
79 int
__archive_rep_enter(env)80 __archive_rep_enter(env)
81 ENV *env;
82 {
83 COMPQUIET(env, NULL);
84 return (0);
85 }
86
87 int
__archive_rep_exit(env)88 __archive_rep_exit(env)
89 ENV *env;
90 {
91 COMPQUIET(env, NULL);
92 return (0);
93 }
94
95 int
__rep_bulk_message(env,bulkp,repth,lsnp,dbt,flags)96 __rep_bulk_message(env, bulkp, repth, lsnp, dbt, flags)
97 ENV *env;
98 REP_BULK *bulkp;
99 REP_THROTTLE *repth;
100 DB_LSN *lsnp;
101 const DBT *dbt;
102 u_int32_t flags;
103 {
104 COMPQUIET(bulkp, NULL);
105 COMPQUIET(repth, NULL);
106 COMPQUIET(lsnp, NULL);
107 COMPQUIET(dbt, NULL);
108 COMPQUIET(flags, 0);
109 return (__db_norep(env));
110 }
111
112 int
__rep_env_refresh(env)113 __rep_env_refresh(env)
114 ENV *env;
115 {
116 COMPQUIET(env, NULL);
117 return (0);
118 }
119
120 int
__rep_elect_pp(dbenv,nsites,nvotes,flags)121 __rep_elect_pp(dbenv, nsites, nvotes, flags)
122 DB_ENV *dbenv;
123 u_int32_t nsites, nvotes;
124 u_int32_t flags;
125 {
126 COMPQUIET(nsites, 0);
127 COMPQUIET(nvotes, 0);
128 COMPQUIET(flags, 0);
129 return (__db_norep(dbenv->env));
130 }
131
132 int
__rep_flush_pp(dbenv)133 __rep_flush_pp(dbenv)
134 DB_ENV *dbenv;
135 {
136 return (__db_norep(dbenv->env));
137 }
138
139 int
__rep_lease_check(env,refresh)140 __rep_lease_check(env, refresh)
141 ENV *env;
142 int refresh;
143 {
144 COMPQUIET(refresh, 0);
145 return (__db_norep(env));
146 }
147
148 int
__rep_lease_expire(env)149 __rep_lease_expire(env)
150 ENV *env;
151 {
152 return (__db_norep(env));
153 }
154
155 void
__rep_msg(env,msg)156 __rep_msg(env, msg)
157 const ENV *env;
158 const char *msg;
159 {
160 COMPQUIET(env, NULL);
161 COMPQUIET(msg, NULL);
162 return;
163 }
164
165 int
__rep_get_clockskew(dbenv,fast_clockp,slow_clockp)166 __rep_get_clockskew(dbenv, fast_clockp, slow_clockp)
167 DB_ENV *dbenv;
168 u_int32_t *fast_clockp, *slow_clockp;
169 {
170 COMPQUIET(fast_clockp, NULL);
171 COMPQUIET(slow_clockp, NULL);
172 return (__db_norep(dbenv->env));
173 }
174
175 int
__rep_set_clockskew(dbenv,fast_clock,slow_clock)176 __rep_set_clockskew(dbenv, fast_clock, slow_clock)
177 DB_ENV *dbenv;
178 u_int32_t fast_clock, slow_clock;
179 {
180 COMPQUIET(fast_clock, 0);
181 COMPQUIET(slow_clock, 0);
182 return (__db_norep(dbenv->env));
183 }
184
185 int
__rep_set_nsites_pp(dbenv,n)186 __rep_set_nsites_pp(dbenv, n)
187 DB_ENV *dbenv;
188 u_int32_t n;
189 {
190 COMPQUIET(n, 0);
191 return (__db_norep(dbenv->env));
192 }
193
194 int
__rep_get_nsites(dbenv,n)195 __rep_get_nsites(dbenv, n)
196 DB_ENV *dbenv;
197 u_int32_t *n;
198 {
199 COMPQUIET(n, NULL);
200 return (__db_norep(dbenv->env));
201 }
202
203 int
__rep_set_priority_pp(dbenv,priority)204 __rep_set_priority_pp(dbenv, priority)
205 DB_ENV *dbenv;
206 u_int32_t priority;
207 {
208 COMPQUIET(priority, 0);
209 return (__db_norep(dbenv->env));
210 }
211
212 int
__rep_get_priority(dbenv,priority)213 __rep_get_priority(dbenv, priority)
214 DB_ENV *dbenv;
215 u_int32_t *priority;
216 {
217 COMPQUIET(priority, NULL);
218 return (__db_norep(dbenv->env));
219 }
220
221 int
__rep_set_timeout_pp(dbenv,which,timeout)222 __rep_set_timeout_pp(dbenv, which, timeout)
223 DB_ENV *dbenv;
224 int which;
225 db_timeout_t timeout;
226 {
227 COMPQUIET(which, 0);
228 COMPQUIET(timeout, 0);
229 return (__db_norep(dbenv->env));
230 }
231
232 int
__rep_get_timeout(dbenv,which,timeout)233 __rep_get_timeout(dbenv, which, timeout)
234 DB_ENV *dbenv;
235 int which;
236 db_timeout_t *timeout;
237 {
238 COMPQUIET(which, 0);
239 COMPQUIET(timeout, NULL);
240 return (__db_norep(dbenv->env));
241 }
242
243 int
__rep_get_config(dbenv,which,onp)244 __rep_get_config(dbenv, which, onp)
245 DB_ENV *dbenv;
246 u_int32_t which;
247 int *onp;
248 {
249 COMPQUIET(which, 0);
250 COMPQUIET(onp, NULL);
251 return (__db_norep(dbenv->env));
252 }
253
254 int
__rep_set_config(dbenv,which,on)255 __rep_set_config(dbenv, which, on)
256 DB_ENV *dbenv;
257 u_int32_t which;
258 int on;
259 {
260 COMPQUIET(which, 0);
261 COMPQUIET(on, 0);
262 return (__db_norep(dbenv->env));
263 }
264
265 int
__rep_get_limit(dbenv,gbytesp,bytesp)266 __rep_get_limit(dbenv, gbytesp, bytesp)
267 DB_ENV *dbenv;
268 u_int32_t *gbytesp, *bytesp;
269 {
270 COMPQUIET(gbytesp, NULL);
271 COMPQUIET(bytesp, NULL);
272 return (__db_norep(dbenv->env));
273 }
274
275 int
__rep_open(env)276 __rep_open(env)
277 ENV *env;
278 {
279 COMPQUIET(env, NULL);
280 return (0);
281 }
282
283 int
__rep_preclose(env)284 __rep_preclose(env)
285 ENV *env;
286 {
287 return (__db_norep(env));
288 }
289
290 int
__rep_process_message_pp(dbenv,control,rec,eid,ret_lsnp)291 __rep_process_message_pp(dbenv, control, rec, eid, ret_lsnp)
292 DB_ENV *dbenv;
293 DBT *control, *rec;
294 int eid;
295 DB_LSN *ret_lsnp;
296 {
297 COMPQUIET(control, NULL);
298 COMPQUIET(rec, NULL);
299 COMPQUIET(eid, 0);
300 COMPQUIET(ret_lsnp, NULL);
301 return (__db_norep(dbenv->env));
302 }
303
304 int
__rep_send_message(env,eid,rtype,lsnp,dbtp,logflags,repflags)305 __rep_send_message(env, eid, rtype, lsnp, dbtp, logflags, repflags)
306 ENV *env;
307 int eid;
308 u_int32_t rtype;
309 DB_LSN *lsnp;
310 const DBT *dbtp;
311 u_int32_t logflags, repflags;
312 {
313 COMPQUIET(eid, 0);
314 COMPQUIET(rtype, 0);
315 COMPQUIET(lsnp, NULL);
316 COMPQUIET(dbtp, NULL);
317 COMPQUIET(logflags, 0);
318 COMPQUIET(repflags, 0);
319 return (__db_norep(env));
320 }
321
322 int
__rep_set_limit(dbenv,gbytes,bytes)323 __rep_set_limit(dbenv, gbytes, bytes)
324 DB_ENV *dbenv;
325 u_int32_t gbytes, bytes;
326 {
327 COMPQUIET(gbytes, 0);
328 COMPQUIET(bytes, 0);
329 return (__db_norep(dbenv->env));
330 }
331
332 int
__rep_set_transport_pp(dbenv,eid,f_send)333 __rep_set_transport_pp(dbenv, eid, f_send)
334 DB_ENV *dbenv;
335 int eid;
336 int (*f_send) __P((DB_ENV *, const DBT *, const DBT *, const DB_LSN *,
337 int, u_int32_t));
338 {
339 COMPQUIET(eid, 0);
340 COMPQUIET(f_send, NULL);
341 return (__db_norep(dbenv->env));
342 }
343
344 int
__rep_set_view(dbenv,f_partial)345 __rep_set_view(dbenv, f_partial)
346 DB_ENV *dbenv;
347 int (*f_partial) __P((DB_ENV *,
348 const char *, int *, u_int32_t));
349 {
350 COMPQUIET(f_partial, NULL);
351 return (__db_norep(dbenv->env));
352 }
353
354 int
__rep_set_request(dbenv,min,max)355 __rep_set_request(dbenv, min, max)
356 DB_ENV *dbenv;
357 u_int32_t min, max;
358 {
359 COMPQUIET(min, 0);
360 COMPQUIET(max, 0);
361 return (__db_norep(dbenv->env));
362 }
363
364 int
__rep_get_request(dbenv,minp,maxp)365 __rep_get_request(dbenv, minp, maxp)
366 DB_ENV *dbenv;
367 u_int32_t *minp, *maxp;
368 {
369 COMPQUIET(minp, NULL);
370 COMPQUIET(maxp, NULL);
371 return (__db_norep(dbenv->env));
372 }
373
374 int
__rep_start_pp(dbenv,dbt,flags)375 __rep_start_pp(dbenv, dbt, flags)
376 DB_ENV *dbenv;
377 DBT *dbt;
378 u_int32_t flags;
379 {
380 COMPQUIET(dbt, NULL);
381 COMPQUIET(flags, 0);
382 return (__db_norep(dbenv->env));
383 }
384
385 int
__rep_stat_pp(dbenv,statp,flags)386 __rep_stat_pp(dbenv, statp, flags)
387 DB_ENV *dbenv;
388 DB_REP_STAT **statp;
389 u_int32_t flags;
390 {
391 COMPQUIET(statp, NULL);
392 COMPQUIET(flags, 0);
393 return (__db_norep(dbenv->env));
394 }
395
396 int
__rep_stat_print_pp(dbenv,flags)397 __rep_stat_print_pp(dbenv, flags)
398 DB_ENV *dbenv;
399 u_int32_t flags;
400 {
401 COMPQUIET(flags, 0);
402 return (__db_norep(dbenv->env));
403 }
404
405 int
__rep_stat_print(env,flags)406 __rep_stat_print(env, flags)
407 ENV *env;
408 u_int32_t flags;
409 {
410 COMPQUIET(flags, 0);
411 return (__db_norep(env));
412 }
413
414 int
__rep_sync(dbenv,flags)415 __rep_sync(dbenv, flags)
416 DB_ENV *dbenv;
417 u_int32_t flags;
418 {
419 COMPQUIET(flags, 0);
420 return (__db_norep(dbenv->env));
421 }
422
423 int
__rep_txn_applied(env,ip,commit_info,timeout)424 __rep_txn_applied(env, ip, commit_info, timeout)
425 ENV *env;
426 DB_THREAD_INFO *ip;
427 DB_COMMIT_INFO *commit_info;
428 db_timeout_t timeout;
429 {
430 COMPQUIET(ip, 0);
431 COMPQUIET(commit_info, NULL);
432 COMPQUIET(timeout, 0);
433 return (__db_norep(env));
434 }
435
436 size_t
__rep_object_size(env)437 __rep_object_size(env)
438 ENV *env;
439 {
440 COMPQUIET(env, NULL);
441 return (0);
442 }
443
444 size_t
__rep_object_max(env)445 __rep_object_max(env)
446 ENV *env;
447 {
448 COMPQUIET(env, NULL);
449 return (0);
450 }
451 #endif /* !HAVE_REPLICATION */
452