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 0ddfbc5d
authored
Jan 29, 2016
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5331 from zaggino/master
Properly escape number 0 in query generator
2 parents
cae4d8da
42c07914
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
lib/dialects/abstract/query-generator.js
test/unit/sql/json.test.js
lib/dialects/abstract/query-generator.js
View file @
0ddfbc5
...
...
@@ -954,7 +954,7 @@ var QueryGenerator = {
escape
:
function
(
value
,
field
,
options
)
{
options
=
options
||
{};
if
(
value
)
{
if
(
value
!==
null
&&
value
!==
undefined
)
{
if
(
value
.
_isSequelizeMethod
)
{
return
this
.
handleSequelizeMethod
(
value
);
}
else
{
...
...
test/unit/sql/json.test.js
View file @
0ddfbc5
...
...
@@ -20,11 +20,23 @@ if (current.dialect.supports.JSON) {
});
test
(
'plain int'
,
function
()
{
expectsql
(
sql
.
escape
(
0
,
{
type
:
new
DataTypes
.
JSON
()
}),
{
default
:
'\'0\''
});
expectsql
(
sql
.
escape
(
123
,
{
type
:
new
DataTypes
.
JSON
()
}),
{
default
:
'\'123\''
});
});
test
(
'boolean'
,
function
()
{
expectsql
(
sql
.
escape
(
true
,
{
type
:
new
DataTypes
.
JSON
()
}),
{
default
:
'\'true\''
});
expectsql
(
sql
.
escape
(
false
,
{
type
:
new
DataTypes
.
JSON
()
}),
{
default
:
'\'false\''
});
});
test
(
'NULL'
,
function
()
{
expectsql
(
sql
.
escape
(
null
,
{
type
:
new
DataTypes
.
JSON
()
}),
{
default
:
'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