-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODBC SQL type -150 is not yet supported #307
Comments
Thanks for the report. Will be looking into this. |
Was it all admin users that cause this error? |
Hi @Augis363, SQL type -150 is SQL_VARIANT We are currently working on support for SQL_VARIANT and will update you when it is released. Thank you |
Has there been a fix for this, yet? |
There's already a PR in |
There are some features which are not supported yet. Please check the Limitations first to see if your bug is listed.
Software versions
Table schema and Model
Django default User model
Database Connection Settings
`
// Paste your database settings from Settings.py here.
`DATABASES = {
"default": {
"ENGINE": "mssql",
"NAME" ,
"HOST": ,
"PORT": "1433",
"USER": ,
"PASSWORD": ,
"OPTIONS": {
"driver": "ODBC Driver 17 for SQL Server",
},
}
}
USE_TZ = True
TIME_ZONE = "Europe/Amsterdam"
Problem description and steps to reproduce
Just running Django server and trying to log in to admin page throws "ODBC SQL type -150 is not yet supported"
Expected behavior and actual behavior
Login successful
Error message/stack trace
[2023-10-19 08:46:43 +0000] [8] [INFO] Starting gunicorn 20.1.0
[2023-10-19 08:46:43 +0000] [8] [INFO] Listening at: http://0.0.0.0:80 (8)
[2023-10-19 08:46:43 +0000] [8] [INFO] Using worker: sync
[2023-10-19 08:46:43 +0000] [14] [INFO] Booting worker with pid: 14
[2023-10-19 08:46:43 +0000] [15] [INFO] Booting worker with pid: 15
Internal Server Error: /admin/login/
Traceback (most recent call last):
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/utils.py", line 98, in inner
return func(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/mssql/base.py", line 664, in fetchmany
return self.format_rows(self.cursor.fetchmany(chunk))
pyodbc.ProgrammingError: ('ODBC SQL type -150 is not yet supported. column-index=2 type=-150', 'HY106')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/app/.venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request)
File "/usr/app/.venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 440, in login
return LoginView.as_view(**defaults)(request)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/generic/base.py", line 84, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/decorators/debug.py", line 92, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/auth/views.py", line 67, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/generic/base.py", line 119, in dispatch
return handler(request, *args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/generic/edit.py", line 152, in post
if form.is_valid():
File "/usr/app/.venv/lib/python3.8/site-packages/django/forms/forms.py", line 205, in is_valid
return self.is_bound and not self.errors
File "/usr/app/.venv/lib/python3.8/site-packages/django/forms/forms.py", line 200, in errors
self.full_clean()
File "/usr/app/.venv/lib/python3.8/site-packages/django/forms/forms.py", line 434, in full_clean
self._clean_form()
File "/usr/app/.venv/lib/python3.8/site-packages/django/forms/forms.py", line 455, in _clean_form
cleaned_data = self.clean()
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/auth/forms.py", line 217, in clean
self.user_cache = authenticate(
File "/usr/app/.venv/lib/python3.8/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper
return func(*func_args, **func_kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/auth/init.py", line 77, in authenticate
user = backend.authenticate(request, credentials)
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/auth/backends.py", line 42, in authenticate
user = UserModel._default_manager.get_by_natural_key(username)
File "/usr/app/.venv/lib/python3.8/site-packages/django/contrib/auth/base_user.py", line 46, in get_by_natural_key
return self.get({self.model.USERNAME_FIELD: username})
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/query.py", line 492, in get
num = len(clone)
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/query.py", line 302, in len
self._fetch_all()
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/query.py", line 1507, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/query.py", line 57, in iter
results = compiler.execute_sql(
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1394, in execute_sql
return list(result)
File "/usr/app/.venv/lib/python3.8/site-packages/mssql/compiler.py", line 176, in _cursor_iter
for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
File "/usr/app/.venv/lib/python3.8/site-packages/mssql/compiler.py", line 176, in
for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/utils.py", line 98, in inner
return func(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/app/.venv/lib/python3.8/site-packages/django/db/utils.py", line 98, in inner
return func(*args, **kwargs)
File "/usr/app/.venv/lib/python3.8/site-packages/mssql/base.py", line 664, in fetchmany
return self.format_rows(self.cursor.fetchmany(chunk))
django.db.utils.ProgrammingError: ('ODBC SQL type -150 is not yet supported. column-index=2 type=-150', 'HY106')
Any other details that can be helpful
The text was updated successfully, but these errors were encountered: