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 197aace8
authored
Jul 18, 2012
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed wrong single quote escaping
1 parent
6ded23fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
spec-jasmine/postgres/query-generator.spec.js
spec-jasmine/postgres/query-generator.spec.js
View file @
197aace
...
@@ -43,7 +43,7 @@ describe('QueryGenerator', function() {
...
@@ -43,7 +43,7 @@ describe('QueryGenerator', function() {
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo';"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo';"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE myTable;"
}}],
arguments
:
[
'myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE myTable;"
}}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo
\\
';DROP TABLE myTable;';"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo
'
';DROP TABLE myTable;';"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
2
}],
arguments
:
[
'myTable'
,
{
where
:
2
}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"id\"=2;"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"id\"=2;"
...
@@ -78,7 +78,7 @@ describe('QueryGenerator', function() {
...
@@ -78,7 +78,7 @@ describe('QueryGenerator', function() {
expectation
:
"INSERT INTO \"myTable\" (\"name\") VALUES ('foo') RETURNING *;"
expectation
:
"INSERT INTO \"myTable\" (\"name\") VALUES ('foo') RETURNING *;"
},
{
},
{
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
}],
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
}],
expectation
:
"INSERT INTO \"myTable\" (\"name\") VALUES ('foo
\\
';DROP TABLE myTable;') RETURNING *;"
expectation
:
"INSERT INTO \"myTable\" (\"name\") VALUES ('foo
'
';DROP TABLE myTable;') RETURNING *;"
},
{
},
{
arguments
:
[
'myTable'
,
{
name
:
'foo'
,
birthday
:
new
Date
(
Date
.
UTC
(
2011
,
2
,
27
,
10
,
1
,
55
))}],
arguments
:
[
'myTable'
,
{
name
:
'foo'
,
birthday
:
new
Date
(
Date
.
UTC
(
2011
,
2
,
27
,
10
,
1
,
55
))}],
expectation
:
"INSERT INTO \"myTable\" (\"name\",\"birthday\") VALUES ('foo','2011-03-27 10:01:55.0') RETURNING *;"
expectation
:
"INSERT INTO \"myTable\" (\"name\",\"birthday\") VALUES ('foo','2011-03-27 10:01:55.0') RETURNING *;"
...
@@ -115,7 +115,7 @@ describe('QueryGenerator', function() {
...
@@ -115,7 +115,7 @@ describe('QueryGenerator', function() {
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2 WHERE \"name\"='foo'"
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2 WHERE \"name\"='foo'"
},
{
},
{
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
},
{
name
:
'foo'
}],
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
},
{
name
:
'foo'
}],
expectation
:
"UPDATE \"myTable\" SET \"name\"='foo
\\
';DROP TABLE myTable;' WHERE \"name\"='foo'"
expectation
:
"UPDATE \"myTable\" SET \"name\"='foo
'
';DROP TABLE myTable;' WHERE \"name\"='foo'"
},
{
},
{
arguments
:
[
'myTable'
,
{
bar
:
2
,
nullValue
:
null
},
{
name
:
'foo'
}],
arguments
:
[
'myTable'
,
{
bar
:
2
,
nullValue
:
null
},
{
name
:
'foo'
}],
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2,\"nullValue\"=NULL WHERE \"name\"='foo'"
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2,\"nullValue\"=NULL WHERE \"name\"='foo'"
...
@@ -131,7 +131,7 @@ describe('QueryGenerator', function() {
...
@@ -131,7 +131,7 @@ describe('QueryGenerator', function() {
arguments
:
[
'myTable'
,
{
bar
:
2
,
nullValue
:
undefined
},
{
name
:
'foo'
}],
arguments
:
[
'myTable'
,
{
bar
:
2
,
nullValue
:
undefined
},
{
name
:
'foo'
}],
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2 WHERE \"name\"='foo'"
,
expectation
:
"UPDATE \"myTable\" SET \"bar\"=2 WHERE \"name\"='foo'"
,
context
:
{
options
:
{
omitNull
:
true
}}
context
:
{
options
:
{
omitNull
:
true
}}
},
},
],
],
deleteQuery
:
[
deleteQuery
:
[
...
@@ -146,7 +146,7 @@ describe('QueryGenerator', function() {
...
@@ -146,7 +146,7 @@ describe('QueryGenerator', function() {
expectation
:
"DELETE FROM \"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"myTable\" WHERE \"id\"=1 LIMIT 10)"
expectation
:
"DELETE FROM \"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"myTable\" WHERE \"id\"=1 LIMIT 10)"
},
{
},
{
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
},
{
limit
:
10
}],
arguments
:
[
'myTable'
,
{
name
:
"foo';DROP TABLE myTable;"
},
{
limit
:
10
}],
expectation
:
"DELETE FROM \"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"myTable\" WHERE \"name\"='foo
\\
';DROP TABLE myTable;' LIMIT 10)"
expectation
:
"DELETE FROM \"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"myTable\" WHERE \"name\"='foo
'
';DROP TABLE myTable;' LIMIT 10)"
}
}
],
],
...
...
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