Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 4fcdf7eb
authored
Jan 04, 2016
by
Sushant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat(#4953) : Added check for postgres and mariadb EMPTY data
1 parent
351e871b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
lib/dialects/mysql/data-types.js
test/integration/data-types.test.js
lib/dialects/mysql/data-types.js
View file @
4fcdf7e
...
@@ -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
;
}
}
...
...
test/integration/data-types.test.js
View file @
4fcdf7e
...
@@ -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
);
}
}
});
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment