Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-113

return output parameter of stored procedure

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • None
    • N/A
    • documentation
    • None

    Description

      Actual implementation permit stored procedure with output parameters only if passing parameters, and not retuning those immediately.

      Actual will permits that in multiple commands, defining user variables first, then asking for them again:

      con.query('CREATE OR REPLACE PROCEDURE ' +
              'multiplyBy2 (IN p1 INT, OUT p2 INT) ' +
              'begin ' +
              'set p2 = p1 * 2; ' +
              'end')
            .then(() => {
              return con.query('SET @val=10')
            })
            .then(() => {
              con.query('call multiplyBy2(?,@val)', [2])
            })
            .then(() => {
              return conn.query('SELECT @val')
            })
            .then(rows => {
              assert.equal(rows[0]['@val'], 4)
              done()
            })
            .catch(done)
      

      This is not a simple task for now, since only text protocol is implemented, and this doesn't permit returning output parameters (MDEV-12400) This will need binary protocol implementation.

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.