Skip to content

Commit 67b3526

Browse files
committed
fix the issue michiya#66
1 parent 042b6a5 commit 67b3526

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sql_server/pyodbc/compiler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
8787

8888
result.append(', '.join(out_cols))
8989

90-
result.append('FROM')
91-
result.extend(from_)
92-
params.extend(f_params)
93-
9490
if self.query.select_for_update and self.connection.features.has_select_for_update:
9591
if self.connection.get_autocommit():
9692
raise TransactionManagementError(
@@ -103,7 +99,11 @@ def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
10399
nowait = self.query.select_for_update_nowait
104100
if nowait and not self.connection.features.has_select_for_update_nowait:
105101
raise DatabaseError('NOWAIT is not supported on this database backend.')
106-
result.append(self.connection.ops.for_update_sql(nowait=nowait))
102+
from_.insert(1, self.connection.ops.for_update_sql(nowait=nowait))
103+
104+
result.append('FROM')
105+
result.extend(from_)
106+
params.extend(f_params)
107107

108108
if where:
109109
result.append('WHERE %s' % where)

0 commit comments

Comments
 (0)