[pypy-svn] r69360 - in pypy/trunk/pypy/module/oracle: . test

afa at codespeak.net afa at codespeak.net
Wed Nov 18 00:27:05 CET 2009


Author: afa
Date: Wed Nov 18 00:27:04 2009
New Revision: 69360

Added:
   pypy/trunk/pypy/module/oracle/test/test_stringvar.py   (contents, props changed)
Modified:
   pypy/trunk/pypy/module/oracle/interp_variable.py
   pypy/trunk/pypy/module/oracle/test/test_numbervar.py
Log:
Implement the rowid data type


Modified: pypy/trunk/pypy/module/oracle/interp_variable.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/interp_variable.py	(original)
+++ pypy/trunk/pypy/module/oracle/interp_variable.py	Wed Nov 18 00:27:04 2009
@@ -424,8 +424,10 @@
 class VT_FixedNationalChar(W_Variable):
     pass
 
-class VT_Rowid(W_Variable):
-    pass
+class VT_Rowid(VT_String):
+    oracleType = roci.SQLT_CHR
+    size = 18
+    isVariableLength = False
 
 class VT_Binary(W_Variable):
     pass

Modified: pypy/trunk/pypy/module/oracle/test/test_numbervar.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/test/test_numbervar.py	(original)
+++ pypy/trunk/pypy/module/oracle/test/test_numbervar.py	Wed Nov 18 00:27:04 2009
@@ -1,6 +1,6 @@
 from pypy.module.oracle.test.test_connect import OracleTestBase
 
-class AppTestSelect(OracleTestBase):
+class AppTestNumberVar(OracleTestBase):
 
     def test_float(self):
         cur = self.cnx.cursor()

Added: pypy/trunk/pypy/module/oracle/test/test_stringvar.py
==============================================================================
--- (empty file)
+++ pypy/trunk/pypy/module/oracle/test/test_stringvar.py	Wed Nov 18 00:27:04 2009
@@ -0,0 +1,14 @@
+from pypy.module.oracle.test.test_connect import OracleTestBase
+
+class AppTestStringVar(OracleTestBase):
+
+    def test_rowid(self):
+        cur = self.cnx.cursor()
+        var = cur.var(oracle.NUMBER)
+        cur.execute("select rowid from dual")
+        rowid, = cur.fetchone()
+        cur.execute("select * from dual where rowid = :r",
+                    r=rowid)
+        cur.fetchall()
+        assert cur.rowcount == 1
+



More information about the Pypy-commit mailing list