Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: add sql to com_exec/com_fetch dispatch error log (#12174) #12191

Merged
merged 5 commits into from Sep 17, 2019

Conversation

@sre-bot
Copy link

commented Sep 16, 2019

cherry-pick #12174 to release-3.0


What problem does this PR solve?

More and more user use prepare stmt, but current dispatch error log we only can see packet binary info, we don't know which sql meet error.

What is changed and how it works?

add sql to error thrown in handleStmtExec and handleStmtFetch

after this PR, we can got

[2019/09/12 15:38:43.715 +08:00] [WARN] [conn.go:669] ["command dispatched failed"] [conn=1] [connInfo="id:1, addr:127.0.0.1:43540 status:2, collation:utf8_general_ci, user:root"] [command=Fetch] [sql="\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000"] [err="12121\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmtFetch\n\t/home/robi/code/go/src/github.com/pingcap/tidb/server/conn_stmt.go:239\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/robi/code/go/src/github.com/pingcap/tidb/server/conn.go:914\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/robi/code/go/src/github.com/pingcap/tidb/server/conn.go:653\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/robi/code/go/src/github.com/pingcap/tidb/server/server.go:438\nruntime.goexit\n\t/home/robi/runtime/go/src/runtime/asm_amd64.s:1337\nselect 1"]

("select 1" now is in last, we can modify pingcap/errors to let be in front, but we need add msg first)

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • wrap error message with sql

Side effects

  • N/A

Related changes

  • Need to cherry-pick to the release branch

Release note

  • server: add sql to com_exec/com_fetch dispatch error log

This change is Reviewable

@sre-bot

This comment has been minimized.

Copy link
Author

commented Sep 16, 2019

/run-all-tests

Copy link
Member

left a comment

LGTM

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2019

LGTM

@sre-bot

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

/run-all-tests

@sre-bot

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

@sre-bot merge failed.

@zz-jason

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

/merge

@sre-bot

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

Your auto merge job has been accepted, waiting for 12227

@sre-bot

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

/run-all-tests

@sre-bot sre-bot merged commit 45d7da0 into pingcap:release-3.0 Sep 17, 2019
13 checks passed
13 checks passed
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.