Skip to content

Commit

Permalink
Merge pull request #2836 from noother/fix-unquoted-table-name
Browse files Browse the repository at this point in the history
fix unquoted table name leading to sql errors
  • Loading branch information
renecannao authored May 29, 2020
2 parents ba80d84 + 4266d3c commit 2721003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MySQL_Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ bool MySQL_Protocol::generate_COM_QUERY_from_COM_FIELD_LIST(PtrSize_t *pkt) {
(*myds)->com_field_wild=strdup(wild);
}

char *qt = (char *)"SELECT * FROM %s WHERE 1=0";
char *qt = (char *)"SELECT * FROM `%s` WHERE 1=0";
q = (char *)malloc(strlen(qt)+strlen(tablename));
sprintf(q,qt,tablename);
l_free(pkt->size, pkt->ptr);
Expand Down

0 comments on commit 2721003

Please sign in to comment.