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 cbefbbca
authored
Dec 14, 2015
by
Sushant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix(#4953) : Added failing test
1 parent
48f26b33
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
changelog.md
lib/dialects/mysql/data-types.js
test/integration/data-types.test.js
changelog.md
View file @
cbefbbc
# Future
-
[
FIXED
]
MySQL throws error when null GEOMETRY data results in empty buffer
[
#4953
](
https://github.com/sequelize/sequelize/issues/4953
)
# 3.16.0
# 3.16.0
-
[
ADDED
]
PostgreSQL tsrange (Range of timestamp without time zone) data type support.
-
[
ADDED
]
PostgreSQL tsrange (Range of timestamp without time zone) data type support.
-
[
ADDED
]
hasOne scope support
[
#5113
](
https://github.com/sequelize/sequelize/pull/5113
)
-
[
ADDED
]
hasOne scope support
[
#5113
](
https://github.com/sequelize/sequelize/pull/5113
)
-
[
FIXED
]
attributes from multiple scopes does not merge
[
#4856
](
https://github.com/sequelize/sequelize/issues/4856
)
-
[
FIXED
]
attributes from multiple scopes does not merge
[
#4856
](
https://github.com/sequelize/sequelize/issues/4856
)
-
[
FIXED
]
Support Unicode strings in mssql
[
#3752
](
https://github.com/sequelize/sequelize/issues/3752
)
-
[
FIXED
]
Support Unicode strings in mssql
[
#3752
](
https://github.com/sequelize/sequelize/issues/3752
)
-
[
FIXED
]
Do not inject include twice in
`options.include`
[
#5106
](
https://github.com/sequelize/sequelize/pull/5106
)
-
[
FIXED
]
Do not inject include twice in
`options.include`
[
#5106
](
https://github.com/sequelize/sequelize/pull/5106
)
-
[
FIXED
]
Expand and validate include in
`aggregate`
[
#5106
](
https://github.com/sequelize/sequelize/pull/5106
)
-
[
FIXED
]
Expand and validate include in
`aggregate`
# 3.15.1
# 3.15.1
-
[
FIXED
]
calling Model.update() modifies passed values
[
#4520
](
https://github.com/sequelize/sequelize/issues/4520
)
-
[
FIXED
]
calling Model.update() modifies passed values
[
#4520
](
https://github.com/sequelize/sequelize/issues/4520
)
...
...
lib/dialects/mysql/data-types.js
View file @
cbefbbc
...
@@ -60,8 +60,13 @@ module.exports = function (BaseTypes) {
...
@@ -60,8 +60,13 @@ module.exports = function (BaseTypes) {
});
});
GEOMETRY
.
parse
=
GEOMETRY
.
prototype
.
parse
=
function
(
value
)
{
GEOMETRY
.
parse
=
GEOMETRY
.
prototype
.
parse
=
function
(
value
)
{
value
=
value
.
buffer
();
if
(
value
===
null
)
{
return
null
;
}
// For some reason, discard the first 4 bytes
// For some reason, discard the first 4 bytes
value
=
value
.
buffer
().
slice
(
4
);
value
=
value
.
slice
(
4
);
return
wkx
.
Geometry
.
parse
(
value
).
toGeoJSON
();
return
wkx
.
Geometry
.
parse
(
value
).
toGeoJSON
();
};
};
...
...
test/integration/data-types.test.js
View file @
cbefbbc
...
@@ -273,4 +273,28 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
...
@@ -273,4 +273,28 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
// No dialects actually allow us to identify that we get an enum back..
// No dialects actually allow us to identify that we get an enum back..
testFailure
(
Type
);
testFailure
(
Type
);
});
});
it
(
'should parse an empty GEOMETRY field'
,
function
()
{
var
Type
=
new
Sequelize
.
GEOMETRY
();
if
(
current
.
dialect
.
supports
.
GEOMETRY
)
{
current
.
refreshTypes
();
var
User
=
current
.
define
(
'user'
,
{
field
:
Type
},
{
timestamps
:
false
});
var
point
=
{
type
:
"Point"
,
coordinates
:
[]
};
return
current
.
sync
({
force
:
true
}).
then
(
function
()
{
return
User
.
create
({
//insert a null GEOMETRY type
field
:
point
});
}).
then
(
function
()
{
//This case throw unhandled exception
return
User
.
findAll
();
}).
then
(
function
(
users
){
//it contains the null GEOMETRY data
expect
(
users
[
0
].
field
).
to
.
be
.
null
;
});
}
});
});
});
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