slackbuilds_ponce/libraries/db46/patches/patch.4.6.21.3
2010-05-12 23:30:06 +02:00

53 lines
1.5 KiB
Groff

*** 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;