shaa108 / h2database

Automatically exported from code.google.com/p/h2database
1 stars 0 forks source link

Treat empty strings like NULL in Oracle compatibility mode #522

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The attached patch adds support for treating empty strings like NULL values in 
Oracle compatibility mode (this was a feature on the H2 roadmap).

I spent a lot of time trying to figure out where to perform the '' -> NULL 
conversion, and decided that ValueString.get(String) was probably the best 
place. The only issue is that this static method doesn't have access to the 
database mode config, so I overloaded the method and use the new overloaded 
method wherever I feel the string value should be checked for NULL coercion.

I wrote the code, it's mine, and I'm contributing it to H2 for distribution 
multiple-licensed under the H2 License, version 1.0, and under the Eclipse 
Public License, version 1.0 (http://h2database.com/html/license.html).

Original issue reported on code.google.com by djgred...@gmail.com on 8 Nov 2013 at 11:45

GoogleCodeExporter commented 8 years ago

Original comment by djgred...@gmail.com on 9 Nov 2013 at 12:00

GoogleCodeExporter commented 8 years ago

Original comment by djgred...@gmail.com on 9 Nov 2013 at 1:16

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you very much for your patch, committed in revision 5306.

Changes:

There is a random change to org.h2.table.Column that I did not apply.

Renamed TestOracleMode -> TestCompatibilityOracle so that it lives next to the 
existing compatibility tests.

Rewrote the new oracle unit tests so they match our existing style a little 
closer.

Dropped the changes to TestAll - I don't see the need to have a command line 
parameter for running the oracle tests by themselves, this is easily 
accomplished using the main method in the unit test class.

Original comment by noelgrandin on 21 Nov 2013 at 8:48

GoogleCodeExporter commented 8 years ago
Thanks for the review and the detailed feedback -- I'm doing my best to match 
the project style and guidelines, and it's very helpful!

Take care,

Daniel

Original comment by djgred...@gmail.com on 21 Nov 2013 at 4:40