- 19 Jul, 2023 30 commits
-
-
Vicențiu Ciorbaru authored
The functions are only used internally in the sql_acl.cc module. Mark them as static. TODO: The GRANT_INFO structure inside table could be encapsulated so we do not have code that access it like table_list->grant.m_internal.<member>
-
Vicențiu Ciorbaru authored
This eliminates the need to recompute strlen of the parameters, given that most callers already have the strlen computed.
-
Vicențiu Ciorbaru authored
Reduce argument count for check_grant_column and make call sites uniform.
-
Vicențiu Ciorbaru authored
By moving the master_access shortcut after 2 possible failure condition checks, it is possible to eliminate code duplication. Preserve the old behaviour of storing in save_priv *only* global grants if and only if, the privileges match the request *and* SELECT_ACL is present in master_access.
-
Vicențiu Ciorbaru authored
We can use a local variable. This helps in decoupling the code from thd and potentially eliminating thd->col_access temporary storage variable in the future.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
There is identical logic for all grant functions. If a grant grants to non existant users they are created if the SQL mode is not NO_AUTO_CREATE_USER *and* the user granting has rights to create users. This check is done via test_if_create_new_users. Refactor all code such that this check is only done in one (or three places for-now till more refactoring happens).
-
Vicențiu Ciorbaru authored
There are a number of get_current_user calls which can cause a malloc. Reorganize code within mysql_grant_xxx such that it assumes LEX_USERS are already resolved. This eliminates a number of mallocs and also simplifies code in mysql_grant_xxx functions. grant_stage0 now resolves lex_users, places it in a list copy, copies the clone's auth structures. Sql_cmd_grant_*::execute now uses the list for all subsequent mysql_grant_xxx functions calls.
-
Vicențiu Ciorbaru authored
This change splits mysql_grant based on the type of grants issued. * mysql_grant_global -> GRANT <priv> ON *.* * mysql_grant_db -> GRANT <priv> ON <database>.* * mysql_grant_proxy -> GRANT PROXY ... This does introduce a bit of code duplication, however it allows further refactoring and also isolates the grant modifying logic away from other details such as table opening, locking, binlogging. Another side effect is that the mysql.db table is only locked for a database level grant. Before it was locked even if there were only global level grants issued.
-
Vicențiu Ciorbaru authored
The class functions as a bundle of how privileges must be altered for the corresponding ACL_USER (and other ACL_xxx) classes. This stops mysql_x_grant function's prototype from ever expanding with additional flags. This is in preparation for DENY clause.
-
Vicențiu Ciorbaru authored
Mark the function static and clean up some leftover references. The replacement function is acl_get_all3.
-
Vicențiu Ciorbaru authored
command_array wasn't particularly meaningful as a name. Also use LEX_CSTRING instead of 2 separate arrays.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
The functions are now behind Sql_cmd_grant::execute so they no longer need to be exposed as part of sql_acl.h
-
Vicențiu Ciorbaru authored
* This cleanup reduces the size of Sql_cmd_grant_object because it eliminates an uneeded copy. Grant_privileges is stored as a reference to already thd->mem_root allocated Lex_grant_privileges. * Extend member functions of Grant_privileges to provide access to protected members.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
* This makes the table getters and setters idempotent. Slight performance decrease: When running on a Tabular user table, we set fields (in memory) that have previously been set. The code was "hiding' a get - set - get sequence of calls for User_table_json. This is now more apparent. The first "get" is required to obtain the "adjusted" privileges based on which MariaDB version wrote the privileges in global_priv. The second get is required for User_table_tabular, to map column privileges to actual newly introduced privileges For example SUPER column marked as YES maps to GLOBAL_SUPER_ADDED_SINCE_USER_TABLE_ACLS, which is a set of more granular privileges.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
Privilege checking functions should be grouped in sql_acl.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
Creating an object copy would imply that the destructor would delete the underlying same HASH object for both instances. That would lead to a double free and thus a crash.
-
Vicențiu Ciorbaru authored
During insert, the value isn't mutated so we can accept a const ptr.
-
Vicențiu Ciorbaru authored
Delete the copy constructor for Dynamic_array and use proper move semantics for acl_dbs.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
The String isn't mutated so it can be marked as const.
-
Vicențiu Ciorbaru authored
-
Vicențiu Ciorbaru authored
* conflicting types for grn_object_columns Make sure functions have the same signature in c and header files.
-
- 04 Jul, 2023 2 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
- 03 Jul, 2023 4 commits
-
-
Marko Mäkelä authored
log_t::write_checkpoint(), log_t::resize_start(): Invoke buf_flush_ahead() with buf_pool.get_oldest_modification(0)+1 so that another checkpoint will be invoked, to complete the log resizing. Tested by: Oleg Smirnov (on Microsoft Windows, where this hung most often)
-
Marko Mäkelä authored
-
Marko Mäkelä authored
ha_innobase::delete_table(): Also on DROP SEQUENCE, do try to drop any persistent statistics. They should really not be created for SEQUENCE objects (which internally are 1-row no-rollback tables), but that is how happened to always work.
-
Marko Mäkelä authored
i_s_innodb_buffer_page_get_info(): Correct a condition. After crash recovery, there may be some buffer pool pages in FREED state, containing garbage (invalid data page contents). Let us ignore such pages in the INFORMATION_SCHEMA output. The test innodb.innodb_defragment_fill_factor will be removed, because the queries that it is invoking on information_schema.innodb_buffer_page would start to fail. The defragmentation feature was removed in commit 7ca89af6 in MariaDB Server 11.1. Tested by: Matthias Leich
-
- 30 Jun, 2023 3 commits
-
-
Marko Mäkelä authored
btr_search_hash_table_validate(), btr_search_validate(): Add the parameter THD for checking if the statement has been killed. Any non-QUICK CHECK TABLE will validate the entire adaptive hash index for all InnoDB tables, which may be extremely slow when running multiple concurrent CHECK TABLE.
-
Marko Mäkelä authored
-
Oleg Smirnov authored
During the upgrade procedure on Windows mysqld.exe is started with the named pipe connection protocol. mysqladmin.exe then pings the server to check if is up and running. Command line looks like: mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping But the "socket" parameter resets the "protocol" which was previously initialized with the "pipe" value, setting it to "socket". As a result, connection cannot be established and the upgrade procedure fails. "socket" in Windows is used to pass the name of the pipe so resetting the protocol is not valid in this case. This commit fixes resetting of the "protocol" parameter with "socket" parameter in the case when protocol has been previously initialized to "pipe" value
-
- 29 Jun, 2023 1 commit
-
-
Oleg Smirnov authored
During the upgrade procedure on Windows mysqld.exe is started with the named pipe connection protocol. mysqladmin.exe then pings the server to check if is up and running. Command line looks like: mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping But the "socket" parameter resets the "protocol" which was previously initialized with the "pipe" value, setting it to "socket". As a result, connection cannot be established and the upgrade procedure fails. "socket" in Windows is used to pass the name of the pipe so resetting the protocol is not valid in this case. This commit fixes resetting of the "protocol" parameter with "socket" parameter in the case when protocol has been previously initialized to "pipe" value
-