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 36693078
authored
Jun 24, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(query-generator): fix mysql query generator addIndex tests to check for escaped tables
1 parent
4fe4b37b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
lib/dialects/mysql/query-generator.js
test/mysql/query-generator.test.js
lib/dialects/mysql/query-generator.js
View file @
3669307
...
...
@@ -264,7 +264,7 @@ module.exports = (function() {
},
showIndexQuery
:
function
(
tableName
,
options
)
{
var
sql
=
'SHOW INDEX FROM <%= tableName %>
<%= options %>'
;
var
sql
=
'SHOW INDEX FROM <%= tableName %><%= options %>'
;
return
Utils
.
_
.
template
(
sql
)({
tableName
:
this
.
quoteIdentifiers
(
tableName
),
options
:
(
options
||
{}).
database
?
' FROM `'
+
options
.
database
+
'`'
:
''
...
...
test/mysql/query-generator.test.js
View file @
3669307
...
...
@@ -474,7 +474,7 @@ if (Support.dialectIsMySQL()) {
addIndexQuery
:
[
{
arguments
:
[
'User'
,
[
'username'
,
'isAdmin'
]],
expectation
:
'CREATE INDEX user_username_is_admin ON
User
(`username`, `isAdmin`)'
expectation
:
'CREATE INDEX user_username_is_admin ON
`User`
(`username`, `isAdmin`)'
},
{
arguments
:
[
'User'
,
[
...
...
@@ -482,17 +482,17 @@ if (Support.dialectIsMySQL()) {
'isAdmin'
]
],
expectation
:
"CREATE INDEX user_username_is_admin ON
User
(`username`(10) ASC, `isAdmin`)"
expectation
:
"CREATE INDEX user_username_is_admin ON
`User`
(`username`(10) ASC, `isAdmin`)"
},
{
arguments
:
[
'User'
,
[
'username'
,
'isAdmin'
],
{
parser
:
'foo'
,
indicesType
:
'FULLTEXT'
,
indexName
:
'bar'
}
],
expectation
:
"CREATE FULLTEXT INDEX bar ON
User
(`username`, `isAdmin`) WITH PARSER foo"
expectation
:
"CREATE FULLTEXT INDEX bar ON
`User`
(`username`, `isAdmin`) WITH PARSER foo"
},
{
arguments
:
[
'User'
,
[
'username'
,
'isAdmin'
],
{
indicesType
:
'UNIQUE'
}
],
expectation
:
"CREATE UNIQUE INDEX user_username_is_admin ON
User
(`username`, `isAdmin`)"
expectation
:
"CREATE UNIQUE INDEX user_username_is_admin ON
`User`
(`username`, `isAdmin`)"
}
],
...
...
@@ -509,10 +509,10 @@ if (Support.dialectIsMySQL()) {
removeIndexQuery
:
[
{
arguments
:
[
'User'
,
'user_foo_bar'
],
expectation
:
"DROP INDEX user_foo_bar ON
User
"
expectation
:
"DROP INDEX user_foo_bar ON
`User`
"
},
{
arguments
:
[
'User'
,
[
'foo'
,
'bar'
]],
expectation
:
"DROP INDEX user_foo_bar ON
User
"
expectation
:
"DROP INDEX user_foo_bar ON
`User`
"
}
],
...
...
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