Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

2014 error when calling multiple stored procedures #108

Closed
gitawego opened this Issue · 5 comments

2 participants

@gitawego

I got 2014 error when calling a stored procedure in multiple times:
I have script:


test = function(id,callback){
  conn.query('CALL getValues('+id+')',function(err,result){
    while (conn.multiMoreResultsSync()) {
          conn.multiNextResultSync();
     }
    var rows = result.fetchAllSync();
    result.freeSync();
    callback(rows);
  });
};

I don't have such problem in sync mode:


test('test1',function(res){
   console.log(res);
  test('test2',function(res){
    console.log(res);
    test('test3',function(res){
      console.log(res);
    })
  })
})

If I execute this code in async, I'm getting 2014 error.


['test1','test2','test3'].forEach(function(id){
  test(id,function(res){
   console.log(res);  
});
});

any idea ?

@gitawego

the only work around for now is open one connection per CALL then close it after being executed. but it's not a good practice of database... I suppose...

@Sannis
Owner

Looks very close to #106. I'll try to write a test for this and try to fix it ASAP. Thanks for your report, @gitawego.

@gitawego

thanks for your attention, just for info, it happens only when there is SELECT in stored procedure, I don't have such problem if my stored procedure uses only for INSERT or UPDATE.

my code has the similar function like your 2nd example, using SELECT without OUT parameter.

@Sannis
Owner

I'll add some new tests with proper CALL results handling in next commit.

@Sannis Sannis referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@Sannis Sannis was assigned
@Sannis Sannis closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.