From 719d82a74b07fad03148bbc34fdadcf8a42a9f07 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 3 Aug 2007 00:56:46 +0000 Subject: [PATCH] Work around recent Fedora change that makes "open" a macro name --- mysql-bdb-open.patch | 619 +++++++++++++++++++++++++++++++++++++++++++ mysql.spec | 3 + 2 files changed, 622 insertions(+) create mode 100644 mysql-bdb-open.patch diff --git a/mysql-bdb-open.patch b/mysql-bdb-open.patch new file mode 100644 index 0000000..4985f7a --- /dev/null +++ b/mysql-bdb-open.patch @@ -0,0 +1,619 @@ +Work around recent Fedora change that makes "open" a macro name. + +Unlikely that upstream would consider fixing this since they're deprecating +BDB anyway. At some point we should probably just remove --with-berkeley-db +from our configuration, but I'll hold the line a little longer. + + +diff -Naur mysql-5.0.45.orig/bdb/db/db.c mysql-5.0.45/bdb/db/db.c +--- mysql-5.0.45.orig/bdb/db/db.c 2007-07-04 09:06:08.000000000 -0400 ++++ mysql-5.0.45/bdb/db/db.c 2007-08-02 20:22:31.000000000 -0400 +@@ -431,7 +431,7 @@ + dbenv, 0, dbp->pgsize * DB_MINPAGECACHE, 0)) != 0) + return (ret); + +- if ((ret = dbenv->open(dbenv, NULL, DB_CREATE | ++ if ((ret = dbenv->open_(dbenv, NULL, DB_CREATE | + DB_INIT_MPOOL | DB_PRIVATE | LF_ISSET(DB_THREAD), 0)) != 0) + return (ret); + } +@@ -517,7 +517,7 @@ + pgcookie.size = sizeof(DB_PGINFO); + (void)mpf->set_pgcookie(mpf, &pgcookie); + +- if ((ret = mpf->open(mpf, name, ++ if ((ret = mpf->open_(mpf, name, + LF_ISSET(DB_RDONLY | DB_NOMMAP | DB_ODDFILESIZE | DB_TRUNCATE) | + (F_ISSET(dbenv, DB_ENV_DIRECT_DB) ? DB_DIRECT : 0), + 0, dbp->pgsize)) != 0) +diff -Naur mysql-5.0.45.orig/bdb/db/db_method.c mysql-5.0.45/bdb/db/db_method.c +--- mysql-5.0.45.orig/bdb/db/db_method.c 2007-07-04 09:05:56.000000000 -0400 ++++ mysql-5.0.45/bdb/db/db_method.c 2007-08-02 20:22:31.000000000 -0400 +@@ -168,7 +168,7 @@ + dbp->get_type = __db_get_type; + dbp->join = __db_join; + dbp->key_range = __db_key_range; +- dbp->open = __db_open; ++ dbp->open_ = __db_open; + dbp->pget = __db_pget; + dbp->put = __db_put; + dbp->remove = __db_remove; +diff -Naur mysql-5.0.45.orig/bdb/db/db_vrfyutil.c mysql-5.0.45/bdb/db/db_vrfyutil.c +--- mysql-5.0.45.orig/bdb/db/db_vrfyutil.c 2007-07-04 09:05:39.000000000 -0400 ++++ mysql-5.0.45/bdb/db/db_vrfyutil.c 2007-08-02 20:22:31.000000000 -0400 +@@ -61,7 +61,7 @@ + goto err; + + if ((ret = +- cdbp->open(cdbp, NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) ++ cdbp->open_(cdbp, NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) + goto err; + + if ((ret = db_create(&pgdbp, dbenv, 0)) != 0) +@@ -70,7 +70,7 @@ + if ((ret = pgdbp->set_pagesize(pgdbp, pgsize)) != 0) + goto err; + +- if ((ret = pgdbp->open(pgdbp, ++ if ((ret = pgdbp->open_(pgdbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) + goto err; + +@@ -284,7 +284,7 @@ + return (ret); + if ((ret = dbp->set_pagesize(dbp, pgsize)) != 0) + goto err; +- if ((ret = dbp->open(dbp, ++ if ((ret = dbp->open_(dbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) == 0) + *dbpp = dbp; + else +@@ -648,7 +648,7 @@ + if ((ret = dbp->set_pagesize(dbp, 1024)) != 0) + goto err; + +- if ((ret = dbp->open(dbp, ++ if ((ret = dbp->open_(dbp, + NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0)) != 0) + goto err; + +diff -Naur mysql-5.0.45.orig/bdb/db_archive/db_archive.c mysql-5.0.45/bdb/db_archive/db_archive.c +--- mysql-5.0.45.orig/bdb/db_archive/db_archive.c 2007-07-04 09:06:10.000000000 -0400 ++++ mysql-5.0.45/bdb/db_archive/db_archive.c 2007-08-02 20:22:31.000000000 -0400 +@@ -116,9 +116,9 @@ + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ +- if ((ret = dbenv->open(dbenv, ++ if ((ret = dbenv->open_(dbenv, + home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && +- (ret = dbenv->open(dbenv, home, DB_CREATE | ++ (ret = dbenv->open_(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +diff -Naur mysql-5.0.45.orig/bdb/db_checkpoint/db_checkpoint.c mysql-5.0.45/bdb/db_checkpoint/db_checkpoint.c +--- mysql-5.0.45.orig/bdb/db_checkpoint/db_checkpoint.c 2007-07-04 09:06:16.000000000 -0400 ++++ mysql-5.0.45/bdb/db_checkpoint/db_checkpoint.c 2007-08-02 20:22:31.000000000 -0400 +@@ -155,7 +155,7 @@ + goto shutdown; + } + /* Initialize the environment. */ +- if ((ret = dbenv->open(dbenv, ++ if ((ret = dbenv->open_(dbenv, + home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +diff -Naur mysql-5.0.45.orig/bdb/db_deadlock/db_deadlock.c mysql-5.0.45/bdb/db_deadlock/db_deadlock.c +--- mysql-5.0.45.orig/bdb/db_deadlock/db_deadlock.c 2007-07-04 09:06:57.000000000 -0400 ++++ mysql-5.0.45/bdb/db_deadlock/db_deadlock.c 2007-08-02 20:22:31.000000000 -0400 +@@ -161,7 +161,7 @@ + } + + /* An environment is required. */ +- if ((ret = dbenv->open(dbenv, home, ++ if ((ret = dbenv->open_(dbenv, home, + DB_JOINENV | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +diff -Naur mysql-5.0.45.orig/bdb/db_dump/db_dump.c mysql-5.0.45/bdb/db_dump/db_dump.c +--- mysql-5.0.45.orig/bdb/db_dump/db_dump.c 2007-07-04 09:06:56.000000000 -0400 ++++ mysql-5.0.45/bdb/db_dump/db_dump.c 2007-08-02 20:22:31.000000000 -0400 +@@ -204,7 +204,7 @@ + goto done; + } + +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = dbp->open_(dbp, NULL, + argv[0], subname, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "open: %s", argv[0]); + goto err; +@@ -303,7 +303,7 @@ + * before we create our own. + */ + *is_privatep = 0; +- if (dbenv->open(dbenv, home, ++ if (dbenv->open_(dbenv, home, + DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : DB_JOINENV), 0) == 0) + return (0); + +@@ -319,7 +319,7 @@ + */ + *is_privatep = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) == 0 && +- (ret = dbenv->open(dbenv, home, ++ (ret = dbenv->open_(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0) + return (0); + +@@ -411,7 +411,7 @@ + free(subdb); + return (1); + } +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = dbp->open_(dbp, NULL, + parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) + dbp->err(dbp, ret, + "DB->open: %s:%s", parent_name, subdb); +diff -Naur mysql-5.0.45.orig/bdb/db_load/db_load.c mysql-5.0.45/bdb/db_load/db_load.c +--- mysql-5.0.45.orig/bdb/db_load/db_load.c 2007-07-04 09:05:56.000000000 -0400 ++++ mysql-5.0.45/bdb/db_load/db_load.c 2007-08-02 20:22:31.000000000 -0400 +@@ -329,7 +329,7 @@ + } + + /* Open the DB file. */ +- if ((ret = dbp->open(dbp, NULL, name, subdb, dbtype, ++ if ((ret = dbp->open_(dbp, NULL, name, subdb, dbtype, + DB_CREATE | (TXN_ON(dbenv) ? DB_AUTO_COMMIT : 0), + __db_omode("rwrwrw"))) != 0) { + dbp->err(dbp, ret, "DB->open: %s", name); +@@ -517,7 +517,7 @@ + /* We may be loading into a live environment. Try and join. */ + flags = DB_USE_ENVIRON | + DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; +- if (dbenv->open(dbenv, home, flags, 0) == 0) ++ if (dbenv->open_(dbenv, home, flags, 0) == 0) + return (0); + + /* +@@ -539,7 +539,7 @@ + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } +- if ((ret = dbenv->open(dbenv, home, flags, 0)) == 0) ++ if ((ret = dbenv->open_(dbenv, home, flags, 0)) == 0) + return (0); + + /* An environment is required. */ +diff -Naur mysql-5.0.45.orig/bdb/db_printlog/db_printlog.c mysql-5.0.45/bdb/db_printlog/db_printlog.c +--- mysql-5.0.45.orig/bdb/db_printlog/db_printlog.c 2007-07-04 09:06:08.000000000 -0400 ++++ mysql-5.0.45/bdb/db_printlog/db_printlog.c 2007-08-02 20:22:31.000000000 -0400 +@@ -156,17 +156,17 @@ + * with logging, because we don't want to log the opens. + */ + if (repflag) { +- if ((ret = dbenv->open(dbenv, home, ++ if ((ret = dbenv->open_(dbenv, home, + DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 && +- (ret = dbenv->open(dbenv, home, ++ (ret = dbenv->open_(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) + != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } +- } else if ((ret = dbenv->open(dbenv, home, ++ } else if ((ret = dbenv->open_(dbenv, home, + DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && +- (ret = dbenv->open(dbenv, home, ++ (ret = dbenv->open_(dbenv, home, + DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +@@ -342,7 +342,7 @@ + + dbp = *dbpp; + if ((ret = +- dbp->open(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) { ++ dbp->open_(dbp, NULL, "__db.rep.db", NULL, DB_BTREE, 0, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open"); + goto err; + } +diff -Naur mysql-5.0.45.orig/bdb/db_recover/db_recover.c mysql-5.0.45/bdb/db_recover/db_recover.c +--- mysql-5.0.45.orig/bdb/db_recover/db_recover.c 2007-07-04 09:06:40.000000000 -0400 ++++ mysql-5.0.45/bdb/db_recover/db_recover.c 2007-08-02 20:22:31.000000000 -0400 +@@ -150,7 +150,7 @@ + DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON); + LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER); + LF_SET(retain_env ? 0 : DB_PRIVATE); +- if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { ++ if ((ret = dbenv->open_(dbenv, home, flags, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; + } +diff -Naur mysql-5.0.45.orig/bdb/db_stat/db_stat.c mysql-5.0.45/bdb/db_stat/db_stat.c +--- mysql-5.0.45.orig/bdb/db_stat/db_stat.c 2007-07-04 09:06:09.000000000 -0400 ++++ mysql-5.0.45/bdb/db_stat/db_stat.c 2007-08-02 20:22:31.000000000 -0400 +@@ -245,7 +245,7 @@ + } + d_close = 1; + +- if ((ret = dbp->open(dbp, ++ if ((ret = dbp->open_(dbp, + NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "DB->open: %s", db); + goto shutdown; +@@ -287,7 +287,7 @@ + dbenv->err(dbenv, ret, "db_create"); + goto shutdown; + } +- if ((ret = dbp->open(alt_dbp, NULL, ++ if ((ret = dbp->open_(alt_dbp, NULL, + db, subdb, DB_UNKNOWN, 0, 0)) != 0) { + dbenv->err(dbenv, + ret, "DB->open: %s:%s", db, subdb); +@@ -1187,7 +1187,7 @@ + */ + *is_private = 0; + if ((ret = +- dbenv->open(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) ++ dbenv->open_(dbenv, home, DB_JOINENV | DB_USE_ENVIRON, 0)) == 0) + return (0); + if (ttype != T_DB && ttype != T_LOG) { + dbenv->err(dbenv, ret, "DB_ENV->open%s%s", +@@ -1215,7 +1215,7 @@ + oflags |= DB_INIT_MPOOL; + if (ttype == T_LOG) + oflags |= DB_INIT_LOG; +- if ((ret = dbenv->open(dbenv, home, oflags, 0)) == 0) ++ if ((ret = dbenv->open_(dbenv, home, oflags, 0)) == 0) + return (0); + + /* An environment is required. */ +diff -Naur mysql-5.0.45.orig/bdb/db_upgrade/db_upgrade.c mysql-5.0.45/bdb/db_upgrade/db_upgrade.c +--- mysql-5.0.45.orig/bdb/db_upgrade/db_upgrade.c 2007-07-04 09:06:09.000000000 -0400 ++++ mysql-5.0.45/bdb/db_upgrade/db_upgrade.c 2007-08-02 20:22:31.000000000 -0400 +@@ -121,9 +121,9 @@ + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ +- if ((ret = dbenv->open(dbenv, ++ if ((ret = dbenv->open_(dbenv, + home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 && +- (ret = dbenv->open(dbenv, home, ++ (ret = dbenv->open_(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +diff -Naur mysql-5.0.45.orig/bdb/db_verify/db_verify.c mysql-5.0.45/bdb/db_verify/db_verify.c +--- mysql-5.0.45.orig/bdb/db_verify/db_verify.c 2007-07-04 09:06:26.000000000 -0400 ++++ mysql-5.0.45/bdb/db_verify/db_verify.c 2007-08-02 20:22:31.000000000 -0400 +@@ -129,13 +129,13 @@ + */ + private = 0; + if ((ret = +- dbenv->open(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { ++ dbenv->open_(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { + dbenv->err(dbenv, ret, "set_cachesize"); + goto shutdown; + } + private = 1; +- if ((ret = dbenv->open(dbenv, home, ++ if ((ret = dbenv->open_(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; +@@ -160,7 +160,7 @@ + goto shutdown; + } + +- if ((ret = dbp1->open(dbp1, NULL, ++ if ((ret = dbp1->open_(dbp1, NULL, + argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open: %s", argv[0]); + (void)dbp1->close(dbp1, 0); +diff -Naur mysql-5.0.45.orig/bdb/dbinc/db.in mysql-5.0.45/bdb/dbinc/db.in +--- mysql-5.0.45.orig/bdb/dbinc/db.in 2007-07-04 09:06:33.000000000 -0400 ++++ mysql-5.0.45/bdb/dbinc/db.in 2007-08-02 20:00:58.000000000 -0400 +@@ -187,10 +187,10 @@ + * interface specific flags in this range. + * + * DB_AUTO_COMMIT: +- * DB_ENV->set_flags, DB->associate, DB->del, DB->put, DB->open, ++ * DB_ENV->set_flags, DB->associate, DB->del, DB->put, DB->open_, + * DB->remove, DB->rename, DB->truncate + * DB_DIRTY_READ: +- * DB->cursor, DB->get, DB->join, DB->open, DBcursor->c_get, ++ * DB->cursor, DB->get, DB->join, DB->open_, DBcursor->c_get, + * DB_ENV->txn_begin + * + * Shared flags up to 0x000400 */ +@@ -208,7 +208,7 @@ + #define DB_XA_CREATE 0x000001 /* Open in an XA environment. */ + + /* +- * Flags private to DB_ENV->open. ++ * Flags private to DB_ENV->open_. + * Shared flags up to 0x000400 */ + #define DB_INIT_CDB 0x000800 /* Concurrent Access Methods. */ + #define DB_INIT_LOCK 0x001000 /* Initialize locking. */ +@@ -222,7 +222,7 @@ + #define DB_SYSTEM_MEM 0x100000 /* Use system-backed memory. */ + + /* +- * Flags private to DB->open. ++ * Flags private to DB->open_. + * Shared flags up to 0x000400 */ + #define DB_EXCL 0x000800 /* Exclusive open (O_EXCL). */ + #define DB_FCNTL_LOCKING 0x001000 /* UNDOC: fcntl(2) locking. */ +@@ -261,7 +261,7 @@ + #define DB_VERIFY 0x000002 /* Verifying. */ + + /* +- * Flags private to DB_MPOOLFILE->open. ++ * Flags private to DB_MPOOLFILE->open_. + * Shared flags up to 0x000400 */ + #define DB_DIRECT 0x000800 /* Don't buffer the file in the OS. */ + #define DB_EXTENT 0x001000 /* UNDOC: dealing with an extent. */ +@@ -614,7 +614,7 @@ + int (*get) __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); + void (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *)); + void (*last_pgno) __P((DB_MPOOLFILE *, db_pgno_t *)); +- int (*open)__P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t)); ++ int (*open_)__P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t)); + int (*put) __P((DB_MPOOLFILE *, void *, u_int32_t)); + void (*refcnt) __P((DB_MPOOLFILE *, db_pgno_t *)); + int (*set) __P((DB_MPOOLFILE *, void *, u_int32_t)); +@@ -1079,10 +1079,10 @@ + * Some applications use DB but implement their own locking outside of + * DB. If they're using fcntl(2) locking on the underlying database + * file, and we open and close a file descriptor for that file, we will +- * discard their locks. The DB_FCNTL_LOCKING flag to DB->open is an ++ * discard their locks. The DB_FCNTL_LOCKING flag to DB->open_ is an + * undocumented interface to support this usage which leaves any file + * descriptors we open until DB->close. This will only work with the +- * DB->open interface and simple caches, e.g., creating a transaction ++ * DB->open_ interface and simple caches, e.g., creating a transaction + * thread may open/close file descriptors this flag doesn't protect. + * Locking with fcntl(2) on a file that you don't own is a very, very + * unsafe thing to do. 'Nuff said. +@@ -1186,7 +1186,7 @@ + int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); + int (*key_range) __P((DB *, + DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)); +- int (*open) __P((DB *, DB_TXN *, ++ int (*open_) __P((DB *, DB_TXN *, + const char *, const char *, DBTYPE, u_int32_t, int)); + int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); + int (*remove) __P((DB *, const char *, const char *, u_int32_t)); +@@ -1266,7 +1266,7 @@ + #define DB_AM_FIXEDLEN 0x00001000 /* Fixed-length records. */ + #define DB_AM_INMEM 0x00002000 /* In-memory; no sync on close. */ + #define DB_AM_IN_RENAME 0x00004000 /* File is being renamed. */ +-#define DB_AM_OPEN_CALLED 0x00008000 /* DB->open called. */ ++#define DB_AM_OPEN_CALLED 0x00008000 /* DB->open_ called. */ + #define DB_AM_PAD 0x00010000 /* Fixed-length record pad. */ + #define DB_AM_PGDEF 0x00020000 /* Page size was defaulted. */ + #define DB_AM_RDONLY 0x00040000 /* Database is readonly. */ +@@ -1653,7 +1653,7 @@ + const char *, const char *, const char *, u_int32_t)); + void (*err) __P((const DB_ENV *, int, const char *, ...)); + void (*errx) __P((const DB_ENV *, const char *, ...)); +- int (*open) __P((DB_ENV *, const char *, u_int32_t, int)); ++ int (*open_) __P((DB_ENV *, const char *, u_int32_t, int)); + int (*remove) __P((DB_ENV *, const char *, u_int32_t)); + int (*set_data_dir) __P((DB_ENV *, const char *)); + int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), +@@ -1777,7 +1777,7 @@ + #define DB_ENV_NOLOCKING 0x0000200 /* DB_NOLOCKING set. */ + #define DB_ENV_NOMMAP 0x0000400 /* DB_NOMMAP set. */ + #define DB_ENV_NOPANIC 0x0000800 /* Okay if panic set. */ +-#define DB_ENV_OPEN_CALLED 0x0001000 /* DB_ENV->open called. */ ++#define DB_ENV_OPEN_CALLED 0x0001000 /* DB_ENV->open_ called. */ + #define DB_ENV_OVERWRITE 0x0002000 /* DB_OVERWRITE set. */ + #define DB_ENV_PRIVATE 0x0004000 /* DB_PRIVATE set. */ + #define DB_ENV_REGION_INIT 0x0008000 /* DB_REGION_INIT set. */ +diff -Naur mysql-5.0.45.orig/bdb/dbm/dbm.c mysql-5.0.45/bdb/dbm/dbm.c +--- mysql-5.0.45.orig/bdb/dbm/dbm.c 2007-07-04 09:06:27.000000000 -0400 ++++ mysql-5.0.45/bdb/dbm/dbm.c 2007-08-02 20:22:31.000000000 -0400 +@@ -240,7 +240,7 @@ + if ((ret = dbp->set_pagesize(dbp, 4096)) != 0 || + (ret = dbp->set_h_ffactor(dbp, 40)) != 0 || + (ret = dbp->set_h_nelem(dbp, 1)) != 0 || +- (ret = dbp->open(dbp, NULL, ++ (ret = dbp->open_(dbp, NULL, + path, NULL, DB_HASH, __db_oflags(oflags), mode)) != 0) { + __os_set_errno(ret); + return (NULL); +diff -Naur mysql-5.0.45.orig/bdb/env/env_method.c mysql-5.0.45/bdb/env/env_method.c +--- mysql-5.0.45.orig/bdb/env/env_method.c 2007-07-04 09:05:37.000000000 -0400 ++++ mysql-5.0.45/bdb/env/env_method.c 2007-08-02 20:22:31.000000000 -0400 +@@ -161,7 +161,7 @@ + dbenv->close = __dbenv_close; + dbenv->dbremove = __dbenv_dbremove; + dbenv->dbrename = __dbenv_dbrename; +- dbenv->open = __dbenv_open; ++ dbenv->open_ = __dbenv_open; + dbenv->remove = __dbenv_remove; + dbenv->set_alloc = __dbenv_set_alloc; + dbenv->set_app_dispatch = __dbenv_set_app_dispatch; +diff -Naur mysql-5.0.45.orig/bdb/hsearch/hsearch.c mysql-5.0.45/bdb/hsearch/hsearch.c +--- mysql-5.0.45.orig/bdb/hsearch/hsearch.c 2007-07-04 09:05:34.000000000 -0400 ++++ mysql-5.0.45/bdb/hsearch/hsearch.c 2007-08-02 20:22:31.000000000 -0400 +@@ -84,7 +84,7 @@ + if ((ret = dbp->set_pagesize(dbp, 512)) != 0 || + (ret = dbp->set_h_ffactor(dbp, 16)) != 0 || + (ret = dbp->set_h_nelem(dbp, (u_int32_t)nel)) != 0 || +- (ret = dbp->open(dbp, ++ (ret = dbp->open_(dbp, + NULL, NULL, NULL, DB_HASH, DB_CREATE, __db_omode("rw----"))) != 0) + __os_set_errno(ret); + +diff -Naur mysql-5.0.45.orig/bdb/mp/mp_fopen.c mysql-5.0.45/bdb/mp/mp_fopen.c +--- mysql-5.0.45.orig/bdb/mp/mp_fopen.c 2007-07-04 09:06:04.000000000 -0400 ++++ mysql-5.0.45/bdb/mp/mp_fopen.c 2007-08-02 20:22:31.000000000 -0400 +@@ -86,7 +86,7 @@ + dbmfp->get = __memp_fget; + dbmfp->get_fileid = __memp_get_fileid; + dbmfp->last_pgno = __memp_last_pgno; +- dbmfp->open = __memp_fopen; ++ dbmfp->open_ = __memp_fopen; + dbmfp->put = __memp_fput; + dbmfp->refcnt = __memp_refcnt; + dbmfp->set = __memp_fset; +diff -Naur mysql-5.0.45.orig/bdb/qam/qam_files.c mysql-5.0.45/bdb/qam/qam_files.c +--- mysql-5.0.45.orig/bdb/qam/qam_files.c 2007-07-04 09:06:26.000000000 -0400 ++++ mysql-5.0.45/bdb/qam/qam_files.c 2007-08-02 20:22:31.000000000 -0400 +@@ -207,7 +207,7 @@ + openflags |= DB_RDONLY; + if (F_ISSET(dbenv, DB_ENV_DIRECT_DB)) + openflags |= DB_DIRECT; +- if ((ret = mpf->open( ++ if ((ret = mpf->open_( + mpf, buf, openflags, qp->mode, dbp->pgsize)) != 0) { + array->mpfarray[offset].mpf = NULL; + (void)mpf->close(mpf, 0); +diff -Naur mysql-5.0.45.orig/bdb/qam/qam_method.c mysql-5.0.45/bdb/qam/qam_method.c +--- mysql-5.0.45.orig/bdb/qam/qam_method.c 2007-07-04 09:05:55.000000000 -0400 ++++ mysql-5.0.45/bdb/qam/qam_method.c 2007-08-02 20:22:31.000000000 -0400 +@@ -260,7 +260,7 @@ + */ + if (txn == NULL) + needclose = 1; +- if ((ret = tmpdbp->open(tmpdbp, ++ if ((ret = tmpdbp->open_(tmpdbp, + txn, name, NULL, DB_QUEUE, 0, 0)) != 0) + goto err; + needclose = 1; +@@ -362,7 +362,7 @@ + /* Copy the incoming locker so we don't self-deadlock. */ + tmpdbp->lid = dbp->lid; + needclose = 1; +- if ((ret = tmpdbp->open(tmpdbp, txn, filename, NULL, ++ if ((ret = tmpdbp->open_(tmpdbp, txn, filename, NULL, + DB_QUEUE, 0, 0)) != 0) + goto err; + } +diff -Naur mysql-5.0.45.orig/bdb/rep/rep_method.c mysql-5.0.45/bdb/rep/rep_method.c +--- mysql-5.0.45.orig/bdb/rep/rep_method.c 2007-07-04 09:05:35.000000000 -0400 ++++ mysql-5.0.45/bdb/rep/rep_method.c 2007-08-02 20:22:31.000000000 -0400 +@@ -327,7 +327,7 @@ + + flags = (F_ISSET(dbenv, DB_ENV_THREAD) ? DB_THREAD : 0) | + (startup ? DB_CREATE : 0); +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = dbp->open_(dbp, NULL, + "__db.rep.db", NULL, DB_BTREE, flags, 0)) != 0) + goto err; + +diff -Naur mysql-5.0.45.orig/bdb/xa/xa.c mysql-5.0.45/bdb/xa/xa.c +--- mysql-5.0.45.orig/bdb/xa/xa.c 2007-07-04 09:06:41.000000000 -0400 ++++ mysql-5.0.45/bdb/xa/xa.c 2007-08-02 20:22:31.000000000 -0400 +@@ -97,7 +97,7 @@ + DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN + if (db_env_create(&env, 0) != 0) + return (XAER_RMERR); +- if (env->open(env, xa_info, XA_FLAGS, 0) != 0) ++ if (env->open_(env, xa_info, XA_FLAGS, 0) != 0) + goto err; + + /* Create the mapping. */ +diff -Naur mysql-5.0.45.orig/bdb/xa/xa_db.c mysql-5.0.45/bdb/xa/xa_db.c +--- mysql-5.0.45.orig/bdb/xa/xa_db.c 2007-07-04 09:06:26.000000000 -0400 ++++ mysql-5.0.45/bdb/xa/xa_db.c 2007-08-02 20:22:31.000000000 -0400 +@@ -32,7 +32,7 @@ + int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); + int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); + int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); +- int (*open) __P((DB *, DB_TXN *, ++ int (*open_) __P((DB *, DB_TXN *, + const char *, const char *, DBTYPE, u_int32_t, int)); + int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); + } XA_METHODS; +@@ -58,8 +58,8 @@ + return (ret); + + dbp->xa_internal = xam; +- xam->open = dbp->open; +- dbp->open = __xa_open; ++ xam->open_ = dbp->open_; ++ dbp->open_ = __xa_open; + xam->close = dbp->close; + dbp->close = __xa_close; + +@@ -85,7 +85,7 @@ + + xam = (XA_METHODS *)dbp->xa_internal; + +- if ((ret = xam->open(dbp, txn, name, subdb, type, flags, mode)) != 0) ++ if ((ret = xam->open_(dbp, txn, name, subdb, type, flags, mode)) != 0) + return (ret); + + xam->cursor = dbp->cursor; +diff -Naur mysql-5.0.45.orig/sql/ha_berkeley.cc mysql-5.0.45/sql/ha_berkeley.cc +--- mysql-5.0.45.orig/sql/ha_berkeley.cc 2007-07-04 09:06:39.000000000 -0400 ++++ mysql-5.0.45/sql/ha_berkeley.cc 2007-08-02 20:36:06.000000000 -0400 +@@ -192,7 +192,7 @@ + if (berkeley_max_lock) + db_env->set_lk_max(db_env, berkeley_max_lock); + +- if (db_env->open(db_env, ++ if (db_env->open_(db_env, + berkeley_home, + berkeley_init_flags | DB_INIT_LOCK | + DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | +@@ -633,7 +633,7 @@ + if (!hidden_primary_key) + file->app_private= (void*) (table->key_info + table_share->primary_key); + if ((error= txn_begin(db_env, 0, (DB_TXN**) &transaction, 0)) || +- (error= (file->open(file, transaction, ++ (error= (file->open_(file, transaction, + fn_format(name_buff, name, "", ha_berkeley_ext, + 2 | 4), + "main", DB_BTREE, open_mode, 0))) || +@@ -672,7 +672,7 @@ + (*ptr)->set_flags(*ptr, DB_DUP); + } + if ((error= txn_begin(db_env, 0, (DB_TXN**) &transaction, 0)) || +- (error=((*ptr)->open(*ptr, transaction, name_buff, part, DB_BTREE, ++ (error=((*ptr)->open_(*ptr, transaction, name_buff, part, DB_BTREE, + open_mode, 0))) || + (error= transaction->commit(transaction, 0))) + { +@@ -1996,7 +1996,7 @@ + if (!(error=db_create(&file, db_env, 0))) + { + file->set_flags(file, flags); +- error=(file->open(file, NULL, table_name, sub_name, type, ++ error=(file->open_(file, NULL, table_name, sub_name, type, + DB_THREAD | DB_CREATE, my_umask)); + if (error) + { +@@ -2052,7 +2052,7 @@ + DB *status_block; + if (!(error=(db_create(&status_block, db_env, 0)))) + { +- if (!(error=(status_block->open(status_block, NULL, name_buff, ++ if (!(error=(status_block->open_(status_block, NULL, name_buff, + "status", DB_BTREE, DB_CREATE, 0)))) + { + char rec_buff[4+MAX_KEY*4]; +@@ -2529,7 +2529,7 @@ + fn_format(name_buff, share->table_name,"", ha_berkeley_ext, 2 | 4); + if (!db_create(&share->status_block, db_env, 0)) + { +- if (share->status_block->open(share->status_block, NULL, name_buff, ++ if (share->status_block->open_(share->status_block, NULL, name_buff, + "status", DB_BTREE, open_mode, 0)) + { + share->status_block->close(share->status_block, 0); /* purecov: inspected */ +@@ -2606,7 +2606,7 @@ + if (db_create(&share->status_block, db_env, 0)) /* purecov: inspected */ + goto end; /* purecov: inspected */ + share->status_block->set_flags(share->status_block,0); /* purecov: inspected */ +- if (share->status_block->open(share->status_block, NULL, ++ if (share->status_block->open_(share->status_block, NULL, + fn_format(name_buff,share->table_name,"", + ha_berkeley_ext,2 | 4), + "status", DB_BTREE, diff --git a/mysql.spec b/mysql.spec index c812800..2496e98 100644 --- a/mysql.spec +++ b/mysql.spec @@ -25,6 +25,7 @@ Patch6: mysql-rpl_ddl.patch Patch7: mysql-rpl-test.patch Patch8: mysql-install-test.patch Patch9: mysql-bdb-link.patch +Patch10: mysql-bdb-open.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gperf, perl, readline-devel, openssl-devel @@ -127,6 +128,7 @@ the MySQL sources. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 libtoolize --force aclocal @@ -470,6 +472,7 @@ fi %changelog * Thu Aug 2 2007 Tom Lane 5.0.45-2 - Update License tag to match code. +- Work around recent Fedora change that makes "open" a macro name. * Sun Jul 22 2007 Tom Lane 5.0.45-1 - Update to MySQL 5.0.45