Open kwburgess opened 5 years ago
@kwburgess can you please clarify, #681 was about the DECIMAL
datatype. Your reproduction steps do not include DECIMAL
. If there is a problem, how does it relate to #681 and #684?
@kwburgess https://github.com/github/gh-ost/pull/692 tests your scenario and passes. Can you please examine?
Thank you @shlomi-noach ch for the rapid replies and careful attention.
Agreed, #684 was DECIMAL
not BIGINT
, but it was the most similar issue to my current one so I was being extra careful and making sure it didn't solve this peripherally.
Unfortunately I followed your instructions https://github.com/github/gh-ost/blob/master/doc/coding-ghost.md to attempt to run the tests locally and examine the tables created by your test and more understand how your test environment works, but I could not get past running the test.sh script in the gh-ost repo.
I've determined your tests can't run on Mac OS, which is fine. eventually, I got by on a Centos. but I still can't run your localtests.
$ go get -v github.com/github/gh-ost
$ cd src/github.com/github/gh-ost/
$ ./script/cibuild # runs successfully
$ git checkout bigint-change-nullable
$ ./localtests/test.sh
./localtests/test.sh: line 39: gh-ost-test-mysql-master: command not found
Cannot verify gh-ost-test-mysql-master
Wondering if you had any extended setup instructions?
With a little more investigation (couldn't find this in the docs), I'm guessing I have to run ./script/cibuild-gh-ost-replica-tests instead of running ./localtests/test.sh
so I attempted to do so:
I can see that the test you wrote passed, but how might I inspect the table it created to verify your test syntax with the test reproduction steps I gave you above? see, I need to validate that:
create table gh_ost_test (
id bigint auto_increment,
val bigint not null,
primary key(id)
) auto_increment=1;
is the same as
CREATE TABLE ghost_overflow_test (primary_key BIGINT(20) NOT NULL,
test_id BIGINT(20) NOT NULL,
PRIMARY KEY (primary_key));
Hi, I'm actually running tests on MacOS.
What you need, and this isn't well documented:
setup aliases or scripts called gh-ost-test-mysql-master
and gh-ost-test-mysql-replica
that will connect to the master and replica, respectively. Here's my setup:
$ cat /Users/shlomi-noach/bin/gh-ost-test-mysql-master
#!/bin/bash
/Users/shlomi-noach/sandboxes/rsandbox_mysql-5_7_17/m "$@"
As per your 2nd question, "how might I inspect the table it created to verify your test syntax with the test reproduction steps I gave you above?", you will want to look at the Replica server, into test.gh_ost_test
and test._gh_ost_test_gho
.
Last,
I need to validate that: .. is the same as ...
It is indeed the same. Only thing that changed are the names, but otherwise it's the exact same table definition.
18446744073709551615 is 2^64-1, which exceeds the max value of a signed BIGINT. @kwburgess, are you getting a WARNING after that insert?
What sql_mode
are you using? (try SELECT @@session.sql_mode, @@global.sql_mode
for more insight)
What does select * from ghost_overflow_test;
show if run before gh-ost?
I'm using
+-----------+
| @@version |
+-----------+
| 8.0.27 |
+-----------+
And I cannot insert it into the table following your steps.
mysql> CREATE TABLE ghost_overflow_test (primary_key BIGINT(20) NOT NULL,
-> test_id BIGINT(20) NOT NULL,
-> PRIMARY KEY (primary_key));
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------+
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
+---------+------+------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> INSERT INTO ghost_overflow_test VALUES (1,18446744073709551615);
ERROR 1264 (22003): Out of range value for column 'test_id' at row 1
mysql> select * from ghost_overflow_test;
Empty set (0.00 sec)
I guess that it's not a problem caused by gh-ost.
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:
id went from 18446744073709551615 -> 9223372036854775807
Versions:
tested on gh-ost master branch and test-decimal branch