Skip to content
  • Thomas Markwalder's avatar
    [3802] Addressed review comments · 19221f4a
    Thomas Markwalder authored
    Primarily, SQL text for lease-dump now comes from a file and the use of
    PIPESTATUS has been eliminated:
    
    src/bin/admin/admin-utils.sh
    
        mysql_execute() - altered the function to not catch the mysql output in
        in an environment variable.  This removes the risk of large result sets
        crashing the shell and allows callers more flexibility.
    
        mysql_version() - now returns exit value of its call to mysql_execute.
    
        mysql_version_printf() - deleted this function.
    
    src/bin/admin/kea-admin.in
    
        Removed the use of $_RESULT env variable formerly set by mysql_execute
    
        Replaced use of mysql_version_printf with appropriately structured
        calls to mysql_version
    
        Check_file_overwrite () - utility function for prompting the user that
        a given file will be overwritten
    
        get_dump_qry()  - new function which fetches the lease dump  SQL text
        specific to a given backend, version, and protocol from a file
    
        mysql_dump()
            - Updated to use get_dump_qry() to fetch the needed SQL
            - Restructured to use a temp file rather than pipe to eliminate
            use of PIPESTATUS
    
        pgsql_dump()
            Updated to get_dump_qry() to fetch the needed SQL
            Removed use of PIPESTATUS (didn't need it anyway)
    
    src/bin/admin/scripts/mysql/upgrade_1.0_to_2.0.sh.in
        Updated calls to mysql_version
    
    Added the following files which contain lease-dump SQL text:
        src/bin/admin/scripts/mysql/lease_dump_1.0.sh
        src/bin/admin/scripts/mysql/lease_dump_2.0.sh
        src/bin/admin/scripts/pgsql/lease_dump_1.0.sh
    19221f4a