test-select-1.js 445 B

12345678910111213141516171819202122
  1. var common = require('../../common');
  2. var connection = common.createConnection();
  3. var assert = require('assert');
  4. connection.connect();
  5. var rows = undefined;
  6. var fields = undefined;
  7. connection.query('SELECT 1', function(err, _rows, _fields) {
  8. if (err) throw err;
  9. rows = _rows;
  10. fields = _fields;
  11. });
  12. connection.end();
  13. process.on('exit', function() {
  14. assert.deepEqual(rows, [{1: 1}]);
  15. assert.equal(fields[0].name, '1');
  16. });