Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapshot task migrates timestamp '0000-00-00 00:00:00' to now() #328

Open
qianyiwen2019 opened this issue Feb 21, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@qianyiwen2019
Copy link
Collaborator

export MYSQL_IMAGE="mysql:5.7.40"

  • source database

docker run -d --name some-mysql-1
--platform linux/x86_64
-it
-p 3307:3306 -e MYSQL_ROOT_PASSWORD="123456"
"$MYSQL_IMAGE" --lower_case_table_names=1 --character-set-server=utf8 --collation-server=utf8_general_ci
--datadir=/var/lib/mysql
--user=mysql
--server_id=1
--log_bin=/var/lib/mysql/mysql-bin.log
--max_binlog_size=100M
--gtid_mode=ON
--enforce_gtid_consistency=ON
--binlog_format=ROW
--default_time_zone=+08:00
--sql_mode=NO_ENGINE_SUBSTITUTION

  • target database

docker run -d --name some-mysql-2
--platform linux/x86_64
-it
-p 3308:3306 -e MYSQL_ROOT_PASSWORD="123456"
"$MYSQL_IMAGE" --lower_case_table_names=1 --character-set-server=utf8 --collation-server=utf8_general_ci
--datadir=/var/lib/mysql
--user=mysql
--server_id=1
--log_bin=/var/lib/mysql/mysql-bin.log
--max_binlog_size=100M
--gtid_mode=ON
--enforce_gtid_consistency=ON
--binlog_format=ROW
--default_time_zone=+07:00
--sql_mode=NO_ENGINE_SUBSTITUTION

  • table
    Create database test_db_1;
    create table test_db_1.a(id int, value timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
    insert into test_db_1.a values(1, '0000-00-00 00:00:00');

  • source column values
    mysql> select * from test_db_1.a;
    +------+---------------------+
    | id | value |
    +------+---------------------+
    | 1 | 0000-00-00 00:00:00 |
    +------+---------------------+

  • target column values which migrated by ape_dts
    mysql> select * from test_db_1.a;
    +------+---------------------+
    | id | value |
    +------+---------------------+
    | 1 | 2025-02-21 16:34:21 |
    +------+---------------------+

@qianyiwen2019 qianyiwen2019 added the bug Something isn't working label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant