Skip to content

Commit

Permalink
fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Dec 8, 2018
1 parent 892fb1e commit 42ae4fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sqladvisor/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,16 @@ uint get_join_table_result_set(TABLE_LIST *table) {
int num_fields = mysql_num_fields(result);

MYSQL_ROW row;


int mysql_server_version = mysql_get_server_version(con);
sql_print_information("mysql_server_version: %d\n",mysql_server_version);
if ((row = mysql_fetch_row(result))) {
result_set_count = atoi(row[EXPLAIN_ROWS]);
if (mysql_server_version >= 50700){
result_set_count = atoi(row[9]);
}
else{
result_set_count = atoi(row[EXPLAIN_ROWS]);
}
}
g_string_free(cardinality_sql, TRUE);
mysql_free_result(result);
Expand Down

0 comments on commit 42ae4fe

Please sign in to comment.