Git Product home page Git Product logo

Comments (30)

july2993 avatar july2993 commented on August 12, 2024

it's the first time you run Syncer? make sure you can connect to MySQL in the server running Syncer using mysql client

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Yes, it's my first time running Syncer;

  1. pretty sure, connection is done;
2018/10/26 17:53:01 syncer.go:932: [info] [syncer] last slave connection id 73707
2018/10/26 17:53:01 syncer.go:628: [info] rotate binlog to (bin-log-mysqld1.000085, 4)

2018/10/26 17:53:07 meta.go:137: [info] save position to file, binlog-name:bin-log-mysqld1.000085 binlog-pos:720090516 binlog-gtid:a2c131c8-2729-11e8-b0fd-005056a2d719:1-103374748
2018/10/26 17:53:31 syncer.go:920: [info] [syncer]total events = 490, total tps = 16, recent tps = 16, master-binlog = (bin-log-mysqld1.000085, 720134591), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103374851, syncer-binlog = (bin-log-mysqld1.000085, 720134591), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103374851
2018/10/26 17:53:54 meta.go:137: [info] save position to file, binlog-name:bin-log-mysqld1.000085 binlog-pos:720134591 binlog-gtid:a2c131c8-2729-11e8-b0fd-005056a2d719:1-103374851
2018/10/26 17:54:01 syncer.go:920: [info] [syncer]total events = 1456, total tps = 24, recent tps = 32, master-binlog = (bin-log-mysqld1.000085, 720234617), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375073, syncer-binlog = (bin-log-mysqld1.000085, 720234617), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375073
2018/10/26 17:54:30 meta.go:137: [info] save position to file, binlog-name:bin-log-mysqld1.000085 binlog-pos:720236923 binlog-gtid:a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375077
2018/10/26 17:54:31 syncer.go:920: [info] [syncer]total events = 1476, total tps = 16, recent tps = 0, master-binlog = (bin-log-mysqld1.000085, 720237460), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375078, syncer-binlog = (bin-log-mysqld1.000085, 720237460), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375078
2018/10/26 17:55:00 meta.go:137: [info] save position to file, binlog-name:bin-log-mysqld1.000085 binlog-pos:720240778 binlog-gtid:a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375080
2018/10/26 17:55:01 syncer.go:920: [info] [syncer]total events = 1960, total tps = 16, recent tps = 16, master-binlog = (bin-log-mysqld1.000085, 720279586), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375179, syncer-binlog = (bin-log-mysqld1.000085, 720279586), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103375179
  1. "replicate-do-db":["xxx","yyy","zzz", a few more]
    it seems that crash occured when there's a sql matched in replicate-do-db.

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

sorry, make sure the Server running Syncer can connect to TiDB but not mysql, it looks can't connect to TiDB when it exec sql syncing data to TiDB

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Network and auth of "from" and "to" end works. I have tested dml operation connecting to tidb, it's OK.

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

do you using the same config in Syncer while tested by mysql client? if still has problem can you show me the config and more log near the Fatal line?

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024
  • config of Syncer as follows:
log-level = "info"

server-id = 17153306

# The file path for meta:
meta = "./syncer.meta"

worker-count = 16
batch = 10

# The testing address for pprof. It can also be used by Prometheus to pull Syncer metrics.
# Change "127.0.0.1" to the IP address of the corresponding host
status-addr = "10.21.17.15:10086"

# Note: skip-sqls is abandoned, and use skip-ddls instead.
# skip-ddls skips the DDL statements that are incompatible with TiDB, and supports regular expressions.
# skip-ddls = ["^CREATE\\s+USER"]

# Note: skip-events is abandoned, and use skip-dmls instead.
# skip-dmls skips the DML statements. The type value can be 'insert', 'update' and 'delete'.
# The 'delete' statements that skip-dmls skips in the foo.bar table:
# [[skip-dmls]]
# db-name = "foo"
# tbl-name = "bar"
# type = "delete"
#
# The 'delete' statements that skip-dmls skips in all tables:
# [[skip-dmls]]
# type = "delete"
#
# The 'delete' statements that skip-dmls skips in all foo.* tables:
# [[skip-dmls]]
# db-name = "foo"
# type = "delete"

# Specify the database name to be synchronized. Support regular expressions. Start with '~' to use regular expressions.
# replicate-do-db = ["~^b.*","s1"]
replicate-do-db = ["zzzz_xxxx","xxxxx_yyyy_zzzz_broadcast","xxxxx_yyyy_zzzz_collector","xxxxx_yyyy_trade","yyyy_statistics","xxxxx_yyyy_pay","zzzzzz_admin"]

# Specify the db.table to be synchronized.
# db-name and tbl-name do not support the `db-name ="dbname, dbname2"` format.
# [[replicate-do-table]]
# db-name ="dbname"
# tbl-name = "table-name"

# [[replicate-do-table]]
# db-name ="dbname1"
# tbl-name = "table-name1"

# Specify the db.table to be synchronized. Support regular expressions. Start with '~' to use regular expressions.
# [[replicate-do-table]]
# db-name ="test"
# tbl-name = "~^a.*"

# Specify the database you want to ignore in synchronization. Support regular expressions. Start with '~' to use regular expressions.
# replicate-ignore-db = ["~^b.*","s1"]

# Specify the database table you want to ignore in synchronization.
# db-name and tbl-name do not support the `db-name ="dbname, dbname2"` format.
# [[replicate-ignore-table]]
# db-name = "your_db"
# tbl-name = "your_table"

# Specify the database table you want to ignore in synchronization. Support regular expressions. Start with '~' to use regular expressions.
# [[replicate-ignore-table]]
# db-name ="test"
# tbl-name = "~^a.*"

# The sharding synchronizing rules support wildcharacter.
# 1. The asterisk character ("*", also called "star") matches zero or more characters,
#    For example, "doc*" matches "doc" and "document" but not "dodo";
#    The asterisk character must be in the end of the wildcard word,
#    and there is only one asterisk in one wildcard word.
# 2. The question mark ("?") matches any single character.
# [[route-rules]]
# pattern-schema = "route_*"
# pattern-table = "abc_*"
# target-schema = "route"
# target-table = "abc"

# [[route-rules]]
# pattern-schema = "route_*"
# pattern-table = "xyz_*"
# target-schema = "route"
# target-table = "xyz"

[from]
host = "10.10.12.116"
user = "root"
password = "daydayup"
port = 3306

[to]
host = "10.21.17.15"
user = "tester"
password = "tester@tidb"
port = 4000
  • log near crash.
018/10/26 22:04:01 syncer.go:920: [info] [syncer]total events = 6522, total tps = 21, recent tps = 33, master-binlog = (bin-log-mysqld1.000085, 1026455455), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103498822, syncer-binlog = (bin-log-mysqld1.000085, 1026455455), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103498822
2018/10/26 22:04:31 syncer.go:920: [info] [syncer]total events = 6522, total tps = 19, recent tps = 0, master-binlog = (bin-log-mysqld1.000085, 1026464060), master-binlog-gtid=a2c131c8-2729-11e8-b0fd-005056a2d719:1-103498825, syncer-binlog = (bin-log-mysqld1.000085, 1026464060), syncer-binlog-gtid = a2c131c8-2729-11e8-b0fd-005056a2d719:1-103498825
2018/10/26 22:05:00 db.go:130: [warning] [exec][sql]UPDATE `zzzz_xxxx`.`ep_edu_course_marketing_statistics` SET `id` = ?, `data_id` = ?, `data_type` = ?, `course_uv` = ?, `course_conversion_rate` = ?, `create_time` = ?, `update_time` = ? WHERE `id` = ? LIMIT 1;[args][1 a3274369923d47008a0ec821a88e6a15 1 10 0 2018-09-20 17:21:01 2018-10-26 22:04:46 1][error]driver: bad connection
2018/10/26 22:05:00 db.go:133: [error] [exec][sql]UPDATE `zzzz_xxxx`.`ep_edu_course_marketing_statistics` SET `id` = ?, `data_id` = ?, `data_type` = ?, `course_uv` = ?, `course_conversion_rate` = ?, `create_time` = ?, `update_time` = ? WHERE `id` = ? LIMIT 1;[args][1 a3274369923d47008a0ec821a88e6a15 1 10 0 2018-09-20 17:21:01 2018-10-26 22:04:46 1][error]invalid connection
2018/10/26 22:05:00 db.go:102: [error] [exec][sql][UPDATE `zzzz_xxxx`.`ep_edu_course_marketing_statistics` SET `id` = ?, `data_id` = ?, `data_type` = ?, `course_uv` = ?, `course_conversion_rate` = ?, `create_time` = ?, `update_time` = ? WHERE `id` = ? LIMIT 1;][args][[1 a3274369923d47008a0ec821a88e6a15 1 10 0 2018-09-20 17:21:01 2018-10-26 22:04:46 1]][error]driver: bad connection
2018/10/26 22:05:00 syncer.go:490: [fatal] driver: bad connection
/home/jenkins/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/syncer/db.go:136:
/home/jenkins/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/syncer/db.go:103:
2018/10/26 22:05:01 printer.go:52: [info] Welcome to syncer
2018/10/26 22:05:01 printer.go:53: [info] Release Version: v1.0.0-39-gd68cb83
2018/10/26 22:05:01 printer.go:54: [info] Git Commit Hash: d68cb83af5628aca4a98a84b4ef83ccd65e84d2b
2018/10/26 22:05:01 printer.go:55: [info] Git Branch: master
2018/10/26 22:05:01 printer.go:56: [info] UTC Build Time: 2018-10-17 09:03:40
2018/10/26 22:05:01 printer.go:57: [info] Go Version: go version go1.11 linux/amd64
2018/10/26 22:05:01 main.go:55: [info] config: {"log-level":"info","log-file":"syncer.log","log-rotate":"day","status-addr":"10.21.17.15:10086","server-id":17153306,"meta":"./syncer.meta","persistent-dir":"","flavor":"mysql","worker-count":16,"batch":10,"max-retry":100,"replicate-do-table":null,"replicate-do-db":["zzzz_xxxx","xxxxx_yyyy_zzzz_broadcast","xxxxx_yyyy_zzzz_collector","xxxxx_yyyy_trade","yyyy_statistics","xxxxx_yyyy_pay","zzzzzz_admin"],"replicate-ignore-table":null,"replicate-ignore-db":null,"skip-sqls":null,"skip-dmls":null,"route-rules":null,"from":{"host":"10.10.12.116","user":"root","port":3306},"to":{"host":"10.21.17.15","user":"seewo","port":4000},"enable-gtid":true,"auto-fix-gtid":false,"disable-detect":false,"safe-mode":false,"config-file":"config.toml","stop-on-ddl":false,"execute-ddl-timeout":"3h","execute-dml-timeout":"1m","execute-queue-length":5000,"enable-ansi-quotes":false}
2018/10/26 22:05:01 metrics.go:117: [info] listening on 10.21.17.15:10086 for status and metrics report.
  • in fact , I have no idea what's the meaning of same config; MySQL user is the same.

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

One more thing, because Syncer is crashing frequently, so i use supervisord to manage it.

[program:tidb-syncer]
command=/usr/local/tidb/tools/syncer -config config.toml -enable-gtid -log-file syncer.log -log-rotate day
process_name=%(program_name)s
user=root
directory=/usr/local/tidb/tools/
stdout_logfile=/usr/local/tidb/tools/logs/stdout.log
stderr_logfile=/usr/local/tidb/tools/logs/stderr.log
autorestart=true
  • gtid_mode is set ON. binlog checking passed.

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Replication works normally, I have checked the data replication from master side. And tidb_server with Syncer can replicate successfully.

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024
2018/10/26 22:05:00 db.go:130: [warning] [exec][sql]UPDATE `zzzz_xxxx`.`ep_edu_course_marketing_statistics` SET `id` = ?, `data_id` = ?, `data_type` = ?, `course_uv` = ?, `course_conversion_rate` = ?, `create_time` = ?, `update_time` = ? WHERE `id` = ? LIMIT 1;[args][1 a3274369923d47008a0ec821a88e6a15 1 10 0 2018-09-20 17:21:01 2018-10-26 22:04:46 1][error]driver: bad connection

can you try exec this using mysql client using prepare statement directly

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024
  • using statement to connect tidb directly doesn't work.
mysql> SET @sql = 'update  ep_performance_team_score_bak set criticism=5 where id=10';
Query OK, 0 rows affected (0.01 sec)

mysql> PREPARE stmt FROM @sql;
ERROR 1105 (HY000): Can not prepare multiple statements

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Another test:
execute the following prepare statement in master, TIDB also can sync the change from master without any crash information.

[email protected]:3306 [xxx]> SET @sql = 'update  ep_performance_team_score_bak set criticism=0 where id=?';
Query OK, 0 rows affected (0.00 sec)

[email protected]:3306 [xxx]> PREPARE stmt FROM @sql;
Query OK, 0 rows affected (0.00 sec)
Statement prepared

[email protected]:3306 [xxx]> set @id=10;
Query OK, 0 rows affected (0.00 sec)

[email protected]:3306 [xxx]> EXECUTE stmt using @id;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

[email protected]:3306 [xxx]> DEALLOCATE PREPARE stmt;

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

you means execute in Mysql and the data can be sync to TiDB by Syncer ?
does the data of table ep_edu_course_marketing_statistics can be synced to TiDB just some time fail to exec sql like the log you paste or totally can't be synced to TiDB ?(fail every time like the log you paste once it exec sql syncing data to TiDB)

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024
  • using statement to connect tidb directly doesn't work.
mysql> SET @sql = 'update  ep_performance_team_score_bak set criticism=5 where id=10';
Query OK, 0 rows affected (0.01 sec)

mysql> PREPARE stmt FROM @sql;
ERROR 1105 (HY000): Can not prepare multiple statements

look like a issue of TiDB: pingcap/tidb#8074, but the problem here is not caused by this, it's ok to write it like prepare stmt from 'update ep_performance_team_score_bak set criticism=5 where id=10'; not using variable

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024
you means execute in Mysql and the data can be sync to TiDB by Syncer ?
does the data of table ep_edu_course_marketing_statistics can be synced to TiDB just some time fail to exec sql like the log you paste or totally can't be synced to TiDB ?(fail every time like the log you paste once it exec sql syncing data to TiDB)
  1. some DML operations executed by me manually are synced to TIDB, that's what i validated.
  2. i didn't figure out whether those failed sql can be synced to TIDB or not when "fail to exec sql" occur.
  3. do you have any clue that we can debug the issue, as you know, it happens almost every 5minutes.

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

i first thought totally can't be sync to TiDB, but according what you just said seems just some time fail, according to log, seems the connection was closed unexpectedly by TiDB, you can check the log of TiDB when bad connection happened

i first thought totally can't be sync to TiDB, but according what you just said seems just some time fail, according to

it will not be sync to TiDB

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Is there any tool to check consistency and correctness of the data records between Master and tidb ?

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

take a look at https://github.com/pingcap/tidb-tools/tree/master/sync_diff_inspector

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024
  1. 目前数据不一致
  2. 崩溃频率这么高,似乎你们又没有动力解决,而我们没有代码,也没法debug;我也没有给你们付费,也不能催你们;
  3. 感谢你们的努力,很希望能把整个集群用起来

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024
  • the the data has not completely synced to downstream or you are still writing at upstream, then will not consistent
  • as said before, if fail to execute the sql and quit, so you can check the tidb log
  • we are willing you help you

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

How stupid i am! i only focus on Syncer's log.
I's bad news, crash called by change auto_crement primary key.
int(11) --> int(10) unsigned first.
I manually create a new table and swap the tables using rename.And skip the gtid transaction in syncer.meta

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

Sorry, I don't understand what you are trying to say, tidb crash?
so, everything working now? maybe you take a look at同步前检查

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

two different issue:

  1. alter primary key would make tidb generate a warning(not crash, log as follows) and connection broken as expected. As a result, Syncer crashed.
  2. Syncer would crash every 5 minutes, and we didn't figure out why.
  3. I run checker before sync the data, it look good.
2018/10/30 20:04:58.264 conn.go:488: [warning] con:49690 dispatch error:
id:49690, addr:10.21.17.15:32310 status:3, collation:utf8_general_ci, user:seewo
"USE `easi_pass`; ALTER TABLE `ep_delivery_addr` MODIFY COLUMN `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT FIRST;"
[ddl:203]unsupported modify column length 10 is less than origin 11
github.com/pingcap/tidb/vendor/github.com/pkg/errors.AddStack
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/vendor/github.com/pkg/errors/errors.go:173
github.com/pingcap/tidb/terror.(*Error).GenWithStackByArgs
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/terror/terror.go:231
github.com/pingcap/tidb/ddl.modifiable
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/ddl/ddl_api.go:1429
github.com/pingcap/tidb/ddl.(*ddl).getModifiableColumnJob
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/ddl/ddl_api.go:1637
github.com/pingcap/tidb/ddl.(*ddl).ModifyColumn
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/ddl/ddl_api.go:1722
github.com/pingcap/tidb/ddl.(*ddl).AlterTable
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/ddl/ddl_api.go:1093
github.com/pingcap/tidb/executor.(*DDLExec).executeAlterTable
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/ddl.go:265
github.com/pingcap/tidb/executor.(*DDLExec).Next
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/ddl.go:88
github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/adapter.go:272
github.com/pingcap/tidb/executor.(*ExecStmt).Exec
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/executor/adapter.go:236
github.com/pingcap/tidb/session.runStmt
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/session/tidb.go:149
github.com/pingcap/tidb/session.(*session).executeStatement
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/session/session.go:741
github.com/pingcap/tidb/session.(*session).execute
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/session/session.go:812
github.com/pingcap/tidb/session.(*session).Execute
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/session/session.go:762
github.com/pingcap/tidb/server.(*TiDBContext).Execute
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/server/driver_tidb.go:240
github.com/pingcap/tidb/server.(*clientConn).handleQuery
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:874
github.com/pingcap/tidb/server.(*clientConn).dispatch
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:626
github.com/pingcap/tidb/server.(*clientConn).Run
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:470
github.com/pingcap/tidb/server.(*Server).onConn
	/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/server/server.go:324
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1333
2018/10/30 20:04:58.265 server.go:316: [info] con:49690 close connection

from tidb-tools.

july2993 avatar july2993 commented on August 12, 2024

1 TiDB don't support the ddl (https://github.com/pingcap/docs-cn/blob/master/sql/mysql-compatibility.md, so you must avoid such DDL if you want to use TiDB
2 as said before, if fail to execute the sql, it will quit itself and log the reason, like bad connection

from tidb-tools.

IANTHEREAL avatar IANTHEREAL commented on August 12, 2024

@jianhaiqing I need u provide some informations

  • do you deploy prometheus monitor for syncer?
  • how about avg latency of tidb transaction?

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

yes, but only four items have value on the dashboard.

  • binlog pos: syncer_binlog_pos{node="master"}, syncer_binlog_pos{node="syncer"}
  • syncer_binlog_file: syncer_binlog_file{node="master"}, syncer_binlog_file{node="syncer"}
  • syncer_binlog_file{node="master"} - ON(instance, job) syncer_binlog_file{node="syncer"}
  • binlog skipped events: irate(syncer_binlog_skipped_events_total[1m])

There's no any latency here, as TPS is very log in development environment, but data rows are not consistent because of bad connection. I have not figure out why.

from tidb-tools.

IANTHEREAL avatar IANTHEREAL commented on August 12, 2024

things you can try:

  • update syncer grafana dashboard
  • I guess your latency of transaction is very large, add arguments in head of syncer config file
    execute-dml-timeout = "1h"

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

Many thanks for the updated syncer dashboard.
I think the bad connection is triggerred by timestamp value set '2016-01-01 00:00:00' ( default value, can't be limited by sql_mode.)

from tidb-tools.

IANTHEREAL avatar IANTHEREAL commented on August 12, 2024

is everything fine afer you change sql_mode? @jianhaiqing

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

columns such as,
timestamp timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
last_access_time datetime NOT NULL DEFAULT '2016-01-01 00:00:00' COMMENT '最后一次访问时间'
although sql_mode is set "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION",
'0000-00-00 00:00:00' or '2016-01-01 00:00:00' can be inserted successfully;

Tidb will be crashed if the column datetime is set to zero. ( such as '2016-01-01 00:00:00' or '0000-00-00 00:00:00' );

So i have to change the default value.

from tidb-tools.

jianhaiqing avatar jianhaiqing commented on August 12, 2024

So far, it looks good

from tidb-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.