Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2604 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Stefan Bühler 2009-07-24 20:26:17 +00:00
parent ea78edda65
commit ed417a04d6
2 changed files with 16 additions and 0 deletions

1
NEWS
View File

@ -30,6 +30,7 @@ NEWS
* Fix handling network-write return values (#2024)
* Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040)
* Remove adaptive spawning code from fastcgi (was disabled for a long time)
* Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)
- 1.4.23 - 2009-06-19
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)

View File

@ -259,8 +259,14 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
#define FOO(x) (s->x->used ? s->x->ptr : NULL)
#if MYSQL_VERSION_ID >= 40100
/* CLIENT_MULTI_STATEMENTS first appeared in 4.1 */
if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
FOO(mydb), s->port, FOO(mysock), CLIENT_MULTI_STATEMENTS)) {
#else
if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
FOO(mydb), s->port, FOO(mysock), 0)) {
#endif
log_error_write(srv, __FILE__, __LINE__, "s", mysql_error(s->mysql));
return HANDLER_ERROR;
@ -369,6 +375,9 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
if (!row || cols < 1) {
/* no such virtual host */
mysql_free_result(result);
#if MYSQL_VERSION_ID >= 40100
while (mysql_next_result(p->conf.mysql) == 0);
#endif
return HANDLER_GO_ON;
}
@ -402,6 +411,9 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
c->fcgi_offset = c->fcgi_arg->used = 0;
}
mysql_free_result(result);
#if MYSQL_VERSION_ID >= 40100
while (mysql_next_result(p->conf.mysql) == 0);
#endif
/* fix virtual server and docroot */
GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
@ -416,6 +428,9 @@ GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
return HANDLER_GO_ON;
ERR500: if (result) mysql_free_result(result);
#if MYSQL_VERSION_ID >= 40100
while (mysql_next_result(p->conf.mysql) == 0);
#endif
con->http_status = 500; /* Internal Error */
con->mode = DIRECT;
return HANDLER_FINISHED;