Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@databases/mysql

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@databases/mysql - npm Package Compare versions

Comparing version 5.2.0 to 5.2.1-canary-1804

41

lib/__tests__/dates.test.mysql.js

@@ -399,2 +399,43 @@ "use strict";

});
test('timestamp NULL', async () => {
await db.task(async (db) => {
await db.query((0, __1.sql) `SET time_zone = "+00:00";`);
await db.query((0, __1.sql) `
DROP TABLE IF EXISTS dates_test_timestamp_null;
CREATE TABLE dates_test_timestamp_null (
id INT NOT NULL PRIMARY KEY,
a TIMESTAMP NULL DEFAULT NULL
);
`);
const sampleDate = new Date('2000-06-03T05:40:10.123Z');
await db.query((0, __1.sql) `
INSERT INTO dates_test_timestamp_null (id, a)
VALUES (1, ${sampleDate}),
(2, NULL);
`);
expect((await (await rawConnection).query(`SELECT * from dates_test_timestamp_null`))[0]).toEqual([
{
a: '2000-06-03 15:10:10',
id: 1,
},
{
a: null,
id: 2,
},
]);
const result = await db.query((0, __1.sql) `
SELECT * from dates_test_timestamp_null;
`);
expect(result).toEqual([
{
a: new Date('2000-06-03T05:40:10.000Z'),
id: 1,
},
{
a: null,
id: 2,
},
]);
});
});
//# sourceMappingURL=dates.test.mysql.js.map

6

lib/index.js

@@ -122,3 +122,7 @@ "use strict";

var _a, _b;
const match = /^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})\:(\d{2})\:(\d{2})(?:\.(\d+))?$/.exec(f.string());
const fBuffer = f.buffer();
if (fBuffer === null || fBuffer.length === 0) {
return null;
}
const match = /^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})\:(\d{2})\:(\d{2})(?:\.(\d+))?$/.exec(fBuffer.toString());
if (!match) {

@@ -125,0 +129,0 @@ throw new Error('Expected yyyy-mm-dd HH:MM:SS');

12

package.json
{
"name": "@databases/mysql",
"version": "5.2.0",
"version": "5.2.1-canary-1804",
"description": "",

@@ -9,7 +9,7 @@ "main": "./lib/index.js",

"@babel/code-frame": "^7.0.0",
"@databases/escape-identifier": "^1.0.2",
"@databases/mysql-config": "^3.0.0",
"@databases/push-to-async-iterable": "^3.0.0",
"@databases/shared": "^3.0.0",
"@databases/sql": "^3.2.0",
"@databases/escape-identifier": "1.0.3",
"@databases/mysql-config": "3.0.0",
"@databases/push-to-async-iterable": "3.0.0",
"@databases/shared": "3.0.0",
"@databases/sql": "3.2.0",
"@types/mysql": "^2.15.5",

@@ -16,0 +16,0 @@ "mysql2": "^2.2.5"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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