Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed empty blob #9441

Merged
merged 2 commits into from May 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 0 additions & 17 deletions lib/dialects/mysql/data-types.js
Expand Up @@ -36,22 +36,6 @@ module.exports = BaseTypes => {
BaseTypes.GEOMETRY.types.mysql = ['GEOMETRY'];
BaseTypes.JSON.types.mysql = ['JSON'];

function BLOB(length) {
if (!(this instanceof BLOB)) return new BLOB(length);
BaseTypes.BLOB.apply(this, arguments);
}
inherits(BLOB, BaseTypes.BLOB);

BLOB.parse = function(value, options, next) {
const data = next();

if (Buffer.isBuffer(data) && data.length === 0) {
return null;
}

return data;
};

function DECIMAL(precision, scale) {
if (!(this instanceof DECIMAL)) return new DECIMAL(precision, scale);
BaseTypes.DECIMAL.apply(this, arguments);
Expand Down Expand Up @@ -195,7 +179,6 @@ module.exports = BaseTypes => {
UUID,
GEOMETRY,
DECIMAL,
BLOB,
JSON: JSONTYPE
};

Expand Down