Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11360

Dynamic SQL: DEFAULT as a bind parameter

Details

    Description

      In addition to expressions, we'll allow DEFAULT as a dynamic SQL parameter:

      EXECUTE IMMEDIATE examples

      EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
      EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
      

      PREPARE..EXECUTE examples

      PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
      EXECUTE stmt USING DEFAULT;
      PREPARE stmt FROM  'UPDATE t1 SET a=?';
      EXECUTE stmt USING DEFAULT;
      

      This is for symmetry with the STMT_INDICATOR_DEFAULT indicator in the client-server bind protocol.

      MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to STMT_INDICATOR_INGORE.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            Description We'll allow {{DEFAULT}} as a dynamic SQL parameter:
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.
            We'll allow {{DEFAULT}} as a dynamic SQL parameter:
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Description We'll allow {{DEFAULT}} as a dynamic SQL parameter:
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            In addition to expressions, we'll allow {{DEFAULT}} as a dynamic SQL parameter:
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            bar Alexander Barkov made changes -
            Summary Dynamic SQL: 'INSERT INTO t1 VALUES(?)' USING DEFAULT Dynamic SQL: DEFAULT as a bind parameter
            bar Alexander Barkov made changes -
            Description In addition to expressions, we'll allow {{DEFAULT}} as a dynamic SQL parameter:
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            In addition to expressions, we'll allow {{DEFAULT}} as a dynamic SQL parameter:

            h2. EXECUTE IMMEDIATE examples
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}

            h3. PREPARE..EXECUTE examples
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            bar Alexander Barkov made changes -
            Description In addition to expressions, we'll allow {{DEFAULT}} as a dynamic SQL parameter:

            h2. EXECUTE IMMEDIATE examples
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}

            h3. PREPARE..EXECUTE examples
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            In addition to expressions, we'll allow {{DEFAULT}} as a dynamic SQL parameter:

            h3. EXECUTE IMMEDIATE examples
            {code:sql}
            EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES(?)' USING DEFAULT;
            EXECUTE IMMEDIATE 'UPDATE t1 SET a=?' USING DEFAULT;
            {code}

            h3. PREPARE..EXECUTE examples
            {code:sql}
            PREPARE stmt FROM 'INSERT INTO t1 VALUES(?)';
            EXECUTE stmt USING DEFAULT;
            PREPARE stmt FROM 'UPDATE t1 SET a=?';
            EXECUTE stmt USING DEFAULT;
            {code}

            This is for symmetry with the {{STMT_INDICATOR_DEFAULT}} indicator in the client-server bind protocol.

            MDEV-11359 will also use this MDEV to add INGORE as another possible bind parameter, equal to {{STMT_INDICATOR_INGORE}}.
            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]

            OK to push after adding DBUG_ASSERT as we agreed.

            sanja Oleksandr Byelkin added a comment - OK to push after adding DBUG_ASSERT as we agreed.
            bar Alexander Barkov made changes -
            Assignee Oleksandr Byelkin [ sanja ] Alexander Barkov [ bar ]
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2016-11-27 14:22:27.0 2016-11-27 14:22:27.907
            bar Alexander Barkov made changes -
            Fix Version/s 10.2.3 [ 22115 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 78462 ] MariaDB v4 [ 133013 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.