Activerecord-jdbc-adapter DB2 testing

Hey Folks,

Ok, so I’ve finally gotten around to creating a github fork[1] of
activerecord-jdbc-adapter so I can start working on properly adding in
the DB2 enhancements I’ve been using locally.

I even managed to compile and make a proper gem :slight_smile: However, I’m now
trying to make sure the existing DB2 test cases pass before I go
monkeying around. I created a local database and modified test/db/db2.rb
to use it. Seems to connect fine. However, jruby -S rake test_db2
produces mostly errors:

35 tests, 4 assertions, 1 failures, 64 errors

I’ve managed to get this down to just a few errors by more forcefully
stripping simple_integer’s limit off, see [2] (not totally sure why this
works actually).

35 tests, 53 assertions, 4 failures, 1 errors

Just want to be sure a) I’m running the right rake task, and b) I don’t
have something grossly mis-configured before assuming this is the
current state of the DB2 adapter test cases :slight_smile:

I’m using the tip of nicksieger’s master git tree, DB2 9.7 and
active-record 2.3.8 (for now) on Linux.

Thanks!
- nick

[1] GitHub - kreucher/activerecord-jdbc-adapter: DB2 updates to nicksieger's activerecord-jdbc-adapter
[2] 483759’s gists · GitHub


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Nick,

Looks like you’re definitely on the right track. I committed your
change with a small modification. Let me know if you can get the tests
closer to green, I’d be happy to commit any further patches.

/Nick

On Tue, Jul 20, 2010 at 6:23 PM, Nicholas J Kreucher [email protected]
wrote:

produces mostly errors:
have something grossly mis-configured before assuming this is the


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Nick,

Ok, here is the latest status:

DB2 on LUW (Linux/UNIX/Windows, tested on Linux):
35 tests, 55 assertions, 0 failures, 1 errors

  • I’m stuck on test_find_with_string_slug… not really sure how to
    handle the wacky to_param there.

DB2 on i5/OS (aka AS400 aka iSeries aka IBM i):
35 tests, 55 assertions, 1 failures, 2 errors

  • Binary strings seem to be stored in EBCDIC, causing wacky conversions
    when read back… sigh.
  • Some table manipulation problems

Many changes checked into my tree [1]… the AS400 testing was far worse
off, so many of the changes are to bring that more in line with LUW. If
anyone else can test my changes, I’d sure appreciate it!

FYI I am also working on improving the DB2 schema dumper functionality.

Thanks,

  • nick

[1] GitHub - kreucher/activerecord-jdbc-adapter: DB2 updates to nicksieger's activerecord-jdbc-adapter

On Wed, 2010-07-21 at 12:55 -0500, Nick S. wrote:

35 tests, 4 assertions, 1 failures, 64 errors

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Cool, sounds great. Let me know if you think you’re ready for a merge
and I can push the changes back into master.

/Nick

On Sat, Jul 31, 2010 at 3:52 AM, Nicholas J Kreucher [email protected]
wrote:

anyone else can test my changes, I’d sure appreciate it!
On Wed, 2010-07-21 at 12:55 -0500, Nick S. wrote:

35 tests, 4 assertions, 1 failures, 64 errors

To unsubscribe from this list, please visit:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks Nick! Pushed them to master!

/Nick

On Wed, Aug 4, 2010 at 11:09 PM, Nicholas J Kreucher [email protected]
wrote:

$ git diff --numstat nicksieger/master
grabbing tables and columns.
name. DB2 will return a nil set otherwise :frowning:

  • Binary strings seem to be stored in EBCDIC, causing wacky conversions
    Thanks,

change with a small modification. Let me know if you can get the tests

works actually).
Thanks!

http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hey Nick,

Ok, ready!

Still have a problem with test_find_with_string_slug, but everything
else is so much vastly improved I think we should merge now; especially
since you are in beta releases for the big 1.0.0. Hopefully someone who
is using DB2 will grab the beta to further validate things.

$ git diff --numstat nicksieger/master
3 8 README.txt
226 51 lib/arjdbc/db2/adapter.rb
1 1 lib/arjdbc/discover.rb
3 1 src/java/arjdbc/jdbc/RubyJdbcConnection.java
34 1 test/db2_simple_test.rb

As you can see, most of the changes are in db2/adapter.rb. Lots of
fixes, enhancements and support for DB2 on IBM i (AS400). Many old
workarounds and hacks have been removed in favor of doing things
“properly”. In many cases, this simply means using the schema when
grabbing tables and columns.

I also updated README.txt to reflect the new state of the DB2 driver,
discover.db to catch more DB2 drivers (eg: as400), and
db2_simple_test.rb with an additional test case regarding booleans. I
have a blog post about how booleans are properly handled in db2.rb now:
http://nick.kreucher.net/blog/2010/arjdbcdb2-booleans-arjdbc/

The RubyJdbcConnection.java file contains a small change to
columns_internal that should not effect other drivers. Tests for DB2 and
then doesn’t override catalog to be the same as the passed in schema
name. DB2 will return a nil set otherwise :frowning:

Resolves:
ACTIVERECORD_JDBC-79
ACTIVERECORD_JDBC-119
ACTIVERECORD_JDBC-122
ACTIVERECORD_JDBC-114
ACTIVERECORD_JDBC-123

Thanks!
- nick

On Mon, 2010-08-02 at 12:47 -0500, Nick S. wrote:

DB2 on LUW (Linux/UNIX/Windows, tested on Linux):
when read back… sigh.

  • nick

closer to green, I’d be happy to commit any further patches.

I even managed to compile and make a proper gem :slight_smile: However, I’m now

  • nick

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email