-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add support for two additional datatypes (DB2) #158
Conversation
Add support for zoned decimal (NUMERIC) and single-precision floating point data types.
Thanks for submitting this (and 👍 for attaching the manual pages). I have a question and a request. First the question: I'm not really clear on it yet, you mentioned the iSeries and zSeries being marginally different - are they incompatibly different? (ie could this change somehow adversely affect the zSeries implementation?) And for the request: would you be able to extend the appropriate |
Re: Question. Re: Request. Second, my DB2 instance seems to have some trouble with INSERTs and DELETEs via DbFit. This is not a big problem for me, since I'm using DbFit only as a verification tool (SELECTs only). With INSERT I have trouble with getAllColumns( ), and with DELETEs the exception says my table is not eligible for the operation. I don't need to INSERT or DELETE for my own purposes, but I'll look into this some more in an effort to get all the tests running. Interestingly, I can INSERT and DELETE from my terminal emulator, but not from DbFit. Finally, while our midrange has files containing single precision floating point and zoned decimal fields, I have not yet figured out how to use Create Table to create them. My floating point values always end up double precision, and my decimal values never end up zoned when I use Create Table. I can create these files using DDS on the iSeries, but have not yet been able to create them using Create Table and execute(). I'll take a closer look at java-to-DB2 data type equivalencies, and see if I can find a way to create a table (via DbFit) that will contain the single precision floating point and zoned decimal data types. I will also see about setting up a DB2 instance on a Windows or Linux box, and testing there. I will keep you posted on my progress, and let you know when I have something for you to look at (hopefully by the beginning of next week). DbFit has come in quite handy for me, and I'm grateful for the effort you and others have expended to make it as good as it is. I'm available almost any time if you need things tested on IBM's DB2 for iSeries. And thanks very much for the prompt reply! |
Ok, no worries, if it's so much hassle, don't worry about it, I'm pretty sure this wont break anything. I'll merge it... |
Add support for two additional datatypes (DB2)
you can fetch an edge build that contains your pull request here. |
I appreciate your diplomacy and applaud your judgement in merging, and I am grateful. I concur that the worst thing that could happen is somebody who would otherwise get a "data type NUMERIC not supported" exception, could conceivably get a different exception message. Even this seems very, very unlikely. However, I must admit, it does bug me more than a little bit to request a change, but be unable to make corresponding changes to acceptance tests. Fortunately, I've got my puzzle about half figured out already, I think. For example, I found I can easily create the appropriate fields (i.e. "NUMERIC") on my DB2 instance (iSeries), but I'm not sure every DB2 instance will support
The zSeries, for example, probably doesn't. This isn't any great surprise, since (for example) my DB2 instance doesn't yet support the recently added DECFLOAT. I'd be curious to hear your feelings about a thorough Acceptance Test Suite that needs slightly tailored to each installation (i.e. I have to remove DECFLOAT to pass on my instance), vs. a less aggressive Suite that passes "out of the box" for most or all instances. Personally, I certainly don't mind tailoring the acceptance tests to my shop, but everybody might not feel that way. I don't think my pull request will break any fixture functionality for anyone, but I'm wary about "breaking" acceptance tests. I've developed the confidence to say that I could write them, but I'll need to defer to you with respect to whether they should be introduced or not. Sometime very soon (next week or so) I'll either send you some updated DataType tests or a good, concrete explanation regarding why I think the tests can't or shouldn't be changed. Perhaps both. Thanks again for doing what I believe amounts to making DbFit work "out of the box" for iSeries developers, and for writing this in the first place. DbFit has made an incredibly powerful and positive impact on my unit testing of COBOL code on the iSeries. You have a great product here; great work by you and all other contributors to the project |
@mikepatrick, I would definitely welcome a pull request with changes that restructure the tests into a "core" part and a implementation-specific part. That seems like the most sensible solution. If that's not possible for whatever reason, some kind of write-up (added to the root page of the DB2 tests) that gives some context to the situation would be the next best thing, just to warn the next contributor. Thank you for your contribution! |
Jake, I promised I would get back to you regarding my recent pull request that I have worked through my remaining iSeries issues with the DbFit acceptance With respect to my last pull request, I have a few ideas:
I'd be happy to issue a pull request for the first bullet point any time. It turns out, many of my problems with the acceptance tests are related to I've attached a Word document containing the changes I made, which are in Thanks, On Thu, Aug 8, 2013 at 7:24 AM, Jake Benilov notifications@github.comwrote:
Mike Patrick |
Hi Mike, First of all, thanks for putting in the time and effort to investigate this question and then code it up. It's very much appreciated! The changes to
What do you think? |
I like this idea quite a bit, and my own thoughts were drifting in this direction as well. I'll start looking into the details right away. I'll send you my implementation for review before issuing a pull request. And it's my pleasure to investigate and contribute to the project. All of your work (and that of others who have contributed) is very much appreciated my me and my shop! |
Jake, I have a pull request ready for a DB2iEnvironment adapter. The code is in
So I have incorporated some minor changes to some existing DB2 acceptance Other than that, it's your standard fare; pretty much just a couple of My version doesn't include the ClassIndex -> Reflections switch-over, Please feel free to take a peek at the fork and offer any If everything looks good to you, I'd love to issue a pull request. I do have documentation (DB2 specific stuff) in fitnesse-style markup in Thanks, On Thu, Aug 15, 2013 at 3:37 AM, Jake Benilov notifications@github.comwrote:
Mike Patrick |
Mike, |
Add support for zoned decimal (NUMERIC) and single-precision floating point (REAL) data types (DB2Environment).
I develop primarily on an IBM iSeries. DB2 implementations vary a bit; there are even subtle differences between IBM's iSeries (midrange) implementation and their zSeries (mainframe) implementation.
Attached are diagrams from two of IBM's DB2 manuals, displaying the various data types supported by each DB2 implementation. The first diagram shows the mainframe implementation, the second shows the midrange implementation.