Skip to content

Commit

Permalink
Some refactoring of ProxySQL_Admin
Browse files Browse the repository at this point in the history
Related to flush_XXXXX_variables___database_to_runtime().
Added three new functions then used by the various main functions():
* flush_GENERIC_variables__retrieve__database_to_runtime()
* flush_GENERIC_variables__checksum__database_to_runtime()
* flush_GENERIC_variables__process__database_to_runtime()
  • Loading branch information
renecannao committed Apr 24, 2024
1 parent 8a525bf commit d3a90a8
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 299 deletions.
12 changes: 12 additions & 0 deletions include/proxysql_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ class ProxySQL_Admin {
void flush_mysql_variables___runtime_to_database(SQLite3DB *db, bool replace, bool del, bool onlyifempty, bool runtime=false, bool use_lock=true);
void flush_mysql_variables___database_to_runtime(SQLite3DB *db, bool replace, const std::string& checksum = "", const time_t epoch = 0);

void flush_GENERIC_variables__checksum__database_to_runtime(const std::string& modname, const std::string& checksum, const time_t epoch);
bool flush_GENERIC_variables__retrieve__database_to_runtime(const std::string& modname, char* &error, int& cols, int& affected_rows, SQLite3_result* &resultset);
void flush_GENERIC_variables__process__database_to_runtime(
const std::string& modname, SQLite3DB *db, SQLite3_result* resultset,
const bool& lock, const bool& replace,
const std::unordered_set<std::string>& variables_read_only,
const std::unordered_set<std::string>& variables_to_delete_silently,
const std::unordered_set<std::string>& variables_deprecated,
const std::unordered_set<std::string>& variables_special_values,
std::function<void(const std::string&, const char *, SQLite3DB *)> special_variable_action = nullptr
);

char **get_variables_list();
bool set_variable(char *name, char *value, bool lock = true);
void flush_admin_variables___database_to_runtime(SQLite3DB *db, bool replace, const std::string& checksum = "", const time_t epoch = 0, bool lock = true);
Expand Down
Loading

0 comments on commit d3a90a8

Please sign in to comment.