- sql
- long-identifier detection fixed to use > rather than >= for
max ident length [ticket:589]
+ - fixed bug where selectable.corresponding_column(selectable.c.col)
+ would not return selectable.c.col, if the selectable is a join
+ of a table and another join involving the same table. messed
+ up ORM decision making [ticket:593]
+
- mysql
- added 'fields' to reserved words [ticket:590]
def should_quote(self, object):
return object.quote or self._requires_quotes(object.name, object.case_sensitive)
- def is_natural_case(self, object):
- return object.quote or self._requires_quotes(object.name, object.case_sensitive)
-
def format_sequence(self, sequence):
return self.__generic_obj_format(sequence, sequence.name)
return True
def _get_case_sensitive(self):
+ """late-compile the 'case-sensitive' setting when first accessed.
+
+ typically the SchemaItem will be assembled into its final structure
+ of other SchemaItems at this point, whereby it can attain this setting
+ from its containing SchemaItem if not defined locally.
+ """
+
try:
return self.__case_sensitive
except AttributeError:
the exported columns of this ``FromClause``.
"""
+ if column in self.c:
+ return column
if require_embedded and column not in util.Set(self._get_all_embedded_columns()):
if not raiseerr:
return None
table1.select((table1.c.myid != 12) & ~(table1.c.name=='john')),
"SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND NOT (mytable.name = :mytable_name)"
)
+
+ self.runtest(
+ table1.select((table1.c.myid != 12) & ~table1.c.name),
+ "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND NOT mytable.name"
+ )
self.runtest(
literal("a") + literal("b") * literal("c"), ":literal + (:literal_1 * :literal_2)"
)\r
\r
class SelectableTest(testbase.AssertMixin):\r
+ def testjoinagainstjoin(self):\r
+ j = outerjoin(table, table2, table.c.col1==table2.c.col2)\r
+ jj = select([ table.c.col1.label('bar_col1')],from_obj=[j]).alias('foo')\r
+ jjj = join(table, jj, table.c.col1==jj.c.bar_col1)\r
+ assert jjj.corresponding_column(jjj.c.table1_col1) is jjj.c.table1_col1\r
+ \r
+ \r
def testtablealias(self):\r
a = table.alias('a')\r
\r