Closed HolQue closed 1 year ago
As discussed we allow on database level names up to 100 char. On WebApp level we need to map project/variant to a shorter name. *log2db* tools nee do be adapter accordingly.
Hi Ngoan,
what is the function of DB_STR_FIELD_MAXLENGTH
? As per my understanding this is all defined on database level and in case of violations the mysql-client will raise a good exception?
So this would be redundant and difficult to maintain code?
Thank you,
Thomas
Hi Thomas,
The definition DB_STR_FIELD_MAXLENGTH is used for 2 purposes:
--dryrun
(without touching db).
=> We can remove the validation id import tool to avoid duplicated maintenance if there is some change in db due to column max length.In previous implementations, the numbers are used for truncating without any meanings. So I collected all of them and define as DB_STR_FIELD_MAXLENGTH to make they are meaningful and easy to maintain.
There are many definitions in side it but just some of them are used but I defined all imported information in case they are used in future (if we define the mapped information and it requires string truncation). => For sure we can remove the definitions that are not used now.
Thank you, Ngoan
"Truncate"???? What is this?
Let's assume: MAXLEN = 5 DB app gets "testname_1" and "testname_1" and sends two times "testn..."? Really?
This would cause ambiguities. I cannot believe that we make it so much easy to run into troubles.
In my opinion the DB apps should not be allowed to do any modification of the transported values.
If truncation, then in web app, but not in database!
Hi Ngoan, which with pull-request is this solved? thank you, Thomas
Hi Thomas,
This issue has been fixed in merged request #41 . This ticket can be closed now.
Thank you, Ngoan
solved and merged with #41
While testing I got the following error:
Here I have doubts. Why does RobotLog2DB check the string length? The type and the size of database table entries are usually checked by the database itself. If a database client exceeds any limit while writing, the database returns an error.
RobotLog2DB defines a big list of string lenghts:
DB_STR_FIELD_MAXLENGTH
. These string lenghts are now defined at two positions: within the app and within the database - and therefore must be maintained twice. This should not be necessary.