sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node
Apache License 2.0
38 stars 36 forks source link

Missing break in switch-case. #1

Closed bostrt closed 10 years ago

bostrt commented 10 years ago

Fixed issue resulting in segfault and sometimes incorrect result set mapping.

To reproduce before you merge...

Incorrect result map:

var sqlanywhere = require('sqlanywhere');
var conn = sqlanywhere.createConnection();
conn.connect({host: 'xxxx', uid: 'xxxx', pwd: 'xxxx'}, function() {
    console.log(conn.exec('select 1 as a, 2 as b, null as c, 1 as d'));
    conn.disconnect();
});
// Prints [ { a: 1, b: 2, c: 1, d: null } ].....Note the null is associated with "d" now.

Segfault

var sqlanywhere = require('sqlanywhere');
var conn = sqlanywhere.createConnection();
conn.connect({host: 'xxxx', uid: 'xxxx', pwd: 'xxxx'}, function() {
    console.log(conn.exec('select 1, null, null'));
    conn.disconnect();
});

I tried running these tests against SQL Anywhere 10.0.1.3960 and 12.0.1.3873.

NeWbLt123 commented 10 years ago

Nice!

efarrar commented 10 years ago

Fixed.

NeWbLt123 commented 10 years ago

Are you going to update the npm module?

efarrar commented 10 years ago

Yes. First incorporating a fix for https://github.com/sqlanywhere/node-sqlanywhere/issues/2, and then will update npm module.

NeWbLt123 commented 10 years ago

Awesome, thank you!

NeWbLt123 commented 10 years ago

Any chance you will update the npm module soon please?

efarrar commented 10 years ago

Done. 1.0.3 has been published including all fixes on npm.

Sorry for the delay. I wanted to do some additional testing to make sure that the fix for #3 did not cause any unexpected behavior.

NeWbLt123 commented 10 years ago

Thanks and keep up the great work ! ^_^