Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-1007

LP Bug: 1421438 - UDF: showddl does not work for UDFs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1 (pre-incubation)
    • sql-cmu
    • None

    Description

      Showddl is supposed to be enhanced for supporting UDF. But it does not work right now, as shown below. This is seen on the v0210
      build installed on a workstation.

      To reproduce this problem:

      (1) Download the attached tar file and untar it to get the 4 files in there. Put the 4 files in any directory <mydir>
      (2) Run build.sh from <mydir> to build the UDF so file.
      (3) Change the line ‘create library qa_udf_lib file '<mydir>/myudf.so'; in mytest.sql and fill in <mydir>
      (4) From sqlci, obey mytest.sql

      -------------------------------------------

      >>obey mytest.sql;
      >>create schema mytest;

      — SQL operation complete.
      >>set schema mytest;

      — SQL operation complete.
      >>
      >>create library qa_udf_lib file '<mydir>/myudf.so';

      — SQL operation complete.
      >>
      >>create function MYUDF
      +>(INVAL int)
      +>returns (OUTVAL int)
      +>language c
      +>parameter style sql
      +>external name 'myudf'
      +>library qa_udf_lib
      +>deterministic
      +>state area size 1024
      +>allow any parallelism
      +>no sql;

      — SQL operation complete.
      >>
      >>create table mytable (a int, b int);

      — SQL operation complete.
      >>insert into mytable values (1,1);

      — 1 row(s) inserted.
      >>
      >>select myudf(a) from mytable;

      OUTVAL
      -----------

      1

      — 1 row(s) selected.
      >>
      >>showddl function myudf;

          • ERROR[1389] Object MYUDF does not exist in Trafodion.
          • ERROR[4082] Object TRAFODION.MYTEST.MYUDF does not exist or is inaccessible.

      — SQL operation failed with errors.
      >>showddl myudf;

          • ERROR[1389] Object MYUDF does not exist in Trafodion.
          • ERROR[4082] Object TRAFODION.MYTEST.MYUDF does not exist or is inaccessible.

      — SQL operation failed with errors.
      >>showddl schema mytest;

      CREATE PRIVATE SCHEMA "TRAFODION"."MYTEST" AUTHORIZATION "DB__ROOT";

      — SQL operation complete.
      >>get functions;

      Functions in Schema TRAFODION.MYTEST
      ====================================

      MYUDF

      — SQL operation complete.
      >>
      >>drop schema mytest cascade;

      — SQL operation complete.

      Attachments

        Activity

          People

            suresh_subbiah Suresh Subbiah
            WTsai Weishiun Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: