Opened 5 years ago

Last modified 5 years ago

#2171 closed defect

pow() on struct literal returns random result — at Version 4

Reported by: Dimitar Misev Owned by: apercov
Priority: major Milestone: 10.0
Component: qlparser Version: 9.8
Keywords: Cc:
Complexity: Medium

Description (last modified by apercov)

SELECT power({ 13c, 115c, 212c }, 0us)

result { inf, 1, 1 }

SELECT power({ 13c, 115c, 212c }, 0d)

result { 1, 1, inf }

SELECT pow({ 13c, 115c, 212c }, 0)

result { 1, 1, inf }

I executed the last one 10 times with

for i in $(seq 10); do rasql -q 'SELECT pow({ 13c, 115c, 212c }, 0)' --out string | grep Result; sleep 1; done

and got

  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { -nan, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, 1 }
  Result element 1: { 1, 1, inf }

EDIT: Upon further investigation, the problem is broader, since pow and power do not work with struct as an argument.

Change History (4)

comment:1 by apercov, 5 years ago

Status: newaccepted

comment:2 by apercov, 5 years ago

Note:
The problem is observed only running with rasql. I was unable to replicate the problem using directql.

comment:3 by Dimitar Misev, 5 years ago

So you think the problem happens in rasnetservercomm or rasnetclientcomm?

comment:4 by apercov, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.