Needs work
Project:
Drupal core
Version:
main
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jan 2020 at 21:49 UTC
Updated:
30 Jan 2023 at 23:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bohart+ added the proper tag.
Comment #3
bohartHere is a proper patch.
Comment #4
daffie commented@bohart: Could add some more documentation to the patch. Say that Oracle has a limit of 38 and add a link to the Oracle page where they state that the limit is 38. After that is it RTBC for me.
Comment #5
dhirendra.mishra commentedLet me do that.
Comment #6
dhirendra.mishra commentedPlease find the Attached patch and inter diff to review.
Let me know if any further changes to be made.
Comment #7
dhirendra.mishra commentedAdded link text further to above patch.Please refer this patch.
Comment #8
daffie commented@dhirendra.mishra: Could you put all above or all below
foreach ([1, 5, 10, 38] as $precision) {. Thank you for adding the correct link.Comment #9
dhirendra.mishra commentedHope its corrected now.
Comment #10
daffie commented@dhirendra.mishra: Thanks!
For me it is RTBC.
Comment #11
alexpottAnd what happens when someone wants to support a DB that has even less precision support?
As I've said in other issues we need to come up with a better way to support testing of contrib database testing using core tests. If we were to add another driver to core knowing that it differed in the amount of precision it supports would be useful - especially when that limit is lower than what core's supplied drivers support. What happens now if someone adds a precision of 60 to a contrib or core db field?
That said, the field system currently has:
This comment is not flowing properly - i.e always using the full 80 characters and the first fullstop is in an interesting place. Plus the latest oracle db server is 20 and this points to 10. So https://docs.oracle.com/en/database/oracle/oracle-database/20/refrn/data... is a better link. But I think that this comment needs to be re-written and point to the UI limit as a sensible maximum to test to. If a driver doesn't support 32 then they'd need to handle fields created via the UI.
Comment #12
daffie commentedAs test changes for contrib database drivers are not allowed into core. I would like to suggest a different approach. I have moved the array of values for which the precision of numeric values is tested to a class variable. The Oracle database driver can then add an test by extending the test class SchemaTest in the following way:
In the file
phpunit.xmla exclude group must then be added (See: https://phpunit.readthedocs.io/en/7.5/configuration.html#the-groups-element). Something like:The testbot must then called with the parameter
--exclude-group does-not-work-for-oracle. The current DrupalCL testbot does not have that ability, but it could be added. Should not be that difficult.Comment #18
stefanos.petrakisGood evening everyone.
I had a look at this during the #drupalmountaincamp
And I have the feeling that we should not be trying to figure out the limit each core or contrib driver defines, but instead try to ensure that conservatively low values work across core and contrib; but most importantly, try to cause an error by setting a very high precision value and catch that case too.
Here is a patch that does just that:
Comment #20
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.