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

Commit 4fcdf7eb by Sushant

Feat(#4953) : Added check for postgres and mariadb EMPTY data

1 parent 351e871b
...@@ -63,7 +63,7 @@ module.exports = function (BaseTypes) { ...@@ -63,7 +63,7 @@ module.exports = function (BaseTypes) {
value = value.buffer(); value = value.buffer();
//MySQL doesn't support POINT EMPTY, https://dev.mysql.com/worklog/task/?id=2381 //MySQL doesn't support POINT EMPTY, https://dev.mysql.com/worklog/task/?id=2381
if(value === null){ if (value === null) {
return null; return null;
} }
......
...@@ -292,11 +292,13 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() { ...@@ -292,11 +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') { if (Support.dialectIsMySQL()) {
// MySQL will return NULL, becuase they lack EMPTY geometry data support. // MySQL will return NULL, becuase they lack EMPTY geometry data support.
expect(users[0].field).to.be.eql(null); expect(users[0].field).to.be.eql(null);
} else if (dialect === 'postgres' || dialect === 'postgres-native') {
//Empty Geometry data [0,0] as per https://trac.osgeo.org/postgis/ticket/1996
expect(users[0].field).to.be.deep.eql({ type: "Point", coordinates: [0,0] });
} else { } else {
//it contains the null GEOMETRY data
expect(users[0].field).to.be.deep.eql(point); 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!