Socket
Socket
Sign inDemoInstall

mysql2

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql2 - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

test/integration/connection/test-null.js

6

Changelog.md
// top version is work in progres
0.9.2
0.9.3
- Multiple results support in binary protocol #27
- Apply timezone from config to DATETIME values with no tz #15
0.9.2
- correctly parse NULL result for string and number #35 0a4ac65ec812f75861dc00c9243921d5d6602914
- do not pollute global namespace from evaled parser #11 4b6ddaf0f70150945d0fea804db9106f343a0e51
0.9.1

@@ -7,0 +11,0 @@ - PoolClaster ported from node-mysql #34

2

examples/simple-select.js
var mysql = require('../test/common').createConnection();
mysql.query("select * from foos limit 10", function(err, rows, fields) {
mysql.query("SELECT cast(NULL AS SIGNED)", function(err, rows, fields) {
console.log(rows, fields);
});

@@ -12,3 +12,3 @@ var FieldFlags = require('./constants/field_flags');

var nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8);
result.push('function BinaryRow(packet) {');
result.push('(function(){ return function BinaryRow(packet) {');
result.push(' var statusByte = packet.readInt8();');

@@ -39,3 +39,3 @@ for (j=0; j < nullBitmapLength; ++j)

}
result.push('} BinaryRow;');
result.push('}; })()');
var src = result.join('\n');

@@ -42,0 +42,0 @@ return vm.runInThisContext(src);

@@ -10,7 +10,7 @@ var Types = require('./constants/types');

result.push('function TextRow(packet) {');
result.push('(function() { return function TextRow(packet) {');
for (i = 0; i < fields.length; i++) {
result.push(' this['+ srcEscape(fields[i].name) + '] = ' + readCodeFor(fields[i].columnType, fields[i].characterSet));
}
result.push('} TextRow;');
result.push('};})()');
var src = result.join('\n');

@@ -17,0 +17,0 @@ return vm.runInThisContext(src);

@@ -199,4 +199,4 @@ //var BigNumber = require("bignumber.js");

// TODO: check manually first byte here to avoid polymorphic return type?
//if (len === null)
// return null;
if (len === null)
return null;
this.offset += len;

@@ -232,2 +232,6 @@ return this.buffer.utf8Slice(this.offset - len, this.offset);

Packet.prototype.parseInt = function(len) {
if (len === null)
return null;
var result = 0;

@@ -234,0 +238,0 @@ var end = this.offset + len;

{
"name": "mysql2",
"version": "0.9.1",
"version": "0.9.2",
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc