Changeset: 4887aa53a519 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4887aa53a519
Modified Files:
        clients/mapiclient/dump.c
Branch: default
Log Message:

No need to check for function sys.password_hash.
It's been available since 2009.


diffs (62 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1642,15 +1642,6 @@ dump_database(Mapi mid, stream *toConsol
 {
        const char *start = "START TRANSACTION";
        const char *end = "ROLLBACK";
-       const char *chkhash =
-               "SELECT id "
-               "FROM sys.functions "
-               "WHERE name = 'password_hash'";
-       const char *createhash =
-               "CREATE FUNCTION password_hash (username STRING) "
-               "RETURNS STRING "
-               "EXTERNAL NAME sql.password";
-       const char *drophash = "DROP FUNCTION password_hash";
        const char *users =
                "SELECT ui.name, "
                       "ui.fullname, "
@@ -1809,7 +1800,6 @@ dump_database(Mapi mid, stream *toConsol
        char *sname = NULL;
        char *curschema = NULL;
        MapiHdl hdl = NULL;
-       int create_hash_func = 0;
        int rc = 0;
        char *query, *q, *end_q;
        size_t query_len = 5120;
@@ -1850,19 +1840,6 @@ dump_database(Mapi mid, stream *toConsol
                mapi_close_handle(hdl);
 
                /* dump users, part 1 */
-               /* first make sure the password_hash function exists */
-               if ((hdl = mapi_query(mid, chkhash)) == NULL ||
-                   mapi_error(mid))
-                       goto bailout;
-               create_hash_func = mapi_rows_affected(hdl) == 0;
-               mapi_close_handle(hdl);
-               if (create_hash_func) {
-                       if ((hdl = mapi_query(mid, createhash)) == NULL ||
-                           mapi_error(mid))
-                               goto bailout;
-                       mapi_close_handle(hdl);
-               }
-
                if ((hdl = mapi_query(mid, users)) == NULL || mapi_error(mid))
                        goto bailout;
 
@@ -1935,14 +1912,6 @@ dump_database(Mapi mid, stream *toConsol
                        mapi_close_handle(hdl);
                }
 
-               /* clean up -- not strictly necessary due to ROLLBACK */
-               if (create_hash_func) {
-                       if ((hdl = mapi_query(mid, drophash)) == NULL ||
-                           mapi_error(mid))
-                               goto bailout;
-                       mapi_close_handle(hdl);
-               }
-
                /* grant user privileges */
                if ((hdl = mapi_query(mid, grants)) == NULL || mapi_error(mid))
                        goto bailout;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to