Skip to content

Commit

Permalink
Fix potential invalid syntax in TAP test queries
Browse files Browse the repository at this point in the history
This is a follow-up of commit #19c8f8698
  • Loading branch information
JavierJF committed Nov 24, 2024
1 parent 8774b31 commit 321ffe0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/tap/tests/reg_test_4402-mysql_fields-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ int main(int argc, char** argv) {

// to check table alias issue:
{
const std::string& query = "SELECT data FROM testdb.dummy_table AS " + generate_random_string(length);
// NOTE: The randomly generated string should be escaped \`\`, otherwise could collide
// with SQL reserved words, causing an invalid test failure.
const std::string& query = "SELECT data FROM testdb.dummy_table AS `" + generate_random_string(length) + "`";
MYSQL_QUERY__(proxysql, query.c_str());

MYSQL_RES* res = mysql_use_result(proxysql);
Expand Down

0 comments on commit 321ffe0

Please sign in to comment.