db_rdbms_compatible_p (private)

 db_rdbms_compatible_p rdbms_test rdbms_pattern

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

Parameters:
rdbms_test
rdbms_pattern
Returns:
0 if test incompatible with pattern, 1 if miscible

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

Testcases:
No testcase defined.
Source code:
    #db_qd_log QDDebug "The compatible_p $rdbms_test - $rdbms_pattern"

    #
    # If the pattern is for all RDBMS (types), then yeah, compatible.
    #
    if {![dict exists $rdbms_test type] || [dict get $rdbms_test type] eq ""} {
        return 1
    }

    #
    # If the RDBMS types are not the same, we have a problem
    #
    if {[dict get $rdbms_test type] ne [dict get $rdbms_pattern type]} {
        # db_qd_log QDDebug "compatibility - types of $rdbms_test and $rdbms_pattern are different!"
        return 0
    }

    #
    # If the pattern has no version or the version is empty
    #
    if {![dict exists $rdbms_pattern version] || [dict get $rdbms_pattern version] eq ""} {
        return 1
    }

    #
    # If the query being tested was written for a version that is
    # older than the current RDBMS then we have
    # compatibility. Otherwise we don't.
    #
    foreach t [split [dict get $rdbms_test version] "\."]  p [split [dict get $rdbms_pattern version] "\."] {
            if {$t != $p} {
                return [expr {$t < $p}]
            }
        }

    # Same version (though not strictly "older") is OK
    return 1
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: