Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #88 from wuchao-pingcap/struct0325
Browse files Browse the repository at this point in the history
feat(struct): call SpecialLettersUsingMySQL() for column comment/table comment
  • Loading branch information
wentaojin authored Mar 25, 2024
2 parents 3066592 + 44cd016 commit 98079f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions module/reverse/oracle/o2m/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func (r *Rule) GenTableNormalIndex() (normalIndexes []string, compatibilityIndex

func (r *Rule) GenTableComment() (tableComment string, err error) {
if len(r.TableCommentINFO) > 0 && r.TableCommentINFO[0]["COMMENTS"] != "" {
tableComment = fmt.Sprintf("COMMENT='%s'", r.TableCommentINFO[0]["COMMENTS"])
tableComment = fmt.Sprintf("COMMENT='%s'", common.SpecialLettersUsingMySQL([]byte(r.TableCommentINFO[0]["COMMENTS"])))
}
return tableComment, err
}
Expand Down Expand Up @@ -792,7 +792,7 @@ func (r *Rule) GenTableColumn() (tableColumns []string, err error) {
}

if !strings.EqualFold(rowCol["COMMENTS"], "") {
comment = "'" + rowCol["COMMENTS"] + "'"
comment = "'" + common.SpecialLettersUsingMySQL([]byte(rowCol["COMMENTS"])) + "'"
} else {
comment = rowCol["COMMENTS"]
}
Expand Down
4 changes: 2 additions & 2 deletions module/reverse/oracle/o2t/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ func (r *Rule) GenTableNormalIndex() (normalIndexes []string, compatibilityIndex

func (r *Rule) GenTableComment() (tableComment string, err error) {
if len(r.TableCommentINFO) > 0 && r.TableCommentINFO[0]["COMMENTS"] != "" {
tableComment = fmt.Sprintf("COMMENT='%s'", r.TableCommentINFO[0]["COMMENTS"])
tableComment = fmt.Sprintf("COMMENT='%s'", common.SpecialLettersUsingMySQL([]byte(r.TableCommentINFO[0]["COMMENTS"])))
}
return tableComment, err
}
Expand Down Expand Up @@ -968,7 +968,7 @@ func (r *Rule) GenTableColumn() (tableColumns []string, err error) {
}

if !strings.EqualFold(rowCol["COMMENTS"], "") {
comment = "'" + rowCol["COMMENTS"] + "'"
comment = "'" + common.SpecialLettersUsingMySQL([]byte(rowCol["COMMENTS"])) + "'"
} else {
comment = rowCol["COMMENTS"]
}
Expand Down

0 comments on commit 98079f8

Please sign in to comment.