Skip to content

Commit d5c374a

Browse files
author
Shlomi Noach
authored
Merge pull request #684 from github/test-decimal
Fixed DECIMAL datatype
2 parents 6a94f65 + 7e0bdbe commit d5c374a

File tree

176 files changed

+12872
-4168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+12872
-4168
lines changed

go/binlog/gomysql_reader.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ func NewGoMySQLReader(migrationContext *base.MigrationContext) (binlogReader *Go
4040
serverId := uint32(migrationContext.ReplicaServerId)
4141

4242
binlogSyncerConfig := replication.BinlogSyncerConfig{
43-
ServerID: serverId,
44-
Flavor: "mysql",
45-
Host: binlogReader.connectionConfig.Key.Hostname,
46-
Port: uint16(binlogReader.connectionConfig.Key.Port),
47-
User: binlogReader.connectionConfig.User,
48-
Password: binlogReader.connectionConfig.Password,
43+
ServerID: serverId,
44+
Flavor: "mysql",
45+
Host: binlogReader.connectionConfig.Key.Hostname,
46+
Port: uint16(binlogReader.connectionConfig.Key.Port),
47+
User: binlogReader.connectionConfig.User,
48+
Password: binlogReader.connectionConfig.Password,
49+
UseDecimal: true,
4950
}
5051
binlogReader.binlogSyncer = replication.NewBinlogSyncer(binlogSyncerConfig)
5152

localtests/decimal/create.sql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
drop table if exists gh_ost_test;
2+
create table gh_ost_test (
3+
id int auto_increment,
4+
dec0 decimal(65,30) unsigned NOT NULL DEFAULT '0.000000000000000000000000000000',
5+
dec1 decimal(65,30) unsigned NOT NULL DEFAULT '1.000000000000000000000000000000',
6+
primary key(id)
7+
) auto_increment=1;
8+
9+
drop event if exists gh_ost_test;
10+
delimiter ;;
11+
create event gh_ost_test
12+
on schedule every 1 second
13+
starts current_timestamp
14+
ends current_timestamp + interval 60 second
15+
on completion not preserve
16+
enable
17+
do
18+
begin
19+
insert into gh_ost_test values (null, 0.0, 0.0);
20+
insert into gh_ost_test values (null, 2.0, 4.0);
21+
insert into gh_ost_test values (null, 99999999999999999999999999999999999.000, 6.0);
22+
update gh_ost_test set dec1=4.5 where dec2=4.0 order by id desc limit 1;
23+
end ;;

vendor/github.com/siddontang/go-mysql/.travis.yml

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/siddontang/go-mysql/Gopkg.lock

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/siddontang/go-mysql/Gopkg.toml

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/siddontang/go-mysql/Makefile

Lines changed: 2 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)