- mysql
- Temporary tables are now reflectable.
-
+- oracle
+ - Oracle will detect string-based statements which contain
+ comments at the front before a SELECT as SELECT statements.
+ [ticket:1187]
0.5.0rc1
========
from sqlalchemy import types as sqltypes
+SELECT_REGEXP = re.compile(r'(\s*/\*\+.*?\*/)?\s*SELECT', re.I | re.UNICODE)
+
class OracleNumeric(sqltypes.Numeric):
def get_col_spec(self):
if self.precision is None:
self.out_parameters[name] = self.cursor.var(dbtype)
self.parameters[0][name] = self.out_parameters[name]
+ def returns_rows_text(self, statement):
+ return SELECT_REGEXP.match(statement)
+
def create_cursor(self):
c = self._connection.connection.cursor()
if self.dialect.arraysize:
seq = Sequence("My_Seq", schema="Some_Schema")
assert dialect.identifier_preparer.format_sequence(seq) == '"Some_Schema"."My_Seq"'
+class ExecuteTest(TestBase):
+ __only_on__ = 'oracle'
+ def test_basic(self):
+ assert testing.db.execute("/*+ this is a comment */ SELECT 1 FROM DUAL").fetchall() == [(1,)]
if __name__ == '__main__':
testenv.main()