Details

    • Technical task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • OTHER

    Description

      Add support for basic functionality for TYPE .. OBJECT.

      Under terms of this tasks we'll implement declaration of objects with members only. Objects with methods are out of scope of this task.

      This task will however include implementations of simple constructors to initialize members

        var struct_a_b_t:= struct_a_b_t(1,2);
      

      Example

      Creating an object data type and a corresponding table type.

      DROP TYPE struct_a_b_t;
      CREATE TYPE struct_a_b_t AS OBJECT
      (
        a INT,
        b INT 
      );
      / 
      DROP TYPE table_of_struct_a_b_t;
      CREATE TYPE table_of_struct_a_b_t AS TABLE OF struct_a_b_t;
      /
      

      Using the new data types:

      DROP FUNCTION f1;
      CREATE FUNCTION f1 RETURN INT
      AS
        tbl table_of_struct_a_b_t:= table_of_struct_a_b_t();
        rec struct_a_b_t:= struct_a_b_t(10,1);
        a INT;
      BEGIN   
        tbl.extend;
        tbl(1) := rec;
        tbl.extend;   
        tbl(2) := struct_a_b_t(20,2);
        SELECT SUM(a+b) INTO a FROM TABLE(tbl);
        RETURN a;
      END;
      /   
      SELECT f1() FROM DUAL;
      

            F1()
      ----------
      	33
      

      Dropping the data types:

      DROP TYPE table_of_struct_a_b_t;
      DROP TYPE struct_a_b_t;
      

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            Description Add support for basic functionality for {{TYPE .. OBJECT}}.

            Under terms of this tasks we'll implement declaration of objects with members only. Objects with methods are out of scope of this task.

            h2. Example
            Creating an object data type and a corresponding table type.
            {code:sql}
            DROP TYPE struct_a_b_t;
            CREATE TYPE struct_a_b_t AS OBJECT
            (
              a INT,
              b INT
            );
            /
            DROP TYPE table_of_struct_a_b_t;
            CREATE TYPE table_of_struct_a_b_t AS TABLE OF struct_a_b_t;
            /
            {code}

            Using the new data types:
            {code:sql}
            DROP FUNCTION f1;
            CREATE FUNCTION f1 RETURN INT
            AS
              tbl table_of_struct_a_b_t:= table_of_struct_a_b_t();
              rec struct_a_b_t:= struct_a_b_t(10,1);
              a INT;
            BEGIN
              tbl.extend;
              tbl(1) := rec;
              tbl.extend;
              tbl(2) := struct_a_b_t(20,2);
              SELECT SUM(a+b) INTO a FROM TABLE(tbl);
              RETURN a;
            END;
            /
            SELECT f1() FROM DUAL;
            {code}
            {noformat}
                  F1()
            ----------
            33
            {noformat}

            Dropping the data types:
            {code:sql}
            DROP TYPE table_of_struct_a_b_t;
            DROP TYPE struct_a_b_t;
            {code}
            Add support for basic functionality for {{TYPE .. OBJECT}}.

            Under terms of this tasks we'll implement declaration of objects with members only. Objects with methods are out of scope of this task.

            This task will however include simple constructors to initialize members
            {code:sql}
              var struct_a_b_t:= struct_a_b_t(1,2);
            {code}


            h2. Example
            Creating an object data type and a corresponding table type.
            {code:sql}
            DROP TYPE struct_a_b_t;
            CREATE TYPE struct_a_b_t AS OBJECT
            (
              a INT,
              b INT
            );
            /
            DROP TYPE table_of_struct_a_b_t;
            CREATE TYPE table_of_struct_a_b_t AS TABLE OF struct_a_b_t;
            /
            {code}

            Using the new data types:
            {code:sql}
            DROP FUNCTION f1;
            CREATE FUNCTION f1 RETURN INT
            AS
              tbl table_of_struct_a_b_t:= table_of_struct_a_b_t();
              rec struct_a_b_t:= struct_a_b_t(10,1);
              a INT;
            BEGIN
              tbl.extend;
              tbl(1) := rec;
              tbl.extend;
              tbl(2) := struct_a_b_t(20,2);
              SELECT SUM(a+b) INTO a FROM TABLE(tbl);
              RETURN a;
            END;
            /
            SELECT f1() FROM DUAL;
            {code}
            {noformat}
                  F1()
            ----------
            33
            {noformat}

            Dropping the data types:
            {code:sql}
            DROP TYPE table_of_struct_a_b_t;
            DROP TYPE struct_a_b_t;
            {code}
            bar Alexander Barkov made changes -
            Description Add support for basic functionality for {{TYPE .. OBJECT}}.

            Under terms of this tasks we'll implement declaration of objects with members only. Objects with methods are out of scope of this task.

            This task will however include simple constructors to initialize members
            {code:sql}
              var struct_a_b_t:= struct_a_b_t(1,2);
            {code}


            h2. Example
            Creating an object data type and a corresponding table type.
            {code:sql}
            DROP TYPE struct_a_b_t;
            CREATE TYPE struct_a_b_t AS OBJECT
            (
              a INT,
              b INT
            );
            /
            DROP TYPE table_of_struct_a_b_t;
            CREATE TYPE table_of_struct_a_b_t AS TABLE OF struct_a_b_t;
            /
            {code}

            Using the new data types:
            {code:sql}
            DROP FUNCTION f1;
            CREATE FUNCTION f1 RETURN INT
            AS
              tbl table_of_struct_a_b_t:= table_of_struct_a_b_t();
              rec struct_a_b_t:= struct_a_b_t(10,1);
              a INT;
            BEGIN
              tbl.extend;
              tbl(1) := rec;
              tbl.extend;
              tbl(2) := struct_a_b_t(20,2);
              SELECT SUM(a+b) INTO a FROM TABLE(tbl);
              RETURN a;
            END;
            /
            SELECT f1() FROM DUAL;
            {code}
            {noformat}
                  F1()
            ----------
            33
            {noformat}

            Dropping the data types:
            {code:sql}
            DROP TYPE table_of_struct_a_b_t;
            DROP TYPE struct_a_b_t;
            {code}
            Add support for basic functionality for {{TYPE .. OBJECT}}.

            Under terms of this tasks we'll implement declaration of objects with members only. Objects with methods are out of scope of this task.

            This task will however include implementations of simple constructors to initialize members
            {code:sql}
              var struct_a_b_t:= struct_a_b_t(1,2);
            {code}


            h2. Example
            Creating an object data type and a corresponding table type.
            {code:sql}
            DROP TYPE struct_a_b_t;
            CREATE TYPE struct_a_b_t AS OBJECT
            (
              a INT,
              b INT
            );
            /
            DROP TYPE table_of_struct_a_b_t;
            CREATE TYPE table_of_struct_a_b_t AS TABLE OF struct_a_b_t;
            /
            {code}

            Using the new data types:
            {code:sql}
            DROP FUNCTION f1;
            CREATE FUNCTION f1 RETURN INT
            AS
              tbl table_of_struct_a_b_t:= table_of_struct_a_b_t();
              rec struct_a_b_t:= struct_a_b_t(10,1);
              a INT;
            BEGIN
              tbl.extend;
              tbl(1) := rec;
              tbl.extend;
              tbl(2) := struct_a_b_t(20,2);
              SELECT SUM(a+b) INTO a FROM TABLE(tbl);
              RETURN a;
            END;
            /
            SELECT f1() FROM DUAL;
            {code}
            {noformat}
                  F1()
            ----------
            33
            {noformat}

            Dropping the data types:
            {code:sql}
            DROP TYPE table_of_struct_a_b_t;
            DROP TYPE struct_a_b_t;
            {code}
            monty Michael Widenius made changes -
            monty Michael Widenius made changes -
            monty Michael Widenius made changes -
            monty Michael Widenius made changes -
            Parent MDEV-10142 [ 56873 ]
            Issue Type Task [ 3 ] Technical task [ 7 ]
            monty Michael Widenius made changes -
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            serg Sergei Golubchik made changes -
            Labels Compatibility
            bar Alexander Barkov made changes -
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility Compatibility NRE-307517
            alvinr Alvin Richards (Inactive) made changes -
            NRE Projects NRE-307517
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility NRE-307517 Compatibility
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -

            Should probably be 10.3

            elenst Elena Stepanova added a comment - Should probably be 10.3
            bar Alexander Barkov made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.2 [ 14601 ]
            alvinr Alvin Richards (Inactive) made changes -
            Parent MDEV-10142 [ 56873 ] MDEV-10764 [ 57940 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3 [ 22126 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Support case ID not-26307
            ralf.gebhardt Ralf Gebhardt made changes -
            NRE Projects AC-2610/DEFERRED
            jira-update-service Jira Update Service made changes -
            Support case ID 26767 not-26307 not-26307 not-26767
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 76699 ] MariaDB v4 [ 140043 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 128135

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.