Skip to content

Commit

Permalink
ftr: support binary protocol from arana to physics db (arana-db#33)
Browse files Browse the repository at this point in the history
 ftr: support binary protocol from arana to physics db
  • Loading branch information
dk-lockdown authored Jan 4, 2022
1 parent de3c5f6 commit 3a1165a
Show file tree
Hide file tree
Showing 10 changed files with 837 additions and 277 deletions.
63 changes: 63 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
linters-settings:
govet:
check-shadowing: false
golint:
min-confidence: 0
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/golangci/golangci-lint
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc

linters:
disable-all: true
enable:
- govet
- staticcheck
- ineffassign
- misspell

run:
skip-dirs:
- test/testdata_etc
- pkg/golinters/goanalysis/(checker|passes)

issues:
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec
- linters:
- staticcheck
text: "SA1019:"

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.16.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"

1 change: 1 addition & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

import (
"github.com/pkg/errors"

"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (executor *RedirectExecutor) ExecutorComQuery(ctx *proto.Context) (proto.Re
return result, warn, err
}

func (executor *RedirectExecutor) ExecutorComPrepareExecute(ctx *proto.Context) (proto.Result, uint16, error) {
func (executor *RedirectExecutor) ExecutorComStmtExecute(ctx *proto.Context) (proto.Result, uint16, error) {
var r pools.Resource
var err error
r, ok := executor.localTransactionMap[ctx.ConnectionID]
Expand All @@ -195,7 +195,7 @@ func (executor *RedirectExecutor) ExecutorComPrepareExecute(ctx *proto.Context)
return nil, 0, err
}
executor.doPreFilter(ctx)
result, warn, err := backendConn.ExecuteWithWarningCount(query, true)
result, warn, err := backendConn.PrepareQuery(query, ctx.Data)
executor.doPostFilter(ctx, result)
return result, warn, err
}
Expand Down
Loading

0 comments on commit 3a1165a

Please sign in to comment.