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

infoschema: fix pseudo data for profiling table #8092

Merged
merged 2 commits into from Oct 29, 2018

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Oct 29, 2018

What problem does this PR solve?

When selecting rows from profiling, tidb will get panics like:

encoding/binary.binary.littleEndian.PutUint64(...)
/usr/local/go/src/encoding/binary/binary.go:82
github.com/pingcap/tidb/util/chunk.MutRow.SetDatum(0xc4205a9880, 0x0, 0xf, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/util/chunk/mutrow.go:283 +0x8a1
github.com/pingcap/tidb/util/chunk.MutRow.SetDatums(0xc4205a9880, 0x0, 0xc42017d400, 0x12, 0x12)
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/util/chunk/mutrow.go:270 +0xe9
github.com/pingcap/tidb/executor.(*TableScanExec).nextChunk4InfoSchema.func1(0x0, 0xc42017d400, 0x12, 0x12, 0xc42254ab40, 0x12, 0x12, 0x1, 0x1, 0x0)
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/executor.go:786 +0x68
github.com/pingcap/tidb/infoschema.(*infoschemaTable).IterRecords(0xc420627940, 0x142e980, 0xc420e74e00, 0x0, 0x0, 0x0, 0xc42254ab40, 0x12, 0x12, 0xc4205a98c0, ...)
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/infoschema/tables.go:1169 +0x123
github.com/pingcap/tidb/executor.(*TableScanExec).nextChunk4InfoSchema(0xc4212d5860, 0x7f92db394118, 0xc42159f000, 0xc4205a95e0, 0x8b53b9, 0xc4205a95e0)
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/executor.go:785 +0x41d

What is changed and how it works?

The type of SOURCE_FUNCTION and SOURCE_FILE is varchar, so the default value should be an empty string, not 0.

Check List

Tests

  • Unit test

Code changes

  • Has unexported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

PTAL @zz-jason @winoros @eurekaka

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@winoros winoros added status/LGT1 Indicates that a PR has LGTM 1. type/bug-fix This PR fixes a bug. labels Oct 29, 2018
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 29, 2018
@XuHuaiyu
Copy link
Contributor

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. type/bug-fix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants