File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ es7 async/await:
57
57
let mysql = require (' mysql2/promise' );
58
58
let conn = await mysql .createConnection ({ database: test });
59
59
let [rows, fields] = await conn .execute (' select ?+? as sum' , [2 , 2 ]);
60
- let pool = mysql .createPool ();
60
+ let pool = mysql .createPool (conn );
61
61
// execute in parallel, next console.log in 3 seconds
62
62
await Promise .all ([pool .query (' select sleep(2)' ), pool .query (' select sleep(3)' )]);
63
63
console .log (' 3 seconds after' );
@@ -105,7 +105,7 @@ var conn = mysql.createConnection({
105
105
// continue handshake by sending response data
106
106
// respond with error to propagate error to connect/changeUser handlers
107
107
cb (null , response);
108
- })
108
+ })
109
109
}
110
110
}
111
111
});
You can’t perform that action at this time.
0 commit comments