-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
mysql GEOMETRY bug #4953
Copy link
Copy link
Closed
Labels
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).For issues and PRs. Things that involve MySQL (and do not involve all dialects).good first issueFor issues. An issue that is a good choice for first-time contributors.For issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type
Description
https://github.com/sequelize/sequelize/blob/master/lib/dialects/mysql/data-types.js#L64
value.buffer() maybe is null
node_modules/mysql/lib/protocol/Parser.js:82
throw err;
^
TypeError: Cannot read property 'slice' of null
at Object.GEOMETRY.parse.GEOMETRY.parse [as GEOMETRY]
users:
ID: {
type: 'CHAR(36)',
allowNull: false,
defaultValue: '',
primaryKey: true
},
groupID: {
type: type: 'CHAR(36)',
allowNull: false
},
groups:
ID: {
type: 'CHAR(36)',
allowNull: false,
defaultValue: '',
primaryKey: true
},
location: {
type: DataTypes.GEOMETRY,
allowNull: false
}
db.users.belongsTo(db.groups,{foreignKey:'groupID',targetKey:'ID'});
query
let userInfo = yield db.users.findAll({
include: [db.groups]
});
I temporarily fix it
value = value.buffer();
if (value == null) {
return null;
}
value = value.slice(4);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).For issues and PRs. Things that involve MySQL (and do not involve all dialects).good first issueFor issues. An issue that is a good choice for first-time contributors.For issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type