db_qd_pick_most_specific_query (private)

 db_qd_pick_most_specific_query rdbms query_1 query_2

Defined in packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl

For now, we're going to say that versions are numbers and that there is always backwards compatibility.

Parameters:
rdbms (required)
query_1 (required)
query_2 (required)

Partial Call Graph (max 5 caller/called nodes):
%3 db_qd_internal_store_cache db_qd_internal_store_cache (private) db_qd_pick_most_specific_query db_qd_pick_most_specific_query db_qd_internal_store_cache->db_qd_pick_most_specific_query db_fullquery_get_rdbms db_fullquery_get_rdbms (private) db_qd_pick_most_specific_query->db_fullquery_get_rdbms db_rdbms_get_version db_rdbms_get_version (private) db_qd_pick_most_specific_query->db_rdbms_get_version

Testcases:
No testcase defined.
Source code:
    set rdbms_1 [db_fullquery_get_rdbms $query_1]
    set rdbms_2 [db_fullquery_get_rdbms $query_2]

    # We ASSUME that both queries are at least compatible.
    # Otherwise this is a stupid exercise

    if {[db_rdbms_get_version $rdbms_1] eq ""} {
        return $query_2
    }

    if {[db_rdbms_get_version $rdbms_2] eq ""} {
        return $query_1
    }

    if {[db_rdbms_get_version $rdbms_1] > [db_rdbms_get_version $rdbms_2]} {
        return $query_1
    } else {
        return $query_2
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: