{"action":"created","issue":{"url":"https://api.github.com/repos/siddontang/go-mysql/issues/28","labels_url":"https://api.github.com/repos/siddontang/go-mysql/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/siddontang/go-mysql/issues/28/comments","events_url":"https://api.github.com/repos/siddontang/go-mysql/issues/28/events","html_url":"https://github.com/siddontang/go-mysql/pull/28","id":125984788,"number":28,"title":"Return u/int8, u/int16, u/int32 (sign-extend Int24), float32, float64 for interface{} as appropriate","user":{"login":"karmakaze","id":318225,"avatar_url":"https://avatars.githubusercontent.com/u/318225?v=3","gravatar_id":"","url":"https://api.github.com/users/karmakaze","html_url":"https://github.com/karmakaze","followers_url":"https://api.github.com/users/karmakaze/followers","following_url":"https://api.github.com/users/karmakaze/following{/other_user}","gists_url":"https://api.github.com/users/karmakaze/gists{/gist_id}","starred_url":"https://api.github.com/users/karmakaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmakaze/subscriptions","organizations_url":"https://api.github.com/users/karmakaze/orgs","repos_url":"https://api.github.com/users/karmakaze/repos","events_url":"https://api.github.com/users/karmakaze/events{/privacy}","received_events_url":"https://api.github.com/users/karmakaze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-11T16:37:15Z","updated_at":"2016-01-16T14:17:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/siddontang/go-mysql/pulls/28","html_url":"https://github.com/siddontang/go-mysql/pull/28","diff_url":"https://github.com/siddontang/go-mysql/pull/28.diff","patch_url":"https://github.com/siddontang/go-mysql/pull/28.patch"},"body":"Related to Issue #26 the previously merged PR maintains the same return types always int64 for integral and float64 for floats.\r\n\r\nThis PR will return variable width and also the unsigned versions of types. This is somewhat of a breaking change, so consider if this seems better to you. It means that users will have to check for float32 as well as int8, uint8, ... int64, uint64 when interface{} is returned. The plus is that there's less chance of getting the wrong value. In particular for replication/row_event.go since there's no 'unsigned' meta info, signed is always returned. So an int32 for a value like 0x80000000 cast to uint32 will mean the right thing. Without this PR an int64 returned for a MYSQL 32-bit LONG with value 0x0000000080000000 will return 0xFFFFFFFF80000000 (with sign extension) and cast to uint64 will not be the intended value. Cast to uint32 is, but then user must remember to downcast width for unsigned.\r\n\r\nHope this is all clear. If very concerned with backward compatibility, perhaps a mode setting?"},"comment":{"url":"https://api.github.com/repos/siddontang/go-mysql/issues/comments/172210931","html_url":"https://github.com/siddontang/go-mysql/pull/28#issuecomment-172210931","issue_url":"https://api.github.com/repos/siddontang/go-mysql/issues/28","id":172210931,"user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"created_at":"2016-01-16T14:17:55Z","updated_at":"2016-01-16T14:17:55Z","body":"Hi @karmakaze \r\n\r\nI dive into python mysql replication and find that it selects the column information(including unsigned flag) from `INFORMATION_SCHEMA.COLUMNS` table using schema name and table name when meets table map event, and I think we can use this way too. \r\nBut this may have a risk, the table with same schema name and table name may be altered, so when we meet a table map event and use its schema name and table name to fetch the column information, the table may have been altered. So we must check the table id validation in `INFORMATION_SCHEMA.INNODB_SYS_TABLES`, if the table id exits, the table is not altered, if not, we can't use the columns information. \r\n\r\nBtw, I still think using int64/uint64/float64 is enough.  :-) "}}