Skip to content

Commit

Permalink
MySQL: sanitize identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 committed Oct 3, 2024
1 parent abb6b47 commit 8e1dc9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/server/datasource/rdbms/mysql/sql_formatter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package mysql

import (
"fmt"
"strings"

"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"

api_service_protos "github.com/ydb-platform/fq-connector-go/api/service/protos"
Expand Down Expand Up @@ -72,7 +75,7 @@ func (sqlFormatter) GetPlaceholder(_ int) string {
}

func (sqlFormatter) SanitiseIdentifier(ident string) string {
return ident
return fmt.Sprintf("`%s`", strings.Replace(ident, "`", "``", -1))
}

func (f sqlFormatter) FormatFrom(tableName string) string {
Expand Down
2 changes: 1 addition & 1 deletion app/server/paging/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ColumnarBufferMock struct {
mock.Mock
}

//nolint:unused
// nolint: unused

Check failure on line 39 in app/server/paging/mock.go

View workflow job for this annotation

GitHub Actions / lint

directive `// nolint: unused` should be written without leading space as `//nolint: unused` (nolintlint)
func (*ColumnarBufferMock) addRow(_ RowTransformer[any]) error {
panic("not implemented") // TODO: Implement
}
Expand Down

0 comments on commit 8e1dc9d

Please sign in to comment.