[ https://issues.apache.org/jira/browse/RANGER-1912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16947595#comment-16947595 ]
Sean Roberts commented on RANGER-1912: -------------------------------------- Here is the code that has re-introduced the problem: https://github.com/hortonworks/ranger/blame/a009cebbe788f5da86fd1b097ddb00fea3790d9c/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql#L1487 > Ranger setup fails with mariadb/mysql when binary logging is enabled > -------------------------------------------------------------------- > > Key: RANGER-1912 > URL: https://issues.apache.org/jira/browse/RANGER-1912 > Project: Ranger > Issue Type: Bug > Components: Ranger > Affects Versions: 0.4.0, 0.5.0, 0.6.0, 0.7.0 > Reporter: Pradeep Agrawal > Assignee: Pradeep Agrawal > Priority: Major > Fix For: 1.0.0 > > Attachments: > 0001-RANGER-1912-Ranger-setup-fails-with-MySQL-when-binar.patch > > > 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: > {code:java} > 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) > {code} > 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: > {code:java} > SET GLOBAL log_bin_trust_function_creators = 1; > {code} > 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. -- This message was sent by Atlassian Jira (v8.3.4#803005)