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

plugin:modify conn_ip_example's method parameters and return values #10288

Merged
merged 5 commits into from
Apr 30, 2019
Merged

plugin:modify conn_ip_example's method parameters and return values #10288

merged 5 commits into from
Apr 30, 2019

Conversation

sourcelliu
Copy link
Contributor

What problem does this PR solve?

I recently researched TiDB's plugin mechanism, using the example provided by the official website (conn_id_example) to compile and generate plugins, but in the process of generating plugins, the following error message appears:

cannot use OnGeneralEvent (type func(context.Context, *variable.SessionVars, "github.com/pingcap/tidb/plugin".GeneralEvent, byte, string) error) as type func(context.Context, *variable.SessionVars, "github.com/pingcap/tidb/plugin".GeneralEvent, string) in field value

What is changed and how it works?

I checked and found that the OnGeneralEvent method in conn_id_example.go is different from the OnGeneralEvent method parameter and return value in plugin/audit.go. Therefore, this pull request modifies the conn_id_example.go method parameter and return value, so that it can be normal. Generate plugin: conn_ip_example-1.so.

Check List

Tests

  • Integration test

Code changes
no

Side effects
no

@CLAassistant
Copy link

CLAassistant commented Apr 28, 2019

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 28, 2019

Codecov Report

Merging #10288 into master will increase coverage by 0.0091%.
The diff coverage is 0%.

@@               Coverage Diff                @@
##             master     #10288        +/-   ##
================================================
+ Coverage   77.6625%   77.6716%   +0.0091%     
================================================
  Files           411        411                
  Lines         85444      85452         +8     
================================================
+ Hits          66358      66372        +14     
+ Misses        14122      14120         -2     
+ Partials       4964       4960         -4

@shenli shenli added the contribution This PR is from a community contributor. label Apr 28, 2019
@shenli
Copy link
Member

shenli commented Apr 28, 2019

@mantuliu Thanks! Please sign the CLA.
@lysu PTAL

@sourcelliu
Copy link
Contributor Author

@shenli done.Thanks!

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lysu lysu added component/plugin status/LGT1 Indicates that a PR has LGTM 1. labels Apr 30, 2019
@lysu lysu requested a review from jackysp April 30, 2019 05:26
@lysu
Copy link
Contributor

lysu commented Apr 30, 2019

/run-all-tests

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp jackysp merged commit 52e6744 into pingcap:master Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugin contribution This PR is from a community contributor. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants