Skip to content

Commit

Permalink
Merge pull request #684 from github/test-decimal
Browse files Browse the repository at this point in the history
Fixed DECIMAL datatype
  • Loading branch information
Shlomi Noach committed Jan 13, 2019
2 parents 6a94f65 + 7e0bdbe commit d5c374a
Show file tree
Hide file tree
Showing 176 changed files with 12,872 additions and 4,168 deletions.
13 changes: 7 additions & 6 deletions go/binlog/gomysql_reader.go
Expand Up @@ -40,12 +40,13 @@ func NewGoMySQLReader(migrationContext *base.MigrationContext) (binlogReader *Go
serverId := uint32(migrationContext.ReplicaServerId)

binlogSyncerConfig := replication.BinlogSyncerConfig{
ServerID: serverId,
Flavor: "mysql",
Host: binlogReader.connectionConfig.Key.Hostname,
Port: uint16(binlogReader.connectionConfig.Key.Port),
User: binlogReader.connectionConfig.User,
Password: binlogReader.connectionConfig.Password,
ServerID: serverId,
Flavor: "mysql",
Host: binlogReader.connectionConfig.Key.Hostname,
Port: uint16(binlogReader.connectionConfig.Key.Port),
User: binlogReader.connectionConfig.User,
Password: binlogReader.connectionConfig.Password,
UseDecimal: true,
}
binlogReader.binlogSyncer = replication.NewBinlogSyncer(binlogSyncerConfig)

Expand Down
23 changes: 23 additions & 0 deletions localtests/decimal/create.sql
@@ -0,0 +1,23 @@
drop table if exists gh_ost_test;
create table gh_ost_test (
id int auto_increment,
dec0 decimal(65,30) unsigned NOT NULL DEFAULT '0.000000000000000000000000000000',
dec1 decimal(65,30) unsigned NOT NULL DEFAULT '1.000000000000000000000000000000',
primary key(id)
) auto_increment=1;

drop event if exists gh_ost_test;
delimiter ;;
create event gh_ost_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into gh_ost_test values (null, 0.0, 0.0);
insert into gh_ost_test values (null, 2.0, 4.0);
insert into gh_ost_test values (null, 99999999999999999999999999999999999.000, 6.0);
update gh_ost_test set dec1=4.5 where dec2=4.0 order by id desc limit 1;
end ;;
26 changes: 14 additions & 12 deletions vendor/github.com/siddontang/go-mysql/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions vendor/github.com/siddontang/go-mysql/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions vendor/github.com/siddontang/go-mysql/Gopkg.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 2 additions & 21 deletions vendor/github.com/siddontang/go-mysql/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5c374a

Please sign in to comment.