1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
*** sequence/sequence.c.orig 2007-05-17 10:18:04.000000000 -0700
--- sequence/sequence.c 2008-08-14 12:24:23.000000000 -0700
***************
*** 252,257 ****
--- 252,262 ----
if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
!LF_ISSET(DB_CREATE))
goto err;
+ if (IS_REP_CLIENT(dbenv) &&
+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+ ret = __db_rdonly(dbenv, "DB_SEQUENCE->open");
+ goto err;
+ }
ret = 0;
rp = &seq->seq_record;
***************
*** 304,310 ****
*/
rp = seq->seq_data.data;
if (rp->seq_version == DB_SEQUENCE_OLDVER) {
! oldver: rp->seq_version = DB_SEQUENCE_VERSION;
if (__db_isbigendian()) {
if (IS_DB_AUTO_COMMIT(dbp, txn)) {
if ((ret =
--- 309,320 ----
*/
rp = seq->seq_data.data;
if (rp->seq_version == DB_SEQUENCE_OLDVER) {
! oldver: if (IS_REP_CLIENT(dbenv) &&
! !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
! ret = __db_rdonly(dbenv, "DB_SEQUENCE->open");
! goto err;
! }
! rp->seq_version = DB_SEQUENCE_VERSION;
if (__db_isbigendian()) {
if (IS_DB_AUTO_COMMIT(dbp, txn)) {
if ((ret =
***************
*** 713,718 ****
--- 723,734 ----
MUTEX_LOCK(dbenv, seq->mtx_seq);
+ if (handle_check && IS_REP_CLIENT(dbenv) &&
+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+ ret = __db_rdonly(dbenv, "DB_SEQUENCE->get");
+ goto err;
+ }
+
if (rp->seq_min + delta > rp->seq_max) {
__db_errx(dbenv, "Sequence overflow");
ret = EINVAL;
|