Version Comparison Bug

(imported topic written by CSPARGO)

Hello,

Using BigFix 8.2.1409.0 I’m doing a version comparison and found what I think is a bug. I tested in FixletDebugger and these are my results:

q:

“1.0”

as

version

<

“1.0.10”

as
version

A:
False

T:
0.028 ms

q:

“1.0”

as

version

“1.0.10”

as
version

A:
False

T:
0.029 ms

q:

“1.0”

as

version

=

“1.0.10”

as
version

A:
True

T:
0.046 ms

I expect “1.0” to be less than “1.0.10” and I especially expect “1.0” to NOT equal “1.0.10” Should the client/debugger be smart enough to assume missing .0 if minor versions exist on one end of the comparison but not the other?

Thanks

(imported comment written by NoahSalzman)

You might try “pad of ”.

q:
pad
of
(version
“1.0”
)
<

“1.0.10”

as
version

A:
True

T:
0.069 ms

I:
singular boolean

q:
pad
of
(
“1.0”

as
version)

“1.0.10”

as
version

A:
False

T:
0.064 ms

I:
singular boolean

q:
pad
of
(
“1.0”

as
version)

“1.0.10”

as
version

A:
False

T:
0.070 ms

I:
singular boolean

q:
pad
of
(
“1.0”

as
version)

A:
1.0.0.0

T:
0.134 ms

I:
singular version

(imported comment written by amelgares)

I’m seeing the same behavior on the Mac which is messing up our Firefox 27.0.1 update. “Pad of” isn’t available for the Mac client.

Q: version of folder “/Applications/Firefox.app”

A: 27.0

Q: version of folder “/Applications/Firefox.app” < (“27.0.1” as version)

A: False

(imported comment written by UT7U_Tim_Baumer)

As a work-around, try using “as string”

Q: version of folder “/Application/Firefox.app” as string < “27.0.1”

(imported comment written by amelgares)

Well, I wouldn’t have guessed this would work, but it does. Thanks!

Q: version of folder “/Applications/Firefox.app”

A: 27.0.1

Q: version of folder “/Applications/Firefox.app” as string > “27.0”

A: True

Q: version of folder “/Applications/Firefox.app” > “27.0” as version

A: False

(imported comment written by NoahSalzman)

FYI… the bug for tracking the missing “pad of” inspector on Mac OS X is 61982.

1 Like

Reviving an old thread here… but is this “bug” still on the list?

bump.

I hate this bug there is only one case where you would want to use it (when looking at a major version), e.g.

Q: version of regapp “firefox.app”
A: 46.0.1
Q: version of regapp “firefox.app” = “46” as version
A: True

And that functionality can still be kept in place for backwards compatibility, although I would suggest to change this behavior as it’s not used that much and it’s easy to compare major versions with:

Q: first 2 of “46.0” as version = first 2 of “46.0.1” as version
A: True

But it should still give us a proper version comparison when doing < and > which it does not, e.g.

Q: “46.0” as version < “46.0.1” as version
A: False

I going to file a bug request.

Its still on the list and there is a bug already and it is an as mentioned in the other forum post

RFE: IBM Ideas