summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-01-29 22:41:53 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-01-29 22:41:53 +0000
commitac4b2a8d18c026bb5fa3efd82b59cba6ed89bd75 (patch)
tree4eeb96d38a64f425c72b82a112ef742588b745e2
parentd0fd16baa30e972e32fde6561ff9c4bd0bd2bd3d (diff)
downloadsqlalchemy-ac4b2a8d18c026bb5fa3efd82b59cba6ed89bd75.tar.gz
fixes to quoting on "fake" column when used off its table
-rw-r--r--CHANGES10
-rw-r--r--lib/sqlalchemy/ansisql.py2
-rw-r--r--test/sql/quote.py4
3 files changed, 11 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index cc0c1b906..44604120e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
0.3.5
+- sql:
+ - the value of "case_sensitive" defaults to True now, regardless of the casing
+ of the identifier, unless specifically set to False. this is because the
+ object might be label'ed as something else which does contain mixed case, and
+ propigating "case_sensitive=False" breaks that. Other fixes to quoting
+ when using labels and "fake" column objects
- orm:
- further rework of the recent polymorphic relationship refactorings, as well
as the mechanics of relationships overall. Allows more accurate ORM behavior
@@ -9,10 +15,6 @@
the relationship.
- eager loading is slightly more strict about detecting "self-referential"
relationships, specifically between polymorphic mappers.
- - the value of "case_sensitive" defaults to True now, regardless of the casing
- of the identifier, unless specifically set to False. this is because the
- object might be label'ed as something else which does contain mixed case, and
- propigating "case_sensitive=False" breaks that.
- oracle:
- when returning "rowid" as the ORDER BY column or in use with ROW_NUMBER OVER,
oracle dialect checks the selectable its being applied to and will switch to
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py
index 803cba6d3..40ea5b00a 100644
--- a/lib/sqlalchemy/ansisql.py
+++ b/lib/sqlalchemy/ansisql.py
@@ -942,7 +942,7 @@ class ANSIIdentifierPreparer(object):
else:
# literal textual elements get stuck into ColumnClause alot, which shouldnt get quoted
if use_table:
- return column.table.name + "." + column.name
+ return self.format_table(column.table, use_schema=False) + "." + column.name
else:
return column.name
diff --git a/test/sql/quote.py b/test/sql/quote.py
index 8ae228031..607a595d3 100644
--- a/test/sql/quote.py
+++ b/test/sql/quote.py
@@ -96,6 +96,10 @@ class QuoteTest(PersistTest):
Column("col1", Integer))
x = select([table.c.col1.label("ImATable_col1")]).alias("SomeAlias")
assert str(select([x.c.ImATable_col1])) == '''SELECT "SomeAlias"."ImATable_col1" \nFROM (SELECT "ImATable".col1 AS "ImATable_col1" \nFROM "ImATable") AS "SomeAlias"'''
+
+ x = select([sql.column("'foo'").label("somelabel")], from_obj=[table]).alias("AnAlias")
+ x = x.select()
+ assert str(x) == '''SELECT "AnAlias".somelabel \nFROM (SELECT 'foo' AS somelabel \nFROM "ImATable") AS "AnAlias"'''
def testlabelsnocase(self):
metadata = MetaData()