Class VarlenaUDTTest

  • All Implemented Interfaces:

    @SQLAction(requires="varlena UDT",
               install="  SELECT CASE v::text = v::javatest.VarlenaUDTTest::text    WHEN true THEN javatest.logmessage(\'INFO\', \'works for \' || v)    ELSE javatest.logmessage(\'WARNING\', \'fails for \' || v)    END    FROM (VALUES ((\'32767\')), ((\'32768\')), ((\'65536\')), ((\'1048576\')))    AS t ( v )")
             provides="varlena UDT")
    public class VarlenaUDTTest
    extends Object
    implements SQLData
    A User Defined Type with varlena storage, testing github issue 52. This looks from SQL like an integer type, but is stored in unary: the integer value n is represented by n a characters. That makes it easy to test how big a value gets correctly stored and retrieved. It should be about a GB, but in issue 52 was failing at 32768 because of a narrowing assignment in the native code.

    This example relies on implementor tags reflecting the PostgreSQL version, set up in the ConditionalDDR example.