Thread: patch: ensure testdbencoding test table is dropped

patch: ensure testdbencoding test table is dropped

From
Oliver Jowett
Date:
Minor patch to make sure the testdbencoding test table is dropped
(otherwise it interferes with the table metadata test in subsequent runs).

-O
Index: org/postgresql/test/jdbc2/DatabaseEncodingTest.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/DatabaseEncodingTest.java,v
retrieving revision 1.1
diff -u -c -r1.1 DatabaseEncodingTest.java
*** org/postgresql/test/jdbc2/DatabaseEncodingTest.java    17 Jul 2004 07:39:43 -0000    1.1
--- org/postgresql/test/jdbc2/DatabaseEncodingTest.java    20 Jul 2004 05:30:47 -0000
***************
*** 26,36 ****
--- 26,38 ----
          TestUtil.createTable(con,
                               "testdbencoding",
                               "unicode_ordinal integer primary key not null, unicode_string varchar(" + STEP + ")");
+         con.setAutoCommit(false);
      }

      // Tear down the fixture for this test case.
      protected void tearDown() throws Exception
      {
+         con.setAutoCommit(true);
          TestUtil.dropTable(con, "testdbencoding");
          TestUtil.closeDB(con);
      }
***************
*** 60,67 ****

          rs.close();

-         con.setAutoCommit(false); // Go faster!
-
          // Create data.
          // NB: we only test up to d800 as code points above that are
          // reserved for surrogates in UTF-16
--- 62,67 ----

Re: patch: ensure testdbencoding test table is dropped

From
Kris Jurka
Date:

On Tue, 20 Jul 2004, Oliver Jowett wrote:

> Minor patch to make sure the testdbencoding test table is dropped
> (otherwise it interferes with the table metadata test in subsequent runs).

The only comment on messing with autocommit at all is "Go faster".  Other
tests avoid using transactions unless needed, what kind of speed up are we
looking at here?  1 second? 10?  It might just be easier to not mess with
autocommit at all.

Kris Jurka


Re: patch: ensure testdbencoding test table is dropped

From
Oliver Jowett
Date:
Kris Jurka wrote:
>
> On Tue, 20 Jul 2004, Oliver Jowett wrote:
>
>
>>Minor patch to make sure the testdbencoding test table is dropped
>>(otherwise it interferes with the table metadata test in subsequent runs).
>
>
> The only comment on messing with autocommit at all is "Go faster".  Other
> tests avoid using transactions unless needed, what kind of speed up are we
> looking at here?  1 second? 10?  It might just be easier to not mess with
> autocommit at all.

It does ~1800 INSERTs -- that's going to take a while with autocommit
on. Turning autocommit on for that one test adds ~15 seconds to the
testsuite run on my machine against 7.4. I think 7.3 will be worse.

-O

Re: patch: ensure testdbencoding test table is dropped

From
Kris Jurka
Date:

On Tue, 20 Jul 2004, Oliver Jowett wrote:
> It does ~1800 INSERTs -- that's going to take a while with autocommit
> on. Turning autocommit on for that one test adds ~15 seconds to the
> testsuite run on my machine against 7.4. I think 7.3 will be worse.
>

Is perhaps this test being a little overzealous.  Do we really need to
test every possible code point to determine if it is working or not?
Seems that testing even every 100th code point would be sufficient.

Kris Jurka


Re: patch: ensure testdbencoding test table is dropped

From
Oliver Jowett
Date:
Kris Jurka wrote:
>
> On Tue, 20 Jul 2004, Oliver Jowett wrote:
>
>>It does ~1800 INSERTs -- that's going to take a while with autocommit
>>on. Turning autocommit on for that one test adds ~15 seconds to the
>>testsuite run on my machine against 7.4. I think 7.3 will be worse.
>>
>
>
> Is perhaps this test being a little overzealous.  Do we really need to
> test every possible code point to determine if it is working or not?
> Seems that testing even every 100th code point would be sufficient.

<shrug> Change it if you like -- I did the exhaustive test because it
seemed cheap enough. Perhaps you could just increase STEP.

Either way, the current CVS testcase still doesn't drop the table when
it's done.

-O

Re: patch: ensure testdbencoding test table is dropped

From
Kris Jurka
Date:

On Tue, 20 Jul 2004, Oliver Jowett wrote:

> Minor patch to make sure the testdbencoding test table is dropped
> (otherwise it interferes with the table metadata test in subsequent runs).

Applied.

Kris Jurka