This repository was archived by the owner on Oct 13, 2024. It is now read-only.
fix mysql master_lock table schema wrong default value#446
Merged
zhfeng merged 1 commit intoapache:masterfrom Apr 3, 2019
loveoobaby:fix_mysql_schema
Merged
fix mysql master_lock table schema wrong default value#446zhfeng merged 1 commit intoapache:masterfrom loveoobaby:fix_mysql_schema
zhfeng merged 1 commit intoapache:masterfrom
loveoobaby:fix_mysql_schema
Conversation
zhfeng
suggested changes
Apr 2, 2019
| serviceName varchar(36) not NULL, | ||
| expireTime timestamp(3) not NULL, | ||
| lockedTime timestamp(3) not NULL, | ||
| expireTime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
Contributor
There was a problem hiding this comment.
It looks like the expireTime should be NULL if no timeout setting. @WillemJiang can you confirm it ?
Contributor
Author
There was a problem hiding this comment.
if expireTime can be null, the sql should change to:
CREATE TABLE IF NOT EXISTS master_lock (
serviceName varchar(36) not NULL,
expireTime datetime,
lockedTime datetime not NULL DEFAULT CURRENT_TIMESTAMP,
instanceId varchar(255) not NULL,
PRIMARY KEY (serviceName)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Member
There was a problem hiding this comment.
I have no problem testing in my local, it may be that your MySQL has set NO_ZEROR_DATE, you can check the following through the following command line
show variables like 'sql_mode'Of course, I agree with this modification.
Member
There was a problem hiding this comment.
If there is no side effect of using the CURRENT_TIMESTAMP ad the default value. We could just accept the PR.
Contributor
|
Thanks @loveoobaby for your contribution ! |
Member
|
@zhfeng I think we can just accept the PR without request further change. |
Contributor
|
LGTM |
zhfeng
approved these changes
Apr 3, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Mysql table schema in schema-mysql.sql has some problem.
I try to use MySQL as alpha's backend database:
but encounter one problem, the log: