Closed fabiobatalha closed 6 years ago
Haven't seen this before -- under what circumstance did it occur?
It happens when you install OTS for the first time.
I'm having it because I'm building the dockerized environment. The datamodel do not define the trace field as default Null.
I fixed the error just adjusting the default value of the field "trace" to Null after initialize the database.
Can you replicate it with https://github.com/axfelix/ots-vagrant ?
It might be a difference between MySQL versions or something... I haven't encountered it yet...
I didn't tried vagrant.
I didn't mean vagrant specifically, I meant the environment / packages that are used in that vagrant installer -- there might be a mismatch that's triggering this.
ahh ok.. The MySQL version is not pinned in the xmlps.sh file so to figure out the version I will need to replicate the vagrant environment, but it seems to be old because PHP is still the v5.2.
The version I'm using in the Docker Environment is the last one available: mysql Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper
Recent versions of MySQL are quite strict with Data Definition statements. Multiple SQL mode have been introduced. I am not sure if this issue is related but check your Mysql install SQL mode. Sometimes a quick a dirty way is to run set sql_mode='';
before your SQL statements.
Hello @kaschioudi
Yes, a more strict Data Definition lead to a better quality and predicted behaviour. I think the matter of this issue is not to prove in which version of MySQL the code works or not, but improve the source code of OTS.
It seems to me a clear missing configuration in the data model according to the usage of it. I mean, in one side, there are input attempts that do not explicit define a value for the field queue_default.trace, in the other side, the data model do not explicit define a default value to the field queue_default.trace, and all this is leading to the given error.
Thank you @fabiobatalha for you valuable contributions. I was not providing a final solution to this issue..
You mentioned having an error while building a docker environment and that you fixed the error by adjusting the default value of the field "trace" to Null *after* initialize the database.
I was just suggesting a quick workaround to get you up and running with your recent version of MySQL using the existing codebase.
@kaschioudi Thanks!
I already worked around it. From my side it is ok, the change I made in the database allowed me to fully test the Docker Environment, The Docker Image is published and working.
FYI, I would happily merge a forward-compatible fix for this if you had one :)
I don't but I will try to do it, and make a PR.
OK, I didn't realize this was actually just toggling some existing behaviour rather than adding a declaration, which is confusing, I'll have to test more why this is happening unless @kaschioudi has any ideas
@axfelix : I tested this today. You can rebase and merge this.
Basically this will make trace
column of queue_default
table nullable.
Thanks, done!