Tag: oo_pqsdbc_01
User: jbu     
Date: 06/01/22 07:17:36

Modified:
 /dba/connectivity/workben/postgresql/
  ddl.py, preparedstatement.py

Log:
 changes towards 0.7.0, fixed some bugs, that led to crashes in OOo2.0, now 
insertion support for no oid tables

File Changes:

Directory: /dba/connectivity/workben/postgresql/
================================================

File [changed]: ddl.py
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/workben/postgresql/ddl.py?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +12 -2
--------------------
--- ddl.py      9 May 2004 20:04:59 -0000       1.1.2.2
+++ ddl.py      22 Jan 2006 15:17:33 -0000      1.1.2.3
@@ -2,9 +2,9 @@
 #

 #   $RCSfile: ddl.py,v $

 #

-#   $Revision: 1.1.2.2 $

+#   $Revision: 1.1.2.3 $

 #

-#   last change: $Author: jbu $ $Date: 2004/05/09 20:04:59 $

+#   last change: $Author: jbu $ $Date: 2006/01/22 15:17:33 $

 #

 #   The Contents of this file are made available subject to the terms of

 #   either of the following licenses

@@ -105,6 +105,8 @@
     executeIgnoringException( stmt, "DROP TABLE customer" )

     executeIgnoringException( stmt, "DROP TABLE blub" )

     executeIgnoringException( stmt, "DROP TABLE foo" )

+    executeIgnoringException( stmt, "DROP TABLE nooid" )

+    executeIgnoringException( stmt, "DROP TABLE nooid2" )

     cleanGroupsAndUsers( stmt )

     

     ddls = (

@@ -138,6 +140,14 @@
               "productid char(8) REFERENCES product(id),"+

               "amount integer,"+

               "PRIMARY KEY (orderid,id))",

+        "CREATE TABLE nooid ("+

+             "id char(8) UNIQUE PRIMARY KEY,"+

+             "name text) "+

+             "WITHOUT OIDS",

+        "CREATE TABLE nooid2 ("+

+             "id serial UNIQUE PRIMARY KEY,"+

+             "name text) "+

+             "WITHOUT OIDS",

         "CREATE VIEW customer2 AS SELECT id,name FROM customer",

         "GRANT SELECT ON TABLE customer,product,orderpos,ordertab TO 
pqsdbc_customer", 

         "GRANT SELECT ON TABLE product TO GROUP pqsdbc_employees", 


File [changed]: preparedstatement.py
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/workben/postgresql/preparedstatement.py?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +22 -2
--------------------
--- preparedstatement.py        11 Jul 2004 10:06:31 -0000      1.1.2.5
+++ preparedstatement.py        22 Jan 2006 15:17:33 -0000      1.1.2.6
@@ -2,9 +2,9 @@
 #
 #   $RCSfile: preparedstatement.py,v $
 #
-#   $Revision: 1.1.2.5 $
+#   $Revision: 1.1.2.6 $
 #
-#   last change: $Author: jbu $ $Date: 2004/07/11 10:06:31 $
+#   last change: $Author: jbu $ $Date: 2006/01/22 15:17:33 $
 #
 #   The Contents of this file are made available subject to the terms of
 #   either of the following licenses
@@ -148,6 +148,26 @@
           rs = prepstmt.getGeneratedValues()
           self.failUnless( rs.next() )
           self.failUnless( rs.getInt( 3 ) == 3 )
+
+          prepstmt = self.connection.prepareStatement(
+              "INSERT INTO public.nooid (id,name) VALUES( ?, ? )" )
+          prepstmt.setString( 1, "C3" )
+          prepstmt.setString( 2, "Norah Jones" )
+          prepstmt.executeUpdate()
+          rs = prepstmt.getGeneratedValues()
+          self.failUnless( rs.next() )
+          self.failUnless( rs.getString(1).rstrip() == "C3" )
+
+          prepstmt = self.connection.prepareStatement(
+              "INSERT INTO public.nooid2 (name) VALUES( ? )" )
+          prepstmt.setString( 1, "Norah Jones" )
+          prepstmt.executeUpdate()
+          rs = prepstmt.getGeneratedValues()
+          self.failUnless( rs )
+          self.failUnless( rs.next() )
+          self.failUnless( rs.getString(2) == "Norah Jones" )
+          self.failUnless( rs.getString(1) == "1" )
+
 
       def testUpdateableResultSet( self ):
           stmt = self.connection.createStatement()




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to