When upgrading from an earlier version of 2.2 to a newer version of 2.2
authorJan Wieck <JanWieck@Yahoo.com>
Sun, 26 May 2013 14:54:40 +0000 (10:54 -0400)
committerSteve Singer <ssinger@ca.afilias.info>
Mon, 27 May 2013 15:31:04 +0000 (11:31 -0400)
the old shared library (that now has the version number in its name) might
not still be present.  This change avoids having to call C functions as
part of the slonik queries done during a UPDATE FUNCTIONS script.

src/slonik/slonik.c

index 6779cfe51f5d3da5f6e4750c3b9408c648aead6e..62973156291211b9f617ac8025ab12cd4441da82 100644 (file)
@@ -4874,7 +4874,7 @@ slonik_update_functions(SlonikStmt_update_functions * stmt)
        PGresult   *res;
        SlonDString query;
 
-       adminfo = get_checked_adminfo((SlonikStmt *) stmt, stmt->no_id);
+       adminfo = get_active_adminfo((SlonikStmt *) stmt, stmt->no_id);
        if (adminfo == NULL)
                return -1;
 
@@ -5769,11 +5769,12 @@ slonik_get_last_event_id(SlonikStmt * stmt,
        dstring_init(&query);
        slon_mkquery(&query, "select max(ev_seqno) FROM \"_%s\".sl_event"
                                 " , \"_%s\".sl_node "
-                                " where ev_origin=\"_%s\".getLocalNodeId('_%s') "
+                                " where ev_origin= "
+                                "     (select last_value from \"_%s\".sl_local_node_id) "
                                 " AND %s AND sl_node.no_id="
                                 " ev_origin"
                                 ,script->clustername, script->clustername,
-                                script->clustername, script->clustername, event_filter);
+                                script->clustername, event_filter);
        node_count = 0;
        for (curAdmInfo = script->adminfo_list;
                 curAdmInfo != NULL; curAdmInfo = curAdmInfo->next)