KEMBAR78
Incorrect values when making column nullable · Issue #691 · github/gh-ost · GitHub
Skip to content

Incorrect values when making column nullable #691

@kwburgess

Description

@kwburgess

Confirmed: #684 (related issue: #681 ) did not fix this problem.

Using gh-ost to make a column to be nullable results in incorrect values for the column.
Initial guess is an overflow issue of some sort.

Reproduction steps:

CREATE TABLE ghost_overflow_test (primary_key BIGINT(20) NOT NULL, 
test_id BIGINT(20) NOT NULL, 
PRIMARY KEY (primary_key));
INSERT INTO ghost_overflow_test VALUES (1,18446744073709551615);
./gh-ost --host=localhost --user=test --password=test --database=test \
--allow-on-master --alter="CHANGE test_id test_id bigint(20);" \
--table=ghost_overflow_test --execute
select * from ghost_overflow_test;
+-------------+---------------------+
| primary_key | test_id             |
+-------------+---------------------+
|           1 | 9223372036854775807 |
+-------------+---------------------+
1 row in set (0.00 sec)

id went from 18446744073709551615 -> 9223372036854775807

Versions:

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.11, for Linux (x86_64) using  EditLine wrapper
$ go version
go version go1.9.2 linux/amd64

tested on gh-ost master branch and test-decimal branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions