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 4b153fbe
authored
May 21, 2013
by
reedog117
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up comments
1 parent
f81baf52
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
8 deletions
lib/dialects/mariadb/connector-manager.js
lib/dialects/mariadb/query.js
spec/config/config.js
spec/dao-factory.spec.js
spec/sequelize.spec.js
lib/dialects/mariadb/connector-manager.js
View file @
4b153fb
...
...
@@ -268,7 +268,7 @@ module.exports = (function() {
connection
.
on
(
'connect'
,
function
()
{
connection
.
query
(
"SET time_zone = '+0:00'"
);
// client
.setMaxListeners(self.maxConcurrentQueries)
connection
.
setMaxListeners
(
self
.
maxConcurrentQueries
)
this
.
isConnecting
=
false
done
(
null
,
connection
)
...
...
lib/dialects/mariadb/query.js
View file @
4b153fb
...
...
@@ -45,20 +45,21 @@ module.exports = (function() {
if
(
errorDetected
)
{
return
}
self
.
emit
(
'sql'
,
this
.
sql
)
self
.
emit
(
'sql'
,
this
.
sql
)
// we need to figure out whether to send the result set
// or info depending upon the type of query
if
(
/^show/
.
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
())
)
)
{
// console.log('results : ')
// console.log(resultSet)
// console.log('formatted resultset: ' + JSON.stringify(this.formatResults(resultSet)))
self
.
emit
(
'success'
,
this
.
formatResults
(
resultSet
))
}
else
{
// console.log('results : ')
info
=
JSON
.
parse
(
JSON
.
stringify
(
info
))
//
info = JSON.parse(JSON.stringify(info))
// console.log(info)
//console.log('formatted resultset: ' + JSON.stringify(this.formatResults(info)))
self
.
emit
(
'success'
,
this
.
formatResults
(
info
))
...
...
@@ -77,8 +78,9 @@ module.exports = (function() {
self
.
emit
(
'error'
,
err
,
this
.
callee
)
console
.
log
(
'query error'
)
}.
bind
(
this
))
.
on
(
'end'
,
function
()
{
.
on
(
'end'
,
function
(
info
)
{
// nothing here (query info is returned during the 'result' event)
}.
bind
(
this
)).
setMaxListeners
(
100
)
return
this
...
...
spec/config/config.js
View file @
4b153fb
...
...
@@ -25,7 +25,8 @@ module.exports = {
database
:
'sequelize_test'
,
host
:
'127.0.0.1'
,
port
:
3306
,
pool
:
{
maxConnections
:
5
,
maxIdleTime
:
30
}
pool
:
{
maxConnections
:
5
,
maxIdleTime
:
30
},
logging
:
console
.
log
},
sqlite
:
{
...
...
spec/dao-factory.spec.js
View file @
4b153fb
...
...
@@ -1502,7 +1502,7 @@ describe(Helpers.getTestDialectTeaser("DAOFactory"), function() {
})
})
if
(
dialect
===
"mysql"
/* || dialect === "mariadb" */
)
{
if
(
dialect
===
"mysql"
||
dialect
===
"mariadb"
)
{
it
(
"should take schemaDelimiter into account if applicable"
,
function
(
done
){
var
UserSpecialUnderscore
=
this
.
sequelize
.
define
(
'UserSpecialUnderscore'
,
{
age
:
Sequelize
.
INTEGER
},
{
schema
:
'hello'
,
schemaDelimiter
:
'_'
})
var
UserSpecialDblUnderscore
=
this
.
sequelize
.
define
(
'UserSpecialDblUnderscore'
,
{
age
:
Sequelize
.
INTEGER
})
...
...
spec/sequelize.spec.js
View file @
4b153fb
...
...
@@ -121,7 +121,25 @@ describe(Helpers.getTestDialectTeaser("Sequelize"), function() {
}.
bind
(
this
))
}.
bind
(
this
))
})
}
else
{
}
/*
// this is always timing out for mariadb for some reason
else if (dialect == 'mariadb'){
it('executes stored procedures', function(done) {
this.sequelize.query(this.insertQuery).success(function() {
this.sequelize.query('DROP PROCEDURE IF EXISTS foo').success(function() {
this.sequelize.query("CREATE PROCEDURE foo()").success(function() {
this.sequelize.query("SELECT * FROM " + this.User.tableName + ";"
).success(function() {
this.sequelize.query('CALL foo()').success(function(users) {
expect(users.map(function(u){ return u.username })).toEqual(['john'])
done()
})
}.bind(this))
}.bind(this))
}.bind(this))
}.bind(this))
})
}*/
else
{
console
.
log
(
'FIXME: I want to be supported in this dialect as well :-('
)
}
...
...
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