Skip to content

Commit

Permalink
update: 修复索引前缀中文英文不一致的问题(#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Sep 10, 2021
1 parent 34016ef commit 00d1135
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion session/session_inception.go
Original file line number Diff line number Diff line change
Expand Up @@ -4235,7 +4235,7 @@ func (s *session) checkIndexAttr(tp ast.ConstraintType, name string,
}
}
if !found {
s.appendErrorNo(ER_INDEX_NAME_IDX_PREFIX, name, table.Name, s.inc.IndexPrefix)
s.appendErrorNo(ER_INDEX_NAME_IDX_PREFIX, name, s.inc.IndexPrefix, table.Name)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions session/session_inception_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ primary key(id)) comment 'test';`
s.testErrorCode(c, sql,
session.NewErr(session.ER_WRONG_NAME_FOR_INDEX, "NULL", "test_error_code_3"),
session.NewErr(session.ER_INDEX_NAME_IDX_PREFIX, "",
"test_error_code_3", config.GetGlobalConfig().Inc.IndexPrefix),
config.GetGlobalConfig().Inc.IndexPrefix, "test_error_code_3"),
session.NewErr(session.ER_TOO_LONG_KEY, "", indexMaxLength))

config.GetGlobalConfig().Inc.IndexPrefix = "idx_,idx1_"
Expand All @@ -963,7 +963,7 @@ primary key(id)) comment 'test';`
sql = "create table test_error_code_3(c1 int,c2 int,key idx_1(c1),key idx2_2(c2));"
s.testErrorCode(c, sql,
session.NewErr(session.ER_INDEX_NAME_IDX_PREFIX, "idx2_2",
"test_error_code_3", config.GetGlobalConfig().Inc.IndexPrefix),
config.GetGlobalConfig().Inc.IndexPrefix, "test_error_code_3"),
)

config.GetGlobalConfig().Inc.TablePrefix = "t_"
Expand Down

0 comments on commit 00d1135

Please sign in to comment.