Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.5.2
    • 5.4.1
    • PrimProc
    • None

    Description

      the distributed Function Insert doesn't do anything if you ask to insert at position 1. It needs a simple switch of the lines that test for negative index and the one that converts the position from 1 based to 0 based.

      Attachments

        Issue Links

          Activity

            dleeyh Daniel Lee (Inactive) added a comment - - edited

            Build verified: 1.5.3-1 (drone build #287)

            Reproduced the issue in 1.5.2-1

            MariaDB [mytest]> create table t1 (c1 int, c2 char(20)) engine=columnstore;
            Query OK, 0 rows affected (0.175 sec)

            MariaDB [mytest]> insert into t1 values (50, 'Hawaii');
            Query OK, 1 row affected (0.285 sec)

            MariaDB [mytest]> select * from t1;
            ------------+

            c1 c2

            ------------+

            50 Hawaii

            ------------+
            1 row in set (0.100 sec)

            MariaDB [mytest]> select c1, insert(c2,1,5,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,1,5,'aloha')

            ----------------------------+

            50 Hawaii

            ----------------------------+
            1 row in set (0.020 sec)

            Verified fix in 1.5.3-1

            MariaDB [mytest]> create table t1 (c1 int, c2 char(20)) engine=columnstore;
            Query OK, 0 rows affected (0.230 sec)

            MariaDB [mytest]> insert into t1 values (50, 'Hawaii');
            Query OK, 1 row affected (0.375 sec)

            MariaDB [mytest]> select c1, insert(c2,1,5,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,1,5,'aloha')

            ----------------------------+

            50 alohai

            ----------------------------+
            1 row in set (0.097 sec)

            MariaDB [mytest]> select c1, insert(c2,1,3,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,1,3,'aloha')

            ----------------------------+

            50 alohaaii

            ----------------------------+
            1 row in set (0.022 sec)

            MariaDB [mytest]> select c1, insert(c2,2,3,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,2,3,'aloha')

            ----------------------------+

            50 Halohaii

            ----------------------------+
            1 row in set (0.018 sec)

            dleeyh Daniel Lee (Inactive) added a comment - - edited Build verified: 1.5.3-1 (drone build #287) Reproduced the issue in 1.5.2-1 MariaDB [mytest] > create table t1 (c1 int, c2 char(20)) engine=columnstore; Query OK, 0 rows affected (0.175 sec) MariaDB [mytest] > insert into t1 values (50, 'Hawaii'); Query OK, 1 row affected (0.285 sec) MariaDB [mytest] > select * from t1; ----- -------+ c1 c2 ----- -------+ 50 Hawaii ----- -------+ 1 row in set (0.100 sec) MariaDB [mytest] > select c1, insert(c2,1,5,'aloha') from t1; ----- -----------------------+ c1 insert(c2,1,5,'aloha') ----- -----------------------+ 50 Hawaii ----- -----------------------+ 1 row in set (0.020 sec) Verified fix in 1.5.3-1 MariaDB [mytest] > create table t1 (c1 int, c2 char(20)) engine=columnstore; Query OK, 0 rows affected (0.230 sec) MariaDB [mytest] > insert into t1 values (50, 'Hawaii'); Query OK, 1 row affected (0.375 sec) MariaDB [mytest] > select c1, insert(c2,1,5,'aloha') from t1; ----- -----------------------+ c1 insert(c2,1,5,'aloha') ----- -----------------------+ 50 alohai ----- -----------------------+ 1 row in set (0.097 sec) MariaDB [mytest] > select c1, insert(c2,1,3,'aloha') from t1; ----- -----------------------+ c1 insert(c2,1,3,'aloha') ----- -----------------------+ 50 alohaaii ----- -----------------------+ 1 row in set (0.022 sec) MariaDB [mytest] > select c1, insert(c2,2,3,'aloha') from t1; ----- -----------------------+ c1 insert(c2,2,3,'aloha') ----- -----------------------+ 50 Halohaii ----- -----------------------+ 1 row in set (0.018 sec)

            Restested in 1.5.3-1 (drone #280)

            It is also fixed in build #280

            dleeyh Daniel Lee (Inactive) added a comment - Restested in 1.5.3-1 (drone #280) It is also fixed in build #280

            David.Hall Is there a test case that dleeyh can use for testing, that demonstrates the fix applied by the PR for this issue?

            tntnatbry Gagan Goel (Inactive) added a comment - David.Hall Is there a test case that dleeyh can use for testing, that demonstrates the fix applied by the PR for this issue?

            Build verified: 1.5.4-1 (Drone #496)

            Additional tests:

            MariaDB [mytest]> select c1, insert(c2,-1,3,'aloha') from t1;
            -----------------------------+

            c1 insert(c2,-1,3,'aloha')

            -----------------------------+

            50 Hawaii

            -----------------------------+
            1 row in set (0.050 sec)

            MariaDB [mytest]> select c1, insert(c2,0,3,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,0,3,'aloha')

            ----------------------------+

            50 Hawaii

            ----------------------------+
            1 row in set (0.019 sec)

            MariaDB [mytest]> select c1, insert(c2,6,3,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,6,3,'aloha')

            ----------------------------+

            50 Hawaialoha

            ----------------------------+
            1 row in set (0.021 sec)

            MariaDB [mytest]> select c1, insert(c2,7,3,'aloha') from t1;
            ----------------------------+

            c1 insert(c2,7,3,'aloha')

            ----------------------------+

            50 Hawaii

            ----------------------------+
            1 row in set (0.017 sec)

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: 1.5.4-1 (Drone #496) Additional tests: MariaDB [mytest] > select c1, insert(c2,-1,3,'aloha') from t1; ----- ------------------------+ c1 insert(c2,-1,3,'aloha') ----- ------------------------+ 50 Hawaii ----- ------------------------+ 1 row in set (0.050 sec) MariaDB [mytest] > select c1, insert(c2,0,3,'aloha') from t1; ----- -----------------------+ c1 insert(c2,0,3,'aloha') ----- -----------------------+ 50 Hawaii ----- -----------------------+ 1 row in set (0.019 sec) MariaDB [mytest] > select c1, insert(c2,6,3,'aloha') from t1; ----- -----------------------+ c1 insert(c2,6,3,'aloha') ----- -----------------------+ 50 Hawaialoha ----- -----------------------+ 1 row in set (0.021 sec) MariaDB [mytest] > select c1, insert(c2,7,3,'aloha') from t1; ----- -----------------------+ c1 insert(c2,7,3,'aloha') ----- -----------------------+ 50 Hawaii ----- -----------------------+ 1 row in set (0.017 sec)

            For 1.5.4, test for the last char in the field and last +1.

            select insert(c2,6,5,'aloha') from t1;
            ------------------------

            insert(c2,6,5,'aloha')

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

            Hawaialoha

            ------------------------
            1 row in set (0.028 sec)

            select insert(c2,7,5,'aloha') from t1;
            ------------------------

            insert(c2,7,5,'aloha')

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

            Hawaii

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

            David.Hall David Hall (Inactive) added a comment - For 1.5.4, test for the last char in the field and last +1. select insert(c2,6,5,'aloha') from t1; ------------------------ insert(c2,6,5,'aloha') ------------------------ Hawaialoha ------------------------ 1 row in set (0.028 sec) select insert(c2,7,5,'aloha') from t1; ------------------------ insert(c2,7,5,'aloha') ------------------------ Hawaii ------------------------

            People

              dleeyh Daniel Lee (Inactive)
              David.Hall David Hall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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