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

ddl: create partition table fail with strconv.ParseInt invalid syntax #16436

Merged
merged 4 commits into from
Apr 16, 2020

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Apr 15, 2020

What problem does this PR solve?

Issue Number: close #16333

Problem Summary:

mysql> create table t (dt timestamp) partition by range (unix_timestamp(dt)) (partition p0 values less than (unix_timestamp('2020-04-15 00:00:00')));
ERROR 1105 (HY000): strconv.ParseInt: parsing "unix_timestamp(\"2020-04-15 00:00:00\")": invalid syntax

What is changed and how it works?

Proposal: xxx

What's Changed:

Fix bug

How it Works:

During the create of the table, the partition information should be convert to integer.
The 'less than xxx' part of a partition in the model should be integers.

I don't know why it's broken and which PR cause this.
4.0 is fine.

Tests

  • Unit test

@tiancaiamao
Copy link
Contributor Author

PTAL @imtbkcat @crazycs520 @jackysp

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 16, 2020
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

Do we need to cherry-pick to v4.0?

@tiancaiamao
Copy link
Contributor Author

Do we need to cherry-pick to v4.0?

I don't know why but this test case success in 4.0
OK, I'll cherry pick 4.0 as it's simple enough.

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Apr 16, 2020

Codecov Report

Merging #16436 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #16436   +/-   ##
===========================================
  Coverage   80.5322%   80.5322%           
===========================================
  Files           506        506           
  Lines        136939     136939           
===========================================
  Hits         110280     110280           
  Misses        18104      18104           
  Partials       8555       8555           

@tiancaiamao
Copy link
Contributor Author

[2020-04-16T11:14:34.916Z] [2020/04/16 19:13:48.788 +08:00] [FATAL] [terror.go:348] ["unexpected error"] [error="listen tcp 0.0.0.0:10081: bind: address already in use"] [stack="github.com/pingcap/log.Fatal\n\t/home/jenkins/agent/workspace/tidb_ghpr_build/go/pkg/mod/github.com/pingcap/log@v0.0.0-20200117041106-d28c14d3b1cd/global.go:59\ngit.luolix.top/pingcap/parser/terror.MustNil\n\t/home/jenkins/agent/workspace/tidb_ghpr_build/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200410065024-81f3db8e6095/terror/terror.go:348\nmain.createServer\n\t/home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/tidb/tidb-server/main.go:630\nmain.main\n\t/home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/tidb/tidb-server/main.go:182\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"]

/run-sqllogic-test-2

Copy link

@imtbkcat imtbkcat 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
Copy link
Member

jackysp commented Apr 16, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 16, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 16, 2020

/run-all-tests

@sre-bot sre-bot merged commit 22664a7 into pingcap:master Apr 16, 2020
sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Apr 16, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 16, 2020

cherry pick to release-3.0 in PR #16498

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Apr 16, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 16, 2020

cherry pick to release-3.1 in PR #16499

@sre-bot
Copy link
Contributor

sre-bot commented Apr 16, 2020

cherry pick to release-4.0 in PR #16500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create partition table fail with strconv.ParseInt invalid syntax
5 participants