public inbox for [email protected]  
help / color / mirror / Atom feed
There is an error when checking the major version of servers in schema diff
2+ messages / 2 participants
[nested] [flat]

* There is an error when checking the major version of servers in schema diff
@ 2021-01-17 12:58  Huang, Jun <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Huang, Jun @ 2021-01-17 12:58 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

The function get_round_val() outputs the wrong value when major version is before 10.
For example,
   Source server version: 90500
   Target server version: 90502
Or
   Source server version: 90502
   Target server version: 90602

The attached patch shows the changes.
--
Thanks && regards
HuangJ





Attachments:

  [application/octet-stream] check-major-version-of-servers.patch (577B, 2-check-major-version-of-servers.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/schema_diff/__init__.py b/web/pgadmin/tools/schema_diff/__init__.py
index 7ca19d2d2..596b976ad 100644
--- a/web/pgadmin/tools/schema_diff/__init__.py
+++ b/web/pgadmin/tools/schema_diff/__init__.py
@@ -720,8 +720,8 @@ def check_version_compatibility(sid, tid):
                               'Advanced Server.')
 
     def get_round_val(x):
-        if x < 10000:
-            return x if x % 100 == 0 else x + 100 - x % 100
+        if x < 100000:
+            return x + 100 - x % 100
         else:
             return x + 10000 - x % 10000
 


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: There is an error when checking the major version of servers in schema diff
@ 2021-01-18 11:10  Akshay Joshi <[email protected]>
  parent: Huang, Jun <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-01-18 11:10 UTC (permalink / raw)
  To: Huang, Jun <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Sun, Jan 17, 2021 at 6:28 PM Huang, Jun <[email protected]>
wrote:

> Hi,
>
> The function get_round_val() outputs the wrong value when major version is
> before 10.
> For example,
>    Source server version: 90500
>    Target server version: 90502
> Or
>    Source server version: 90502
>    Target server version: 90602
>
> The attached patch shows the changes.
> --
> Thanks && regards
> HuangJ
>
>
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-01-18 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 12:58 There is an error when checking the major version of servers in schema diff Huang, Jun <[email protected]>
2021-01-18 11:10 ` Akshay Joshi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox