|
Stephan, thanks for researhing AND fixing the issue. Great job. I looked through the code changes and they look good to me. You can go ahead and submit the functional test as part of this same jira entry.
The diff in patch_2 contains the function test for territory based databases. The original dblook_test.java has been slightly modified, to be able to extend it to the added dblook_test_territory.java.
I've only tested the 'derbytools' suite (and it runs without errors), because my test environment is somehow not setup properly to run 'derbyAll', which hangs on network server tests. This doesn't seem to be due to this patch, it also happens when I test on released versions. I need to look into that some more, but I'd appreciate it if someone else can verify that 'derbyAll' works. Once I get my test environment right, I may add another function test which extends dblook_test_net.java, though for now, dblook works on our territory-based network servers (production). Stephan, I did not think through completely when I sent my feedback on the patch(
I think the correct solution is to make sure that we are in the system schema when these queries are compiled. That will ensure that the character string constants will take the collation of the system schema. This will also ensure that we do not run into collation mismatch errors. I apologize if you ended up wasting lot of time on this issue based on my earlier feedback. Hello Mamta,
Thanks for taking time to review my proposed solution. I really don't think I've wasted time, since the functional test took more time than creating the patch, but it provided some useful insights on how this stuff currently works in Derby. Besides, I'll need the test anyway when trying to resolve this issue. Now, if I understand correctly, you're basically implying that *all* operations on system tables should be done with UCS_BASIC collation, which can be enforced by changing the current connection schema to SYS. I read about the UCS_BASIC part while lurking on the dev-list, but a proposed workaround seemed to use casting. Having investigated the internals of dblook, I found that only one connection to the database is made, which is passed on to all required (static) methods, with no other instances around. This would really make the patch a lot simpler. While poking around in a few other tests, but specifcally CollationTest.java, I came up with the idea to ensure that for 'dblook_test.java' the UCS_BASIC collation type is used right after the database has been created and for 'dblook_test_territory' the 'TERRITORY_BASED' collation type is used, just to be sure. This will affect the network test as well, but that doesn't have a territory-based test yet (as I still have to correct my environment), so I don't think it causes any problems. I'll make the changes and return shortly with a report and most likely a new patch. --Stephan. Attached patch 3, as described in my earlier comment.
Instead of returning shortly, I couldn't resist and figured out why my test-environment wasn't setup properly, so I could add function tests to the suite 'derbynetmats' as well. The reason why I couldn't get it right the first time, is because the documentation at testing/README.htm refers to an incorrect download location for 'db2jcc.jar' and 'db2jcc_license_c.jar'. At that location, DB2 drivers for Linux can be downloaded, but they fail the Derby tests. It might be wise to update the readme and point to the right location, but maybe that's something for a new issue. Anyway.. now both 'derbytools' and 'derbynetmats' pass the tests... I will run 'derbyall' later this night and review the outcome in the morning. In the meantime I'd be happy to hear someone else confirming that this patch is working. Thanks, --Stephan. Marking patch as unavailable. The test functionality for 'derbyall' doesn't complete. It looks like I need to rename the output of dblook after each test to prevent successive tests from failing. Will be back with a new patch when 'derbyall' completes successfully.
Stephan, I looked at
Hello again, and my apologies for the delay, my daily job required all of my attention.
I attached a cumulative patch v4, which replaces all previous patches. All functional tests (derbyall) run without errors. Important changes are only in the tests, which now rename the output of dblook *after* completion, instead of at the start. In addition, the master test for DerbyNetClient needed a .out file. Since multiple tests may run, it was insufficient to just rename dblook.log to f.e. dblook_test_net.log. The central method renameDbLookLog() in dblook_test.java now renames to dblook_test_net0.log, dblook_test_net1.log and so on. Please note that I haven't run tests for optional suites like mobile environments, though modifications have been made to incorporate them. Regards, Stephan. Just an FYI that I will look at the patch tomorrow and if everything runs fine, I will go ahead and check it in.
Thanks, Stephan, for your work on this jira entry. Also, just wanted to mention that you might consider submitting an ICLA with ASF if you plan on contributing more to Derby. These pages on the Derby wiki has information for getting involved in the Derby project. http://wiki.apache.org/db-derby/DerbyDev http://wiki.apache.org/db-derby/DerbyContributorChecklist Committed changes submitted by Stephan using revision 634037 into trunk. I will work on backporting it to 10.3
Hi Mamta (and others),
Thanks for reviewing and committing the patch, everything works fine now, so I'll close this bug. I will be looking into submitting an ICLA with the ASF, a couple of potential features and bugs caught my interest. I'd first like to try to make myself more familiar with the Derby codebase, if and when time permits. Thanks again. -Stephan. Migrated the changes into 10.3 codeline with revision 635588.
Adding 10.3.2.2 to fix version as this fix was ported to the 10.3 branch.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I've added a functional test to the tools section which passes cleanly, but it isn't included in this patch, because I'm not sure how to proceed.
I'd be glad if someone could inform me if I should create a new issue, or a subtask, or do something else to contribute that as well.