Skip to content

Commit

Permalink
- Changed return code for mysql_optionv/mysql_get_optionv to 1 (was -…
Browse files Browse the repository at this point in the history
…1) and added CR_NOT_IMPLEMENTED error message.

if a options is unknown or not supported.
  This will fix possible error when setting connection attributes.
Kudos to Coray Hickey for providing this patch!
  • Loading branch information
9EOR9 committed Feb 3, 2019
1 parent 4964fae commit cb08739
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libmariadb/mariadb_lib.c
Expand Up @@ -3015,7 +3015,8 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
break;
default:
va_end(ap);
return(-1);
SET_CLIENT_ERROR(mysql, CR_NOT_IMPLEMENTED, SQLSTATE_UNKNOWN, 0);
return(1);
}
va_end(ap);
return(0);
Expand Down Expand Up @@ -3229,13 +3230,14 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
break;
default:
va_end(ap);
return(-1);
SET_CLIENT_ERROR(mysql, CR_NOT_IMPLEMENTED, SQLSTATE_UNKNOWN, 0);
return(1);
}
va_end(ap);
return(0);
error:
va_end(ap);
return(-1);
return(1);
}

int STDCALL mysql_get_option(MYSQL *mysql, enum mysql_option option, void *arg)
Expand Down

0 comments on commit cb08739

Please sign in to comment.