不要怂,就是干,撸起袖子干!

Commit 351e871b by Sushant Committed by Sushant

Fix(#4953) : Return null until MySQL implements EMPTY keyword for WKT

1 parent cbefbbca
...@@ -61,7 +61,9 @@ module.exports = function (BaseTypes) { ...@@ -61,7 +61,9 @@ module.exports = function (BaseTypes) {
GEOMETRY.parse = GEOMETRY.prototype.parse = function(value) { GEOMETRY.parse = GEOMETRY.prototype.parse = function(value) {
value = value.buffer(); value = value.buffer();
if (value === null) {
//MySQL doesn't support POINT EMPTY, https://dev.mysql.com/worklog/task/?id=2381
if(value === null){
return null; return null;
} }
......
...@@ -292,8 +292,13 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() { ...@@ -292,8 +292,13 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
//This case throw unhandled exception //This case throw unhandled exception
return User.findAll(); return User.findAll();
}).then(function(users){ }).then(function(users){
if (dialect === 'mysql') {
// MySQL will return NULL, becuase they lack EMPTY geometry data support.
expect(users[0].field).to.be.eql(null);
} else {
//it contains the null GEOMETRY data //it contains the null GEOMETRY data
expect(users[0].field).to.be.null; expect(users[0].field).to.be.deep.eql(point);
}
}); });
} }
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!