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

Invalid default value for 'WoStatusChanged' #78

Closed
HugoFara opened this issue Nov 23, 2022 · 6 comments
Closed

Invalid default value for 'WoStatusChanged' #78

HugoFara opened this issue Nov 23, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@HugoFara
Copy link
Owner

A bug originally signaled by @jzohrab on Discord.

When installing the default demo database, there is a possibility f it failing with a message ERROR 1067 (42000): Invalid default value for 'WoStatusChanged'. This is appends when NO_ZERO_DATE mode is disabled in MySQL configuration.

Since this mode is deprecated according to Server SQL Modes#NO_ZERO_DATE, a default date of 1970-01-01 00:00:01 should be enough.

@HugoFara HugoFara added the bug Something isn't working label Nov 23, 2022
@HugoFara
Copy link
Owner Author

Finally a default date of 0000-00-00 00:00:01 may do the trick, since 0000-00-00 00:00:00 is the timestamp 1970-01-01 00:00:01.

@juliandoerner
Copy link

This error is still present when using docker compose. I don't really understand the bug-fix. Do you have a glue why this happens?

@jzohrab
Copy link

jzohrab commented Jan 17, 2023

00000…1 isn’t a valid time stamp. Per https://dev.mysql.com/doc/refman/8.0/en/datetime.html:

The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.

Depending on your system, MySQL sometimes accepts invalid time stamps, but since docker is always the same system, it probably needs to be changed to the correct value.

@juliandoerner
Copy link

Undoing the changes from a325106 did the trick to me.

Here is the diff

diff --git a/inc/database_connect.php b/inc/database_connect.php
index f1ce5c1..132d2b0 100644
--- a/inc/database_connect.php
+++ b/inc/database_connect.php
@@ -1965,7 +1965,7 @@ function check_update_db($debug, $tbpref, $dbname): void
                 WoSentence varchar(1000) DEFAULT NULL, 
                 WoWordCount tinyint(3) unsigned NOT NULL DEFAULT 0, 
                 WoCreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 
-                WoStatusChanged timestamp NOT NULL DEFAULT '0000-00-00 00:00:01', 
+                WoStatusChanged timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', 
                 WoTodayScore double NOT NULL DEFAULT '0', 
                 WoTomorrowScore double NOT NULL DEFAULT '0', 
                 WoRandom double NOT NULL DEFAULT '0', 

This however might be not satisfying but I don't have any knowledge about mysql and php..

@HugoFara
Copy link
Owner Author

I'm investigating the issue. From what I have tested, a default date of 1970-01-01 12:00:00 works, while dates like 1970-01-01 00:00:00 doesn't. Could you confirm it is the same for you?

This issue is a bit confusing because the official doc does not say timestamps such as 1970-01-01 00:00:00 should work, but don't from what I've tested.

@HugoFara HugoFara reopened this Jan 18, 2023
@juliandoerner
Copy link

According to the documentation as mentioned by jzohrab, 1970-01-01 00:00:00 is outside of the range.

HugoFara added a commit that referenced this issue Dec 28, 2023
…removes dead feeds #148.

Issue #78: we do no longer need an explicit bypass of the default timestamp rule.
ProgramComputer added a commit to ProgramComputer/lwt that referenced this issue Dec 29, 2023
* Code clean-up with the audio controller.
Remove the unitended declaration of global variables.

* Refactor audio_controller in  object  namespace style.
Backward compatibility is kept.

* Fixes HugoFara#138: changing audio speed was partially broken.

* Replaces calls to global audio functions by the new object.
Removes the undocumented audio functions.

* Avoid unnecessary function return type.

* Fixes "text_id is unkown" on text opening.

* Fixes warning on step 2 of feed wizard (related to HugoFara#129)

* Reorders functions to be in logical declaration order.

* Code cleaning.

* Refactoring jq_feedwizard as object namespace.

* Synctactic sugar on jq_feedwizard.js.

* Adds an helper object to avoid one-line JS.

* Prettyfies JS code.

* Isolates JS code in feed wizard step 3.

* Use json_encode to avoid PHP incursion in JS code.
Code prettyfying.

* Beautify JS and avoid calls to deprecated functions.

* Fixes JS errors on feeds: xPath was not set, and it was sometimes leave step 2.

* Beautifies demo DB as the users has the right to see what they install.

* Fix: the demo database was unreadable since last commit.
restore_file is much better at parsing SQL.

* Stop reading demo on errors, syntactic suger.

* Better detection of file end not read.

* Changes WoStatusChange to a value that doesn't need configuration change (HugoFara#78).

* Implementes HugoFara#148: removes dead feeds from demo database.

* Fixes a bug introduced in a previous commit.
Signalled by  @ProgramComputer.

* Fixes HugoFara#151: click delete on a language deletes the language.

* Multi-image docker

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>
ProgramComputer added a commit to ProgramComputer/lwt that referenced this issue Dec 30, 2023
* Code clean-up with the audio controller.
Remove the unitended declaration of global variables.

* Refactor audio_controller in  object  namespace style.
Backward compatibility is kept.

* Fixes HugoFara#138: changing audio speed was partially broken.

* Replaces calls to global audio functions by the new object.
Removes the undocumented audio functions.

* Avoid unnecessary function return type.

* Fixes "text_id is unkown" on text opening.

* Fixes warning on step 2 of feed wizard (related to HugoFara#129)

* Reorders functions to be in logical declaration order.

* Code cleaning.

* Refactoring jq_feedwizard as object namespace.

* Synctactic sugar on jq_feedwizard.js.

* Adds an helper object to avoid one-line JS.

* Prettyfies JS code.

* Isolates JS code in feed wizard step 3.

* Use json_encode to avoid PHP incursion in JS code.
Code prettyfying.

* Beautify JS and avoid calls to deprecated functions.

* Fixes JS errors on feeds: xPath was not set, and it was sometimes leave step 2.

* Beautifies demo DB as the users has the right to see what they install.

* Fix: the demo database was unreadable since last commit.
restore_file is much better at parsing SQL.

* Stop reading demo on errors, syntactic suger.

* Better detection of file end not read.

* Changes WoStatusChange to a value that doesn't need configuration change (HugoFara#78).

* Implementes HugoFara#148: removes dead feeds from demo database.

* Fixes a bug introduced in a previous commit.
Signalled by  @ProgramComputer.

* Fixes HugoFara#151: click delete on a language deletes the language.

* Multi-image docker

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* future php platforms

* less vulnerabilities for larger size

* Lwt is accessed at /lwt/

https://hugofara.github.io/lwt/docs/info.html#install

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>
ProgramComputer added a commit to ProgramComputer/lwt that referenced this issue Dec 30, 2023
* Code clean-up with the audio controller.
Remove the unitended declaration of global variables.

* Refactor audio_controller in  object  namespace style.
Backward compatibility is kept.

* Fixes HugoFara#138: changing audio speed was partially broken.

* Replaces calls to global audio functions by the new object.
Removes the undocumented audio functions.

* Avoid unnecessary function return type.

* Fixes "text_id is unkown" on text opening.

* Fixes warning on step 2 of feed wizard (related to HugoFara#129)

* Reorders functions to be in logical declaration order.

* Code cleaning.

* Refactoring jq_feedwizard as object namespace.

* Synctactic sugar on jq_feedwizard.js.

* Adds an helper object to avoid one-line JS.

* Prettyfies JS code.

* Isolates JS code in feed wizard step 3.

* Use json_encode to avoid PHP incursion in JS code.
Code prettyfying.

* Beautify JS and avoid calls to deprecated functions.

* Fixes JS errors on feeds: xPath was not set, and it was sometimes leave step 2.

* Beautifies demo DB as the users has the right to see what they install.

* Fix: the demo database was unreadable since last commit.
restore_file is much better at parsing SQL.

* Stop reading demo on errors, syntactic suger.

* Better detection of file end not read.

* Changes WoStatusChange to a value that doesn't need configuration change (HugoFara#78).

* Implementes HugoFara#148: removes dead feeds from demo database.

* Fixes a bug introduced in a previous commit.
Signalled by  @ProgramComputer.

* Fixes HugoFara#151: click delete on a language deletes the language.

* Multi-image docker

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* future php platforms

* less vulnerabilities for larger size

* Lwt is accessed at /lwt/

https://hugofara.github.io/lwt/docs/info.html#install

* Update Dockerfile

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>
ProgramComputer added a commit to ProgramComputer/lwt that referenced this issue Dec 30, 2023
* Patch 6 (#2)

* Code clean-up with the audio controller.
Remove the unitended declaration of global variables.

* Refactor audio_controller in  object  namespace style.
Backward compatibility is kept.

* Fixes HugoFara#138: changing audio speed was partially broken.

* Replaces calls to global audio functions by the new object.
Removes the undocumented audio functions.

* Avoid unnecessary function return type.

* Fixes "text_id is unkown" on text opening.

* Fixes warning on step 2 of feed wizard (related to HugoFara#129)

* Reorders functions to be in logical declaration order.

* Code cleaning.

* Refactoring jq_feedwizard as object namespace.

* Synctactic sugar on jq_feedwizard.js.

* Adds an helper object to avoid one-line JS.

* Prettyfies JS code.

* Isolates JS code in feed wizard step 3.

* Use json_encode to avoid PHP incursion in JS code.
Code prettyfying.

* Beautify JS and avoid calls to deprecated functions.

* Fixes JS errors on feeds: xPath was not set, and it was sometimes leave step 2.

* Beautifies demo DB as the users has the right to see what they install.

* Fix: the demo database was unreadable since last commit.
restore_file is much better at parsing SQL.

* Stop reading demo on errors, syntactic suger.

* Better detection of file end not read.

* Changes WoStatusChange to a value that doesn't need configuration change (HugoFara#78).

* Implementes HugoFara#148: removes dead feeds from demo database.

* Fixes a bug introduced in a previous commit.
Signalled by  @ProgramComputer.

* Fixes HugoFara#151: click delete on a language deletes the language.

* Multi-image docker

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* future php platforms

* less vulnerabilities for larger size

* Lwt is accessed at /lwt/

https://hugofara.github.io/lwt/docs/info.html#install

* Update Dockerfile

* Update docker-image.yml

* Update Dockerfile

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>
ProgramComputer added a commit to ProgramComputer/lwt that referenced this issue Dec 31, 2023
* Code clean-up with the audio controller.
Remove the unitended declaration of global variables.

* Refactor audio_controller in  object  namespace style.
Backward compatibility is kept.

* Fixes HugoFara#138: changing audio speed was partially broken.

* Replaces calls to global audio functions by the new object.
Removes the undocumented audio functions.

* Avoid unnecessary function return type.

* Fixes "text_id is unkown" on text opening.

* Fixes warning on step 2 of feed wizard (related to HugoFara#129)

* Reorders functions to be in logical declaration order.

* Code cleaning.

* Refactoring jq_feedwizard as object namespace.

* Synctactic sugar on jq_feedwizard.js.

* Adds an helper object to avoid one-line JS.

* Prettyfies JS code.

* Isolates JS code in feed wizard step 3.

* Use json_encode to avoid PHP incursion in JS code.
Code prettyfying.

* Beautify JS and avoid calls to deprecated functions.

* Fixes JS errors on feeds: xPath was not set, and it was sometimes leave step 2.

* Beautifies demo DB as the users has the right to see what they install.

* Fix: the demo database was unreadable since last commit.
restore_file is much better at parsing SQL.

* Stop reading demo on errors, syntactic suger.

* Better detection of file end not read.

* Changes WoStatusChange to a value that doesn't need configuration change (HugoFara#78).

* Implementes HugoFara#148: removes dead feeds from demo database.

* Fixes a bug introduced in a previous commit.
Signalled by  @ProgramComputer.

* Fixes HugoFara#151: click delete on a language deletes the language.

* Multi-image docker

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* future php platforms

* less vulnerabilities for larger size

* Lwt is accessed at /lwt/

https://hugofara.github.io/lwt/docs/info.html#install

* Update Dockerfile

* Update docker-image.yml

* Update Dockerfile

* Update docker-image.yml

---------

Co-authored-by: HugoFara <hugo.farajallah@protonmail.com>
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

3 participants