From: Mike Bayer Date: Mon, 12 Apr 2010 15:30:01 +0000 (-0400) Subject: much more descriptive message for bind param name conflict, [ticket:1766] X-Git-Tag: rel_0_6_0~23^2^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2063314232941834a1cde187e5b54fd9e898fb4d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git much more descriptive message for bind param name conflict, [ticket:1766] --- diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 78c65771b7..7a1821a70d 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -548,9 +548,12 @@ class SQLCompiler(engine.Compiled): ) elif getattr(existing, '_is_crud', False): raise exc.CompileError( - "Bind parameter name '%s' is reserved " - "for the VALUES or SET clause of this insert/update statement." - % bindparam.key + "bindparam() name '%s' is reserved " + "for automatic usage in the VALUES or SET clause of this " + "insert/update statement. Please use a " + "name other than column name when using bindparam() " + "with insert() or update() (for example, 'b_%s')." + % (bindparam.key, bindparam.key) ) self.binds[bindparam.key] = self.binds[name] = bindparam @@ -906,9 +909,12 @@ class SQLCompiler(engine.Compiled): bindparam._is_crud = True if col.key in self.binds: raise exc.CompileError( - "Bind parameter name '%s' is reserved " - "for the VALUES or SET clause of this insert/update statement." - % col.key + "bindparam() name '%s' is reserved " + "for automatic usage in the VALUES or SET clause of this " + "insert/update statement. Please use a " + "name other than column name when using bindparam() " + "with insert() or update() (for example, 'b_%s')." + % (col.key, col.key) ) self.binds[col.key] = bindparam