[Django] #24872: dbshell don't read parameters correctly with sql_server.pyodbc (django-pyodbc-azure)

20 views
Skip to first unread message

Django

unread,
May 29, 2015, 4:25:40 AM5/29/15
to django-...@googlegroups.com
#24872: dbshell don't read parameters correctly with sql_server.pyodbc (django-
pyodbc-azure)
-------------------------------------+-------------------------------------
Reporter: netamego | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Management | Version: 1.8
commands) | Keywords:
Severity: Normal | dbshell,sql_server.pyodbc
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
The next connection:

{{{

'BBDDSQL': {
'NAME': 'MyDatabase',
'ENGINE': 'sql_server.pyodbc',
'HOST': 'freetds_dsn_BBDD',
'USER': 'sa',
'PASSWORD': 'MyPassword',
'PORT': '49247',
'OPTIONS': {
'driver': 'FreeTDS',
'dns':'MyDns',
'MARS_Connection': True,
},
}
}}}


works like a charm inside Django views but fails with the next command:

python manage.py dbshell --database=BBDDSQL

with error:


{{{
[IM002][unixODBC][Driver Manager]Data source name not found, and no
default driver specified
[ISQL]ERROR: Could not SQLConnect
}}}

Command:

isql -v MyDns sa MyPassword

works perfect so I have enabled

{{{
[ODBC]
Trace=Yes
TraceFile=/tmp/odbc_u.log
}}}

in odbcinst.ini file and run

{{{
python manage.py dbshell --database=BBDDSQL
}}}

What I see in /tmp/odbc_u.log trace file is:

{{{

Server Name = [sa][length = 2 (SQL_NTS)]
User Name = [MyPassword][length = 9 (SQL_NTS)]
Authentication = [NULL]

}}}

So dbshell is not reading correctly parameters from settings.py when use
sql_server.pyodbc engine.

This error is in Django 1.7 and 1.8.


Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/24872>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 29, 2015, 6:51:04 AM5/29/15
to django-...@googlegroups.com
#24872: dbshell don't read parameters correctly with sql_server.pyodbc (django-
pyodbc-azure)
-------------------------------------+-------------------------------------
Reporter: netamego | Owner: nobody
Type: Uncategorized | Status: closed

Component: Core (Management | Version: 1.8
commands) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
dbshell,sql_server.pyodbc | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0


Comment:

I believe it's an issue with the third-party driver (if it is a problem
with Django, there's not enough information for me to tell what it is). I
see you already [https://github.com/michiya/django-pyodbc-azure/issues/29
filed an issue] there. Please reopen if the investigation concludes that
it is a problem with Django.

--
Ticket URL: <https://code.djangoproject.com/ticket/24872#comment:1>

Reply all
Reply to author
Forward
0 new messages