You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access denied errors (and possibly others) stop callbacks from being called, but only after some time has passed. That is:
expected: When connecting badly, the first query calls back with an error. expected: If I query again (within the same stack frame), the callback gets an error. expected: If I query again (soon, in a different stack frame), the callback gets an error. unexpected: If I query yet again (some time later, in a different stack frame), the callback is never called.
Here is a simple script illustrating the problem. Note that the connection options are supposed to be nonsense, to cause the access denied error.
"use strict";
let mysql = require( "mysql" );
let db = mysql.createConnection( {
user: "foo",
database: "bar",
} );
function oops()
{
db.query( "SELECT 1",
function( err, v )
{
console.log( "error is", err );
} );
}
oops();
oops();
process.nextTick( oops );
setTimeout( oops, 200 );
Access denied errors (and possibly others) stop callbacks from being called, but only after some time has passed. That is:
expected: When connecting badly, the first query calls back with an error.
expected: If I query again (within the same stack frame), the callback gets an error.
expected: If I query again (soon, in a different stack frame), the callback gets an error.
unexpected: If I query yet again (some time later, in a different stack frame), the callback is never called.
Here is a simple script illustrating the problem. Note that the connection options are supposed to be nonsense, to cause the access denied error.
expected: 4x access denied
actual: 3x access denied
The text was updated successfully, but these errors were encountered: