diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-04-08 12:14:56 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-04-08 12:14:56 -0400 |
| commit | 07153dc0926568b35a907241d8e954ecf0ca54f1 (patch) | |
| tree | d707c43a37c3c74faa3ea572f07f571235970c42 /test/sql/test_query.py | |
| parent | 1b83b588f5573799dee8d508be13c252c2e57115 (diff) | |
| download | sqlalchemy-07153dc0926568b35a907241d8e954ecf0ca54f1.tar.gz | |
- ensure that the keys we put into the parameters dictionary
for an insert from select are the string names, and not
the Column objects. The MSSQL dialect in particular relies upon
checking for these keys in params to know if identity insert
should be on. references #3360
Diffstat (limited to 'test/sql/test_query.py')
| -rw-r--r-- | test/sql/test_query.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 08afc3256..98f375018 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -275,13 +275,20 @@ class QueryTest(fixtures.TestBase): r = t6.insert().values(manual_id=id).execute() eq_(r.inserted_primary_key, [12, 1]) - def test_implicit_id_insert_select(self): + def test_implicit_id_insert_select_columns(self): stmt = users.insert().from_select( (users.c.user_id, users.c.user_name), users.select().where(users.c.user_id == 20)) testing.db.execute(stmt) + def test_implicit_id_insert_select_keys(self): + stmt = users.insert().from_select( + ["user_id", "user_name"], + users.select().where(users.c.user_id == 20)) + + testing.db.execute(stmt) + def test_row_iteration(self): users.insert().execute( {'user_id': 7, 'user_name': 'jack'}, |
