Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
None
-
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.