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 dc8f9f3f
authored
May 21, 2013
by
reedog117
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up comments
1 parent
4b153fbe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
47 deletions
lib/dialects/mariadb/connector-manager.js
lib/dialects/mariadb/query.js
lib/dialects/mariadb/connector-manager.js
View file @
dc8f9f3
...
@@ -208,44 +208,13 @@ module.exports = (function() {
...
@@ -208,44 +208,13 @@ module.exports = (function() {
var
disconnect
=
function
(
client
)
{
var
disconnect
=
function
(
client
)
{
var
self
=
this
;
var
self
=
this
;
if
(
client
.
connected
)
if
(
client
.
connected
)
{
client
.
end
()
client
.
end
()
}
self
.
client
=
null
self
.
client
=
null
self
.
isConnecting
=
false
self
.
isConnecting
=
false
/* if (!this.useQueue) {
this.client = null;
}
*/
// moved outside of anon function
/* if (!self.useQueue && client.connected) {
return client.destroy()
} else {
client.end()
}
var intervalObj = null
var cleanup = function () {
var retryCt = 0
// make sure to let client finish before calling destroy
if (self && self.hasQueuedItems) {
return
}
// needed to prevent mariasql connection leak
// client.destroy()
if (self && self.client) {
self.client = null
}
clearInterval(intervalObj)
}
if(client.connected) {
intervalObj = setInterval(cleanup, 10)
cleanup()
}*/
return
return
}
}
...
...
lib/dialects/mariadb/query.js
View file @
dc8f9f3
...
@@ -34,18 +34,14 @@ module.exports = (function() {
...
@@ -34,18 +34,14 @@ module.exports = (function() {
resultSet
.
push
(
row
);
resultSet
.
push
(
row
);
})
})
.
on
(
'error'
,
function
(
err
)
{
.
on
(
'error'
,
function
(
err
)
{
//console.log('error in result-loop for: ' + self.sql)
errorDetected
=
true
errorDetected
=
true
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'error'
,
err
,
this
.
callee
)
self
.
emit
(
'error'
,
err
,
this
.
callee
)
}.
bind
(
this
))
}.
bind
(
this
))
.
on
(
'end'
,
function
(
info
)
{
.
on
(
'end'
,
function
(
info
)
{
// nothing needs to be done at this point
if
(
errorDetected
)
{
if
(
errorDetected
)
{
return
return
}
}
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'sql'
,
this
.
sql
)
// we need to figure out whether to send the result set
// we need to figure out whether to send the result set
// or info depending upon the type of query
// or info depending upon the type of query
...
@@ -53,30 +49,20 @@ module.exports = (function() {
...
@@ -53,30 +49,20 @@ module.exports = (function() {
/^select/
.
test
(
this
.
sql
.
toLowerCase
())
||
/^select/
.
test
(
this
.
sql
.
toLowerCase
())
||
/^describe/
.
test
(
this
.
sql
.
toLowerCase
())
||
/^describe/
.
test
(
this
.
sql
.
toLowerCase
())
||
(
resultSet
.
length
&&
/^call/
.
test
(
this
.
sql
.
toLowerCase
())
)
)
{
(
resultSet
.
length
&&
/^call/
.
test
(
this
.
sql
.
toLowerCase
())
)
)
{
// console.log('results : ')
// console.log(resultSet)
// console.log('formatted resultset: ' + JSON.stringify(this.formatResults(resultSet)))
self
.
emit
(
'success'
,
this
.
formatResults
(
resultSet
))
self
.
emit
(
'success'
,
this
.
formatResults
(
resultSet
))
}
else
{
}
else
{
// console.log('results : ')
//info = JSON.parse(JSON.stringify(info))
// console.log(info)
//console.log('formatted resultset: ' + JSON.stringify(this.formatResults(info)))
self
.
emit
(
'success'
,
this
.
formatResults
(
info
))
self
.
emit
(
'success'
,
this
.
formatResults
(
info
))
}
}
}.
bind
(
this
));
}.
bind
(
this
));
}.
bind
(
this
))
}.
bind
(
this
))
.
on
(
'error'
,
function
(
err
)
{
.
on
(
'error'
,
function
(
err
)
{
//console.log( err )
//console.log('error in query: ' + this.sql)
if
(
errorDetected
)
{
if
(
errorDetected
)
{
return
return
}
}
errorDetected
=
true
errorDetected
=
true
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'error'
,
err
,
this
.
callee
)
self
.
emit
(
'error'
,
err
,
this
.
callee
)
console
.
log
(
'query error'
)
}.
bind
(
this
))
}.
bind
(
this
))
.
on
(
'end'
,
function
(
info
)
{
.
on
(
'end'
,
function
(
info
)
{
// nothing here (query info is returned during the 'result' event)
// nothing here (query info is returned during the 'result' event)
...
...
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