Opened 9 months ago

Closed 8 months ago

#2755 closed defect (fixed)

FIX - rasql - pow should support integer parameter and parentheses

Reported by: Bang Pham Huu Owned by: Dimitar Misev
Priority: major Milestone: 10.2
Component: server Version: 10.2
Keywords: Cc:
Complexity: Medium

Description (last modified by Dimitar Misev)

The pow function currently supports only floating-point exponent, e.g.

SELECT pow(2, 2.0)

It should also support integer type exponents (octet, char, short, ushort, long, ulong), i.e. these shouldn't return an error:

SELECT pow(2, 2o)
SELECT pow(2, 2c)
SELECT pow(2, 2s)
SELECT pow(2, 2us)
SELECT pow(2, 2)
SELECT pow(2, 2ul)

Also, it has trouble parsing exponent expressions, e.g.

SELECT encode(POW(c, ( 2.5 ) ), "png" , "{\"metadata\":{\"resolution\":\"1\"},\"nodata\":[]}") FROM test_mr AS c

with error

rasdaman error 300: Parsing error 300 in line 1, column 22: Unexpected name (

Change History (4)

comment:1 by Dimitar Misev, 8 months ago

Description: modified (diff)
Owner: changed from Dimitar Misev to nivlev@…
Summary: FIX - rasql - pow with parenthesis in second paramter failedFIX - rasql - pow should support integer parameter and parentheses

comment:2 by Dimitar Misev, 8 months ago

For code examples see the implementation of mod.

comment:3 by Dimitar Misev, 8 months ago

Owner: changed from nivlev@… to Dimitar Misev

comment:4 by Dimitar Misev, 8 months ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.