apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevac Marko <ma...@kevac.org>
Subject Re: [PATCH] add some flags to apr_dbd_mysql flags parameter
Date Wed, 18 Nov 2009 10:09:59 GMT
Any more thouhts? Thanks.

On Sat, Oct 10, 2009 at 9:37 AM, Kevac Marko <marko@kevac.org> wrote:
> You are right - we should. They are not exclusive.
>
> Fixed patch:
>
> diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c
> index 77fa5fb..3c0d911 100644
> --- a/dbd/apr_dbd_mysql.c
> +++ b/dbd/apr_dbd_mysql.c
> @@ -1156,9 +1156,16 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t
> *pool, const char *params,
>     if (fields[4].value != NULL) {
>         port = atoi(fields[4].value);
>     }
> -    if (fields[6].value != NULL &&
> -        !strcmp(fields[6].value, "CLIENT_FOUND_ROWS")) {
> -        flags |= CLIENT_FOUND_ROWS; /* only option we know */
> +    if (fields[6].value != NULL) {
> +        if (strstr(fields[6].value, "CLIENT_FOUND_ROWS")) {
> +            flags |= CLIENT_FOUND_ROWS;
> +        }
> +        if (strstr(fields[6].value, "CLIENT_MULTI_STATEMENTS")) {
> +            flags |= CLIENT_MULTI_STATEMENTS;
> +        }
> +        if (strstr(fields[6].value, "CLIENT_MULTI_RESULTS")) {
> +            flags |= CLIENT_MULTI_RESULTS;
> +        }
>     }
>     if (fields[7].value != NULL) {
>         sql->fldsz = atol(fields[7].value);
>
> On Sat, Oct 10, 2009 at 7:21 AM, Bojan Smojver <bojan@rexursive.com> wrote:
>> Question here (I didn't look at the manual to check): are all these
>> flags mutually exclusive? If they are not, we should have 3 ifs instead
>> of if/else if, right?
>>
>> --
>> Bojan
>>
>>
>
>
>
> --
> Marko Kevac
>



-- 
Marko Kevac
Sent from Moscow, Mow, Russia

Mime
View raw message