This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/mysql2/test/integration/connection/test-null-int.js

22 lines
529 B
JavaScript
Raw Permalink Normal View History

2014-09-24 17:56:53 -04:00
var common = require('../../common');
var connection = common.createConnection();
var assert = require('assert');
var rows;
connection.query('CREATE TEMPORARY TABLE t (i int)');
connection.query('INSERT INTO t VALUES(null)');
connection.query('INSERT INTO t VALUES(123)');
connection.query('SELECT * from t', function(err, _rows, _fields) {
if (err) throw err;
rows = _rows;
});
connection.end();
process.on('exit', function() {
assert.deepEqual(rows[0], {i: null});
assert.deepEqual(rows[1], {i: 123});
});