apm_version_names_compare (public)
apm_version_names_compare version_name_1 version_name_2
Defined in packages/acs-tcl/tcl/apm-install-procs.tcl
Compare two version names for which is earlier than the other. Example:
- apm_version_names_compare "1.2d3" "3.5b" => -1
- apm_version_names_compare "3.5b" "3.5b" => 0
- apm_version_names_compare "3.5b" "1.2d3" => 1
- Parameters:
- version_name_1 (required)
- the first version name
- version_name_2 (required)
- the second version name
- Returns:
- -1: the first version is smallest
- 0: they're identical
- 1: the second version is smallest
- Author:
- Lars Pind
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- apm_version_names_compare
Source code: # # This function is stable (returns always the same results for the # same input) and called with only a few different input # values. By using acs::per_thread_cache the performance improves # from 265 microseconds to 2 microseconds; # return [acs::per_thread_cache eval -key acs-tcl.apm_version_names_compare($version_name_1,$version_name_2) { db_1row select_sortable_versions {} string compare $sortable_version_1 $sortable_version_2 }]Generic XQL file: packages/acs-tcl/tcl/apm-install-procs.xql
PostgreSQL XQL file: <fullquery name="apm_version_names_compare.select_sortable_versions"> <querytext> select apm_package_version__sortable_version_name(:version_name_1) as sortable_version_1, apm_package_version__sortable_version_name(:version_name_2) as sortable_version_2 from dual </querytext> </fullquery>packages/acs-tcl/tcl/apm-install-procs-postgresql.xql
Oracle XQL file: <fullquery name="apm_version_names_compare.select_sortable_versions"> <querytext> select apm_package_version.sortable_version_name(:version_name_1) as sortable_version_1, apm_package_version.sortable_version_name(:version_name_2) as sortable_version_2 from dual </querytext> </fullquery>packages/acs-tcl/tcl/apm-install-procs-oracle.xql