Skip to content

Instantly share code, notes, and snippets.

@wzrdtales
Created September 28, 2015 18:45
Show Gist options
  • Save wzrdtales/f679c3251ea3488a7fec to your computer and use it in GitHub Desktop.
Save wzrdtales/f679c3251ea3488a7fec to your computer and use it in GitHub Desktop.
test case that proofs that an update never returns any result
var mariasql = require('mariasql');
var connection = new mariasql();
connection.connect({
"host": "localhost",
"port": 3306,
"user": "root",
"password": "fancydancypassword",
"db": "curlydb",
"multiStatements": true
});
connection.on('ready', function() {
connection.query('UPDATE `user` SET time_last_active = NOW() \
WHERE `user`.`id` = ? LIMIT 1', [ 1 ])
.on('result', function(result) {
console.log('got a result!'); //no you dont :(
result.on('data', function(row) {
console.log(row);
})
.on('end', function() {
// we also never reach here?
console.log(result.info);
});
})
.on('end', function() {
console.log(arguments); //nothing here? no its empty :/
});
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment