diff options
author | unknown <jimw@mysql.com> | 2005-07-20 18:08:13 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-07-20 18:08:13 -0700 |
commit | 3c7def8e5056053e46d367f4f8b10979f8c39078 (patch) | |
tree | 324ddb9f3128cf72e57743bc3bbe099a7636e4cc /storage | |
parent | 47d10d0ecaf0123676676d4cf480e8f2e35b1b1d (diff) | |
download | mariadb-git-3c7def8e5056053e46d367f4f8b10979f8c39078.tar.gz |
Update ha_berkeley.cc to handle BDB 4.3.28, and re-add two features to
BDB that we require.
sql/ha_berkeley.cc:
Update to BDB 4.3.28 API
storage/bdb/dbinc/db.in:
Add app_private to DBT struct
Add noticecall callback
storage/bdb/env/env_method.c:
Handle setting noticecall callback
storage/bdb/log/log_put.c:
Call noticecall callback when logfile changed
Diffstat (limited to 'storage')
-rw-r--r-- | storage/bdb/dbinc/db.in | 8 | ||||
-rw-r--r-- | storage/bdb/env/env_method.c | 17 | ||||
-rw-r--r-- | storage/bdb/log/log_put.c | 3 |
3 files changed, 28 insertions, 0 deletions
diff --git a/storage/bdb/dbinc/db.in b/storage/bdb/dbinc/db.in index e8e17236c7c..b7913512628 100644 --- a/storage/bdb/dbinc/db.in +++ b/storage/bdb/dbinc/db.in @@ -172,6 +172,8 @@ struct __db_dbt { u_int32_t dlen; /* RO: get/put record length. */ u_int32_t doff; /* RO: get/put record offset. */ + void *app_private; /* Application-private handle. */ + #define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory. */ #define DB_DBT_ISSET 0x002 /* Lower level calls set value. */ #define DB_DBT_MALLOC 0x004 /* Return in malloc'd memory. */ @@ -1734,6 +1736,10 @@ struct __db_qam_stat { *******************************************************/ #define DB_REGION_MAGIC 0x120897 /* Environment magic number. */ +typedef enum { + DB_NOTICE_LOGFILE_CHANGED +} db_notices; + /* Database Environment handle. */ struct __db_env { /******************************************************* @@ -1751,6 +1757,7 @@ struct __db_env { /* Other Callbacks. */ void (*db_feedback) __P((DB_ENV *, int, int)); void (*db_paniccall) __P((DB_ENV *, int)); + void (*db_noticecall) __P((DB_ENV *, db_notices)); /* App-specified alloc functions. */ void *(*db_malloc) __P((size_t)); @@ -1925,6 +1932,7 @@ struct __db_env { int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*get_flags) __P((DB_ENV *, u_int32_t *)); int (*set_flags) __P((DB_ENV *, u_int32_t, int)); + void (*set_noticecall) __P((DB_ENV *, void (*)(DB_ENV *, db_notices))); int (*get_home) __P((DB_ENV *, const char **)); int (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t)); int (*get_open_flags) __P((DB_ENV *, u_int32_t *)); diff --git a/storage/bdb/env/env_method.c b/storage/bdb/env/env_method.c index 4f865061b82..480ee5398d1 100644 --- a/storage/bdb/env/env_method.c +++ b/storage/bdb/env/env_method.c @@ -156,6 +156,7 @@ __dbenv_init(dbenv) dbenv->set_feedback = __dbcl_env_set_feedback; dbenv->get_flags = __dbcl_env_get_flags; dbenv->set_flags = __dbcl_env_flags; + dbenv->set_noticecall = __dbcl_env_noticecall; dbenv->set_paniccall = __dbcl_env_paniccall; dbenv->set_rpc_server = __dbcl_envrpcserver; dbenv->get_shm_key = __dbcl_get_shm_key; @@ -194,6 +195,7 @@ __dbenv_init(dbenv) dbenv->get_flags = __dbenv_get_flags; dbenv->set_flags = __dbenv_set_flags; dbenv->set_intermediate_dir = __dbenv_set_intermediate_dir; + dbenv->set_noticecall = __dbenv_set_noticecall; dbenv->set_paniccall = __dbenv_set_paniccall; dbenv->set_rpc_server = __dbenv_set_rpc_server_noclnt; dbenv->get_shm_key = __dbenv_get_shm_key; @@ -809,6 +811,21 @@ __dbenv_set_msgfile(dbenv, msgfile) } /* + * __dbenv_set_noticecall -- + * {DB_ENV,DB}->set_noticecall. + * + * PUBLIC: int __dbenv_set_noticecall __P((DB_ENV *, void (*)(DB_ENV *, int))); + */ +int +__dbenv_set_noticecall(dbenv, noticecall) + DB_ENV *dbenv; + void (*noticecall) __P((DB_ENV *, int)); +{ + dbenv->db_noticecall = noticecall; + return (0); +} + +/* * __dbenv_set_paniccall -- * {DB_ENV,DB}->set_paniccall. * diff --git a/storage/bdb/log/log_put.c b/storage/bdb/log/log_put.c index 86deffe8641..ea5e33905b8 100644 --- a/storage/bdb/log/log_put.c +++ b/storage/bdb/log/log_put.c @@ -376,6 +376,9 @@ __log_put_next(dbenv, lsn, dbt, hdr, old_lsnp) * anyway. */ newfile = 1; + + if (dbenv->db_noticecall != NULL) + dbenv->db_noticecall(dbenv, DB_NOTICE_LOGFILE_CHANGED); } /* |