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 9c50f794
authored
Oct 07, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added send method + lowercased sql queries before checking of several parts
1 parent
a35ed080
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
lib/dialects/abstract/query.js
lib/dialects/abstract/query.js
View file @
9c50f79
...
...
@@ -116,6 +116,17 @@ module.exports = (function() {
return
this
}
/**
* This function is a wrapper for private methods.
*
* @param {String} fctName The name of the private method.
*
*/
AbstractQuery
.
prototype
.
send
=
function
(
fctName
/*, arg1, arg2, arg3, ...*/
)
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
).
slice
(
1
)
return
eval
(
fctName
).
apply
(
this
,
args
)
}
/////////////
// private //
/////////////
...
...
@@ -132,8 +143,8 @@ module.exports = (function() {
var
isInsertQuery
=
function
(
results
)
{
var
result
=
!!
this
.
callee
result
=
result
&&
(
this
.
sql
.
indexOf
(
'INSERT INTO
'
)
===
0
)
result
=
result
&&
results
.
hasOwnProperty
(
'insertId'
)
result
=
result
&&
(
this
.
sql
.
toLowerCase
().
indexOf
(
'insert into
'
)
===
0
)
result
=
result
&&
!!
results
&&
results
.
hasOwnProperty
(
'insertId'
)
return
result
}
...
...
@@ -145,7 +156,7 @@ module.exports = (function() {
}
var
isShowTableQuery
=
function
()
{
return
(
this
.
sql
.
indexOf
(
'SHOW TABLES
'
)
===
0
)
return
(
this
.
sql
.
toLowerCase
().
indexOf
(
'show tables
'
)
===
0
)
}
var
handleShowTableQuery
=
function
(
results
)
{
...
...
@@ -155,7 +166,11 @@ module.exports = (function() {
}
var
isSelectQuery
=
function
()
{
return
(
this
.
sql
.
indexOf
(
'SELECT'
)
===
0
)
return
(
this
.
sql
.
toLowerCase
().
indexOf
(
'select'
)
===
0
)
}
var
isUpdateQuery
=
function
()
{
return
(
this
.
sql
.
toLowerCase
().
indexOf
(
'update'
)
===
0
)
}
var
handleSelectQuery
=
function
(
results
)
{
...
...
@@ -213,7 +228,12 @@ module.exports = (function() {
}
var
isShowOrDescribeQuery
=
function
()
{
return
(
this
.
sql
.
indexOf
(
'SHOW'
)
===
0
)
||
(
this
.
sql
.
indexOf
(
'DESCRIBE'
)
===
0
)
var
result
=
false
result
=
result
||
(
this
.
sql
.
toLowerCase
().
indexOf
(
'show'
)
===
0
)
result
=
result
||
(
this
.
sql
.
toLowerCase
().
indexOf
(
'describe'
)
===
0
)
return
result
}
...
...
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