node-query/node_modules/mysql2/test/integration/connection/test-select-utf8mb4.js

19 lines
608 B
JavaScript
Raw Normal View History

var common = require('../../common');
var connection = common.createConnection({charset: 'UTF8MB4_GENERAL_CI'});
var assert = require('assert');
var rows = undefined;
var fields = undefined;
var multibyteText = '𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 ';
connection.query("SELECT '" + multibyteText + "'", function(err, _rows, _fields) {
if (err) throw err;
rows = _rows;
fields = _fields;
2015-01-28 15:33:44 -05:00
connection.end();
});
process.on('exit', function() {
assert.equal(rows[0][multibyteText], multibyteText);
assert.equal(fields[0].name, multibyteText);
});