Skip to content

Commit

Permalink
Remove tracking of log_queries_not_using_indexes
Browse files Browse the repository at this point in the history
log_queries_not_using_indexes is not enabled because in MySQL it is *only*
a global variable, while in MariaDB is a global *and* session variable .
We believe it is not the time to create a lot of exceptions and complex logic
for conflicting backend implementations
  • Loading branch information
renecannao committed Jun 19, 2023
1 parent dc732c5 commit 73ac61b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions include/proxysql_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ enum mysql_variable_name {
SQL_LC_MESSAGES,
SQL_LC_TIME_NAMES,
SQL_LOCK_WAIT_TIMEOUT,
SQL_LOG_QUERIES_NOT_USING_INDEXES,
SQL_LOG_SLOW_FILTER,
SQL_LONG_QUERY_TIME,
SQL_MAX_EXECUTION_TIME,
Expand Down Expand Up @@ -1158,7 +1157,9 @@ mysql_variable_st mysql_tracked_variables[] {
{ SQL_LC_MESSAGES, SETTING_VARIABLE, true, false, false, false, (char *)"lc_messages", NULL, (char *)"" , false} ,
{ SQL_LC_TIME_NAMES, SETTING_VARIABLE, true, false, false, false, (char *)"lc_time_names", NULL, (char *)"" , false} ,
{ SQL_LOCK_WAIT_TIMEOUT, SETTING_VARIABLE, false, false, true, false, (char *)"lock_wait_timeout", NULL, (char *)"" , false} ,
{ SQL_LOG_QUERIES_NOT_USING_INDEXES, SETTING_VARIABLE, false, false, false, true, (char *)"log_queries_not_using_indexes", NULL, (char *)"OFF" , false} ,
// log_queries_not_using_indexes is not enabled because in MySQL it is *only* a global variable, while in MariaDB is a global *and* session variable .
// We believe it is not the time to create a lot of exceptions and complex logic for conflicting backend implementations
// { SQL_LOG_QUERIES_NOT_USING_INDEXES, SETTING_VARIABLE, false, false, false, true, (char *)"log_queries_not_using_indexes", NULL, (char *)"OFF" , false} ,
{ SQL_LOG_SLOW_FILTER, SETTING_VARIABLE, true, false, false, false, (char *)"log_slow_filter", NULL, (char *)"" , false} ,
{ SQL_LONG_QUERY_TIME, SETTING_VARIABLE, false, false, true, false, (char *)"long_query_time", NULL, (char *)"" , false} ,
{ SQL_MAX_EXECUTION_TIME, SETTING_VARIABLE, false, false, true, false, (char *)"max_execution_time", NULL, (char *)"" , false} ,
Expand Down
1 change: 0 additions & 1 deletion lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ static const std::set<std::string> mysql_variables_boolean = {
"foreign_key_checks",
"innodb_strict_mode",
"innodb_table_locks",
"log_queries_not_using_indexes",
"sql_auto_is_null",
"sql_big_selects",
"sql_generate_invisible_primary_key",
Expand Down
6 changes: 2 additions & 4 deletions test/tap/tests/generate_set_session_csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ void add_values_and_quotes(const std::string& name, const std::vector<std::strin
int main() {

srand(1);
vars["log_queries_not_using_indexes"] = new variable("log_queries_not_using_indexes", false, false, true);
vars["log_queries_not_using_indexes"]->add(bool_values);
vars["sql_log_bin"] = new variable("sql_log_bin", false, false, true);
vars["sql_log_bin"]->add(bool_values);
vars["sql_safe_updates"] = new variable("sql_safe_updates", true, false, true);
Expand Down Expand Up @@ -255,8 +253,8 @@ int main() {
vars["lc_messages"]->add(std::vector<std::string> {"fr_FR", "'fr_FR'", "`fr_FR`", "\"fr_FR\""});

vars["log_slow_filter"] = new variable("log_slow_filter", true, false, false);
vars["log_slow_filter"]->add(std::vector<std::string> {"not_using_index", "'not_using_index'", "`not_using_index`", "\"not_using_index\""});
vars["log_slow_filter"]->add(std::vector<std::string> {"admin, filesort, filesort_on_disk, full_join", "'admin, filesort, filesort_on_disk, full_join'", "`admin, filesort, filesort_on_disk, full_join`", "\"admin, filesort, filesort_on_disk, full_join\""});
vars["log_slow_filter"]->add(std::vector<std::string> {"'not_using_index'", "`not_using_index`", "\"not_using_index\""});
vars["log_slow_filter"]->add(std::vector<std::string> {"'admin,filesort,filesort_on_disk,full_join'", "`admin,filesort,filesort_on_disk,full_join`", "\"admin,filesort,filesort_on_disk,full_join\""});

vars["time_zone"] = new variable("time_zone", true, false, false);
vars["time_zone"]->add(std::vector<std::string> {"'+01:00'", "`+02:15`", "\"+03:30\""});
Expand Down
2 changes: 1 addition & 1 deletion test/tap/tests/set_testing-240-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ char *schema=(char *)"information_schema";
int silent = 0;
int sysbench = 0;
int local=0;
int queries=5000;
int queries=4000;
int uniquequeries=0;
int histograms=-1;

Expand Down
2 changes: 2 additions & 0 deletions test/tap/tests/set_testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const std::vector<std::string> possible_unknown_variables = {
"group_replication_consistency",
"query_cache_type",
"wsrep_osu_method",
"log_slow_filter",
"sql_quote_show_create",
};

int readTestCases(const std::string& fileName) {
Expand Down

0 comments on commit 73ac61b

Please sign in to comment.