]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Filter on user tables only 8716/head
authorMike Barry <michael.barry@gmo.com>
Wed, 26 Oct 2022 12:02:33 +0000 (08:02 -0400)
committerMike Barry <michael.barry@gmo.com>
Wed, 26 Oct 2022 12:02:33 +0000 (08:02 -0400)
lib/sqlalchemy/dialects/mssql/base.py

index bf2cd9237ed879696fb49d9af532972f6fd59e88..2ba3f155bd333e1005f29403e33738dd98e1ee26 100644 (file)
@@ -3228,7 +3228,7 @@ class MSDialect(default.DefaultDialect):
             # SQL Error [4103] [S0001]: "#v": Temporary views are not allowed
             if bool(
                 connection.scalar(
-                    text("SELECT object_id(:table_name)"),
+                    text("SELECT object_id(:table_name, 'U')"), # U filters on user tables only.
                     {"table_name": "tempdb.dbo.[{}]".format(tablename)},
                 )
             ):