Skip to content

Commit

Permalink
Pass correct struct to field counting functions
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Dec 11, 2015
1 parent 884fbe1 commit 301dc4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c
Expand Up @@ -390,9 +390,15 @@ static int sql_num_fields(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *con
rlm_sql_mysql_conn_t *conn = handle->conn;

#if MYSQL_VERSION_ID >= 32224
/*
* Count takes a connection handle
*/
if (!(num = mysql_field_count(conn->sock))) {
#else
if (!(num = mysql_num_fields(conn->sock))) {
/*
* Fields takes a result struct
*/
if (!(num = mysql_num_fields(conn->result))) {
#endif
return -1;
}
Expand Down

0 comments on commit 301dc4a

Please sign in to comment.