Description
Ranger Admin installation fails when using MariaDB/MySQL with binary logging enabled.
The install should work even if binary logging is enabled.
Problem Statement: Currently MySQL DB patch 007 and 008 is having MySQL UDF functions which are not DETERMINISTIC
When you create a stored function, you must declare either that it is deterministic or that it does not modify data. Otherwise, it may be unsafe for data recovery or replication.
By default, for a CREATE FUNCTION statement to be accepted, at least one of DETERMINISTIC, NO SQL, or READS SQL DATA must be specified explicitly. Otherwise, an error occurs:
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
Although it is possible to create a deterministic stored function without specifying DETERMINISTIC, you cannot execute this function using statement-based binary logging. To execute such a function, you must use row-based or mixed binary logging. Alternatively, if you explicitly specify DETERMINISTIC in the function definition, you can use any kind of logging, including statement-based logging.
To relax the preceding conditions on function creation (that you must have the SUPER privilege and that a function must be declared deterministic or to not modify data), set the global log_bin_trust_function_creators system variable to 1. By default, this variable has a value of 0, but you can change it like this:
SET GLOBAL log_bin_trust_function_creators = 1;
If binary logging is not enabled, log_bin_trust_function_creators does not apply. SUPER is not required for function creation unless, as described previously, the DEFINER value in the function definition requires it.
Proposed Solution: We can remove usage of stored function and it can be replaced with the stored procedure.
Attachments
Attachments
Issue Links
- is related to
-
RANGER-1521 Ranger database script for mysql requires admin privileges for replicated database
- Resolved
-
RANGER-1694 Execute 007-updateBlankPolicyName.sql failed in some mysql environment, which will cause ranger-admin start fail.
- Resolved
-
RANGER-1710 When install ranger-1.0.0-SNAPSHOT-admin,execute ./setup.sh find [E] 007-updateBlankPolicyName.sql import failed
- Resolved
- relates to
-
RANGER-3594 mysql setup scripts failed with binlog-enabled mysql
- Resolved
- links to