Skip to content

createRoutines missing security characteristic #7

Description

@MattCordell

Error running the createRoutines.sql on databases with binary logging is enabled.

SQL Error [1418] [HY000]: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

As the functions are read Read Only - suffix the create line with READS SQL DATA To ensure compliance with binary logging rules

e.g.


DROP FUNCTION IF EXISTS get_FSN //
CREATE FUNCTION get_FSN(candidate bigint(20)) 
RETURNS varchar(2048)
READS SQL DATA -- This ensures compliance with binary logging rules
BEGIN
    RETURN (SELECT term 
            FROM descriptions_snapshot
            WHERE active = 1 
            AND typeId = 900000000000003001
            AND conceptId = candidate);
END
//
DELIMITER ;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions