Edgewall Software

Changes between Initial Version and Version 1 of Ticket #13032


Ignore:
Timestamp:
May 28, 2018, 8:01:14 AM (4 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13032 – Description

    initial v1  
    99
    1010I've done only a cursory investigation, but it looks like the [https://www.postgresql.org/support/versioning/ versioning policy has changed]. So for version >= 10 we should parse `100004` to tuple `(10, 4)`: [browser:tags/trac-1.3.2/trac/db/postgres_backend.py@:454:#L452].
     11
     12{{{#!diff
     13diff --git a/trac/db/postgres_backend.py b/trac/db/postgres_backend.py
     14index c2e94becc..2647f9b9d 100644
     15--- a/trac/db/postgres_backend.py
     16+++ b/trac/db/postgres_backend.py
     17@@ -99,10 +99,15 @@ def _quote(identifier):
     18 def _version_tuple(ver):
     19
     20     if ver:
     21-        # Extract 9.1.23 from 90123.
     22         def get_digit(version, n):
     23             return version / 10 ** (2 * n) % 100
     24-        return get_digit(ver, 2), get_digit(ver, 1), get_digit(ver, 0)
     25+        first_digit = get_digit(ver, 2)
     26+        if first_digit >= 10:
     27+            # Extract (10, 4) from 100004.
     28+            return first_digit, get_digit(ver, 0)
     29+        else:
     30+            # Extract (9, 1, 23) from 90123.
     31+            return first_digit, get_digit(ver, 1), get_digit(ver, 0)
     32
     33
     34 def _version_string(ver):
     35}}}
     36
     37A few other minor changes may also be needed.