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

syncer can't decode set datatype #70

Closed
CrazyNash opened this issue Sep 12, 2018 · 1 comment · Fixed by go-mysql-org/go-mysql#319
Closed

syncer can't decode set datatype #70

CrazyNash opened this issue Sep 12, 2018 · 1 comment · Fixed by go-mysql-org/go-mysql#319

Comments

@CrazyNash
Copy link

There is a table has a set field region defined as

`region` set('1','1001','2001','3001','4001','5001','6001','7001','8001','8100','9001')

And for a record with 5001, mysql binlog shows

### SET
...
###   @6=b'0010000000000000' /* SET(2 bytes) meta=63490 nullable=0 is_null=0 */

syncer tried to insert 8192 (b'0010000000000000') directly into the record, where it should decode the bit to '5001' first.

tidb failed for

"REPLACE INTO `u`.`t_common` (`id`,`bit`,`purpose`,`is_valid`,`is_basic`,`region`) VALUES (126,90,'XXX',1,0,8192);"
/home/jenkins/workspace/build_tidb_2.0/go/src/github.com/pingcap/tidb/types/datum.go:1554: cannot convert datum from tinyint to type set.
@july2993
Copy link
Contributor

thanks for your report, we will take a look and fix it later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants