summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-10-18 18:14:06 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-10-18 18:14:06 +0000
commita20222fc22059df30b09b49621a784b54919613a (patch)
tree99d99b2516fa81520ae1878e31e638f188ccc40f /test/sql
parent223bd3688dfd01f9dff973cbf9b3d92f39df4c21 (diff)
downloadsqlalchemy-a20222fc22059df30b09b49621a784b54919613a.tar.gz
- 0.5.0rc3, doh
- The internal notion of an "OID" or "ROWID" column has been removed. It's basically not used by any dialect, and the possibility of its usage with psycopg2's cursor.lastrowid is basically gone now that INSERT..RETURNING is available. - Removed "default_order_by()" method on all FromClause objects. - profile/compile/select test is 8 function calls over on buildbot 2.4 for some reason, will adjust after checking the results of this commit
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/labels.py11
-rw-r--r--test/sql/select.py4
-rwxr-xr-xtest/sql/selectable.py20
3 files changed, 0 insertions, 35 deletions
diff --git a/test/sql/labels.py b/test/sql/labels.py
index 3e025e5e7..a0f49f3f1 100644
--- a/test/sql/labels.py
+++ b/test/sql/labels.py
@@ -137,16 +137,5 @@ class LongLabelsTest(TestBase, AssertsCompiledSQL):
print x.execute().fetchall()
- def test_oid(self):
- """test that a primary key column compiled as the 'oid' column gets proper length truncation"""
- from sqlalchemy.databases import postgres
- dialect = postgres.PGDialect()
- dialect.max_identifier_length = 30
- tt = table1.select(use_labels=True).alias('foo')
- x = select([tt], use_labels=True, order_by=tt.oid_column).compile(dialect=dialect)
- #print x
- # assert it doesnt end with "ORDER BY foo.some_large_named_table_this_is_the_primarykey_column"
- assert str(x).endswith("""ORDER BY foo.some_large_named_table_t_2""")
-
if __name__ == '__main__':
testenv.main()
diff --git a/test/sql/select.py b/test/sql/select.py
index a1414da71..52aa151d9 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -917,9 +917,6 @@ FROM myothertable UNION SELECT thirdtable.userid, thirdtable.otherstuff FROM thi
assert u1.corresponding_column(table2.c.otherid) is u1.c.myid
- assert u1.corresponding_column(table1.oid_column) is u1.oid_column
- assert u1.corresponding_column(table2.oid_column) is u1.oid_column
-
# TODO - why is there an extra space before the LIMIT ?
self.assert_compile(
union(
@@ -979,7 +976,6 @@ SELECT thirdtable.userid FROM thirdtable)"
UNION SELECT mytable.myid FROM mytable"
)
- # test unions working with non-oid selectables
s = select([column('foo'), column('bar')])
s = union(s, s)
s = union(s, s)
diff --git a/test/sql/selectable.py b/test/sql/selectable.py
index 61d078a51..e41165b5b 100755
--- a/test/sql/selectable.py
+++ b/test/sql/selectable.py
@@ -95,10 +95,8 @@ class SelectableTest(TestBase, AssertsExecutionResults):
def test_singular_union(self):
u = union(select([table.c.col1, table.c.col2, table.c.col3]), select([table.c.col1, table.c.col2, table.c.col3]))
- assert u.oid_column is not None
u = union(select([table.c.col1, table.c.col2, table.c.col3]))
- assert u.oid_column
assert u.c.col1
assert u.c.col2
assert u.c.col3
@@ -214,24 +212,6 @@ class SelectableTest(TestBase, AssertsExecutionResults):
assert j4.corresponding_column(j2.c.aid) is j4.c.aid
assert j4.corresponding_column(a.c.id) is j4.c.id
- @testing.emits_warning('.*replaced by another column with the same key')
- def test_oid(self):
- # the oid column of a selectable currently proxies all
- # oid columns found within.
- s = table.select()
- s2 = table2.select()
- s3 = select([s, s2])
- assert s3.corresponding_column(table.oid_column) is s3.oid_column
- assert s3.corresponding_column(table2.oid_column) is s3.oid_column
- assert s3.corresponding_column(s.oid_column) is s3.oid_column
- assert s3.corresponding_column(s2.oid_column) is s3.oid_column
-
- u = s.union(s2)
- assert u.corresponding_column(table.oid_column) is u.oid_column
- assert u.corresponding_column(table2.oid_column) is u.oid_column
- assert u.corresponding_column(s.oid_column) is u.oid_column
- assert u.corresponding_column(s2.oid_column) is u.oid_column
-
def test_two_metadata_join_raises(self):
m = MetaData()
m2 = MetaData()