Skip to content

Commit

Permalink
proper limits
Browse files Browse the repository at this point in the history
  • Loading branch information
m32 committed Aug 30, 2024
1 parent 9c3690b commit c5bc8fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlalchemy_pytds/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ def do_execute(self, cursor, statement, parameters, context=None):
v = parameters.get(name, None)
#print('cvt', name, v)
if isinstance(v, str):
assert len(v) < 8000
assert len(v) <= 4000
parameters[name] = tds_base.Param(name=name, type=tds_types.NVarCharType(size=len(v)), value=v, flags=0)
elif isinstance(v, bytes):
assert len(v) < 8000
assert len(v) <= 8000
parameters[name] = tds_base.Param(name=name, type=tds_types.VarBinaryType(size=len(v)), value=v, flags=0)
#print('parm:', parameters)
cursor.execute(statement, parameters)
Expand Down

0 comments on commit c5bc8fc

Please sign in to comment.