Skip to content

Commit 692e35b

Browse files
committed
we don't support order by in union, fix #16 #15 #14
1 parent 30e33e2 commit 692e35b

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

sqlalchemy_monetdb/requirements.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,39 @@ def bound_limit_offset(self):
104104
open by default, but closed since raises:
105105
106106
sqlalchemy.exc.CompileError: This SELECT structure does not use a simple integer value for offset
107+
"""
108+
return exclusions.closed()
109+
110+
@property
111+
def parens_in_union_contained_select_w_limit_offset(self):
112+
"""Target database must support parenthesized SELECT in UNION
113+
when LIMIT/OFFSET is specifically present.
114+
115+
E.g. (SELECT ...) UNION (SELECT ..)
116+
117+
This is known to fail on SQLite.
118+
119+
This is also unsupported by MonetDB
120+
121+
https://www.monetdb.org/bugzilla/show_bug.cgi?id=6434
122+
123+
"""
124+
return exclusions.closed()
125+
126+
@property
127+
def parens_in_union_contained_select_wo_limit_offset(self):
128+
"""Target database must support parenthesized SELECT in UNION
129+
when OFFSET/LIMIT is specifically not present.
130+
131+
E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..)
132+
133+
This is known to fail on SQLite. It also fails on Oracle
134+
because without LIMIT/OFFSET, there is currently no step that
135+
creates an additional subquery.
136+
137+
This is also unsupported by MonetDB
138+
139+
https://www.monetdb.org/bugzilla/show_bug.cgi?id=6434
140+
107141
"""
108142
return exclusions.closed()

test/test_suite.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sqlalchemy as sa
22
from sqlalchemy.testing.suite import *
33
from sqlalchemy.testing.suite import ComponentReflectionTest as _ComponentReflectionTest
4+
from sqlalchemy.testing.suite import CompoundSelectTest as _CompoundSelectTest
45
from sqlalchemy import inspect
56
from sqlalchemy.testing import eq_
67
from sqlalchemy import testing
@@ -125,4 +126,18 @@ def define_reflected_tables(cls, metadata, schema):
125126
if testing.requires.view_column_reflection.enabled:
126127
cls.define_views(metadata, schema)
127128
if not schema and testing.requires.temp_table_reflection.enabled:
128-
cls.define_temp_tables(metadata)
129+
cls.define_temp_tables(metadata)
130+
131+
132+
class CompoundSelectTest(_CompoundSelectTest):
133+
"""
134+
Disable tests here since we don't support order by within unions
135+
136+
https://www.monetdb.org/bugzilla/show_bug.cgi?id=6434
137+
"""
138+
139+
def test_distinct_selectable_in_unions(self):
140+
pass
141+
142+
def test_limit_offset_aliased_selectable_in_unions(self):
143+
pass

0 commit comments

Comments
 (0)