Index: openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info,v diff -u -N -r1.45.2.4 -r1.45.2.5 --- openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 27 Feb 2021 22:25:31 -0000 1.45.2.4 +++ openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 1 Mar 2021 09:19:02 -0000 1.45.2.5 @@ -9,7 +9,7 @@ f t - + Don Baccus Bootstraps an OpenACS installation. 2017-08-06 @@ -18,7 +18,7 @@ GPL 3 - + Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v diff -u -N -r1.49.2.10 -r1.49.2.11 --- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 27 Feb 2021 17:48:35 -0000 1.49.2.10 +++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 1 Mar 2021 09:19:02 -0000 1.49.2.11 @@ -57,57 +57,77 @@ # The RDBMS Data Abstraction ################################## -ad_proc -public db_rdbms_create {type version} { - @return rdbms descriptor +ad_proc -public -deprecated db_rdbms_create {type version} { + + The function is not needed, since all it returns is a plain Tcl + dict with obvious keys (type and version) + + @return rdbms descriptor in form of a dict + @see dict } { - return [list $type $version] + return [list type $type version $version] } ad_proc -private db_rdbms_get_type {rdbms} { - @param rdbms descriptor constructed by db_rdbms_create + Conveniance function, could be replaced there with standard Tcl + dict operations. + @param rdbms descriptor in form of a type version pair @return rdbms name } { - return [lindex $rdbms 0] + return [expr {[dict exists $rdbms type] ? [dict get $rdbms type] : ""}] } ad_proc -private db_rdbms_get_version {rdbms} { - @param rdbms descriptor constructed by db_rdbms_create + Conveniance function, could be replaced there with standard Tcl + dict operations. + @param rdbms descriptor constructed by db_rdbms_create @return version identifier } { - return [lindex $rdbms 1] + return [expr {[dict exists $rdbms version] ? [dict get $rdbms version] : ""}] } -ad_proc -private db_rdbms_compatible_p {rdbms_test rdbms_pattern} { +ad_proc -private db_rdbms_compatible_p { + rdbms_test + rdbms_pattern +} { @return 0 if test incompatible with pattern, 1 if miscible } { - #db_qd_log QDDebug "The RDBMS_TEST is [db_rdbms_get_type $rdbms_test] - " \ - # [db_rdbms_get_version $rdbms_test] - #db_qd_log QDDebug "The RDBMS_PATTERN is [db_rdbms_get_type $rdbms_pattern] - " \ - # [db_rdbms_get_version $rdbms_pattern] + #db_qd_log QDDebug "The compatible_p $rdbms_test - $rdbms_pattern" - # If the pattern is for all RDBMS, then yeah, compatible - if {[db_rdbms_get_type $rdbms_test] eq ""} { + # + # 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 {[db_rdbms_get_type $rdbms_test] != [db_rdbms_get_type $rdbms_pattern]} { - # db_qd_log QDDebug "compatibility - RDBMS types are different!" + # + 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 - if {[db_rdbms_get_version $rdbms_pattern] eq ""} { + # + # 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 [db_rdbms_get_version $rdbms_test ] "\."] \ - p [split [db_rdbms_get_version $rdbms_pattern] "\."] { - if {$t != $p} {return [expr {$t < $p}]} + # + # 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 @@ -450,15 +470,15 @@ if {$fullquery ne ""} { set sql [db_fullquery_get_querytext $fullquery] - + if {[info exists ulevel]} { if {$subst ne "none"} { if {$subst eq "all"} { set flags -nobackslashes } elseif {$subst eq "vars"} { set flags "-nobackslashes -nocommands" } elseif {$subst eq "commands"} { - set flags "-nobackslashes -novars" + set flags "-nobackslashes -novars" } else { ns_log warning "invalid value passed to '-subst': $subst. possible: all, none, vars, commands" set flags -nobackslashes @@ -803,7 +823,7 @@ } ad_proc -private db_rdbms_parse_from_xml_node {rdbms_node} { - Parse and RDBMS struct from an XML fragment node + Parse an RDBMS struct from an XML fragment node } { # # Check if the DOM node refers to a RDBMS. @@ -819,7 +839,7 @@ # db_qd_log QDDebug "PARSER = RDBMS parser - $type - $version" - return [db_rdbms_create $type $version] + return [list type $type version $version] } Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -N -r1.95.2.20 -r1.95.2.21 --- openacs-4/packages/acs-tcl/acs-tcl.info 27 Feb 2021 22:25:31 -0000 1.95.2.20 +++ openacs-4/packages/acs-tcl/acs-tcl.info 1 Mar 2021 09:19:02 -0000 1.95.2.21 @@ -9,7 +9,7 @@ f t - + OpenACS The Kernel Tcl API library. 2017-08-06 @@ -18,8 +18,8 @@ GPL version 2 3 - - + + Index: openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/01-database-procs.tcl,v diff -u -N -r1.1.2.26 -r1.1.2.27 --- openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 28 Feb 2021 21:56:23 -0000 1.1.2.26 +++ openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 1 Mar 2021 09:19:02 -0000 1.1.2.27 @@ -284,7 +284,7 @@ ad_proc -public db_current_rdbms {} { @return the current rdbms type and version. } { - return [db_rdbms_create [db_type] [db_version]] + return [list type [db_type] version [db_version]] } ad_proc -public db_known_database_types {} {