Parent Directory
|
Revision Log
| Links to HEAD: | (view) (annotate) |
| Sticky Revision: |
Switch mod_dbd to using APR_STATUS_IS_foo macros in error handling
Fix module scope, to avoid this, copy and past from loadable modules, not core
mod_dbd: add DBDInitSQL command. PR 46827 Patch by Marko Kevac.
* modules/database/mod_dbd.c (dbd_child_init): New function, wrapper around dbd_setup_init. (dbd_hooks): Call dbd_child_init instead of casting dbd_setup_init.
Fix typo in r689224 (thanks rpluem for spotting it)
Try to get a meaningful error message when dbd_open fails
Revert prior change; some of these are registered and therefore the wrong declspec. But why is the question, and this should be reviewed before release.
No. _NONSTD refers to type fn (arg, arg, ...) incomplete declarations
Handle integer configuration directive parameters with a dedicated function, akin to dbd_param_flag(). Only needed when APR_HAS_THREADS.
reverted r553031 since it breaks Linux/Unix platform builds.
changed error message to use APU_DBD_DRIVER_FMT for correct driver name; removed platform ifdefs.
apr_dbd_check_conn() just returns APR_SUCCESS or APR_EGENERAL, so we don't actually have a driver-specific value to pass to apr_dbd_error(), but that's OK because most/all drivers just ignore this value anyway
added proper error message for NetWare.
Introduce configuration groups to allow inheritance by virtual hosts of database configurations from the main server. The post_config hook function determines the minimal set of distinct configurations necessary so that database connection pools are shared between virtual hosts whenever possible. The SQL statements which should be prepared for each database connection are now stored in a hash for each virtual host during the configuration phase, and these hashes are merged in the normal manner using apr_hash_overlay() with that of the main server. This allows for statements to be de-registered by DBDPrepareSQL, if desired. The post_config hook function then compares the statements registered for each virtual host when determining if a separate configuration group is required. The changes in r424798, r432560, r432562, and r466641, which still have problems with configuration inheritance, are therefore no longer necessary.
We now create memory sub-pools for each DB connection and close DB connections in a pool cleanup function. This simplifies the ap_dbd_acquire() and ap_dbd_cacquire() functions, and also stops us from leaking ap_dbd_t structures when using reslists. We ensure that prepared statements are destroyed before their DB connection is closed, in case any drivers would have problems cleaning up prepared statements after the DB connection is closed. The combination of reslists and memory pool cleanup functions was causing segfaults when child processes exited, as reported in PR 39985. To prevent this, we register dbd_destroy() as a cleanup that will execute prior to the internal cleanup function registered by apr_reslist_create(). When the reslist's memory pool is destroyed, dbd_destroy() informs dbd_destruct() not to do anything when subsequently called by the reslist's internal cleanup function. We avoid the use of s->process->pool (the global pool) since it isn't destroyed by exiting child processes in most multi-process MPMs.
Fix several strict compiler warnings for both the threaded and non-threaded versions.
Handle error conditions in dbd_construct() properly. Simplify ap_dbd_open() and use correct arguments to apr_dbd_error() when non-threaded. Register correct cleanup data in non-threaded ap_dbd_acquire() and ap_dbd_cacquire(). Clean up configuration data and merge function. Use ap_log_error() wherever possible.
Rename functions and variables for consistency, and move some functions around for readability, prior to forthcoming functional changes.
Stop mod_dbd emitting bogus error messages when it's loaded but not configured.
* Add the missing include of http_request.h and thus fix a compiler warning.
Stash DBD connections in request_config of initial request only, or else sub-requests and internal redirections may cause entire DBD pool to be stashed in a single HTTP request.
mod_dbd: Key the storage of prepared statements on the hex string value of server_rec, rather than the server name, as the server name may change (eg when the server name is set) at any time, causing weird behaviour in modules dependent on mod_dbd.
Log a message if we try to prepare a statement not attached to a hostname. This fix supplements r432560 (don't crash).
Don't use NULL s->server_hostname as hash lookup key. Reported by paritosh (at limewire.co.in) on dev@httpd (thread Re: apache 2.2 crashes at the start time in mod_dbd.c then preparing AuthDBDUserPWQuery) Fixed by paritosh and Yours Truly.
Remove dependence on server config from ap_dbd_prepare, as that may be called in per-directory config functions where there is no server context causing segfault. Discussion at http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/<831327593.20060720023332%40engec.ru> and subsequent thread.
update license header text
PR#39761 Make the error message more meaningful when DBD is configured without a driver.
PR#39386: Fix merge-config to support prepared statements (Brian J. France)
Log a better error message if initialisation fails on prepared statements.
Improve defaults from 'test' values (and get meaningful errors on startup if database is down); trivial tidyups.
Optional functions are of __cdecl the kind on win32, due to "APU_DECLARE_NONSTD apr_dynamic_fn_register" from apr-util, so we can't use __stdcall. Declare our functions as non-std.
Give DBD a set of _DECLARE macros consistent with other modules, so that _EXPORT and _STATIC and be turned on/off more easily.
PR#37553 Redesign of pools handling in mod_dbd Submitted: Chris Darroch, Reviewed: Nick Kew
Wrap exported functions in AP_DECLARE
Add defaults and comments for better robustness against misuse (based on comments from Chris Darroch).
Fix (Chris Darroch) to register cleanup for persistent connection in the no-threads case.
Fix driver-dependent potential memor-use bug in preparing statements
Work if check_conn is NOTIMPL in a driver
Support dbd connections tied to the conn_rec.
Fix pool in dbd_construct, and set sensible config defaults (based on feedback from Brian France)
Add note on DBD APIs to Module Developer Changes in new_features. Update cast in mod_dbd.c as suggested by jorton.
Eliminate possible compiler warnings pointed out by Joe.
Move mod_dbd from /experimental/ to /database/
mod_dbd: (1) Export new ap_dbd_prepare function (2) Put all dbd_open() stuff in one place (3) Remove the servertoken
Add const-ness to apr_dbd_driver_t
Update mod_dbd to API that hides apr_dbd_driver_t struct.
svn:eol-style native
Committing mod_dbd as new.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| apache@apache.org | ViewVC Help |
| Powered by ViewVC 1.1.2 |