You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hum sorry, the code is ok under Python3, but not under Python2
thanks for the report
just a not for SQLAlchemy, if you xant to determine the database dialect (1 or 3) better to use, :
con.database_info(fdb.isc_info_db_sql_dialect,'i'))
the actual code in SQLA only try to get the serveur version, not the database dialect it seems
Python 3.2.1 (default, Jul 11 2011, 18:54:42)
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fdb
>>> con = fdb.connect(dsn='localhost:employee',user='sysdba', password='masterke')
>>> print(con.database_info(fdb.isc_info_db_sql_dialect,'i'))
3
>>> print(con.db_info([fdb.isc_info_implementation]))
{11: (66, 1)}
>>> print(con.db_info([fdb.isc_info_db_sql_dialect,fdb.isc_info_firebird_version]))
{62: 3, 103: 'LI-V2.5.2.26389 Firebird 2.5'}
Submitted by: Treeve Jelbert (treeve)
Assigned to: @pmakowski
isc_info_firebird_version fails with TypeError: 'an integer is required'
I tried using the python debugger and got the following data
$ ./test
>
/usr/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/fdb.py(155)_get_server_version_in$
-> fbconn = connection.connection
(Pdb) c
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(780)database_info()
-> if ord2(res_buf[i]) != isc_info_end:
(Pdb) p res_buf
'g\x80\x00\x03\x1cLI-V2.5.2.26455 Firebird 2.50LI-V2.5.2.26455 Firebird 2.5/tcp
(Gemini-64)/P120LI-V2.5.2.26455 Firebird 2.5/tcp
(Gemini-64)/P12\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$
(Pdb) p i
131
(Pdb) s
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(783)database_info()
-> if request_buffer[0] != res_buf[0]:
(Pdb) p request_buffer[0]
'g'
(Pdb) s
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(785)database_info()
-> if result_type.upper() == 'I':
(Pdb) s
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(787)database_info()
-> elif (result_type.upper() == 'S'
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(788)database_info()
-> and info_code not in _DATABASE_INFO__KNOWN_LOW_LEVEL_EXCEPTIONS):
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(792)database_info()
-> return ctypes.string_at(res_buf[3:], i - 3)
(Pdb)
--Call--
> /usr/lib/python2.7/ctypes/__init__.py(495)string_at()
-> def string_at(ptr, size=-1):
(Pdb)
> /usr/lib/python2.7/ctypes/__init__.py(499)string_at()
-> return _string_at(ptr, size)
(Pdb)
--Return--
> /usr/lib/python2.7/ctypes/__init__.py(499)string_at()->'\x03\x1cLI-V...emini-64)/P12'
-> return _string_at(ptr, size)
(Pdb)
--Return-->
/usr/lib/python2.7/site-packages/fdb/fbcore.py(792)database_info()->'\x03\x1cLI-V...emini-64)/P$
-> return ctypes.string_at(res_buf[3:], i - 3)
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(892)db_info()
-> pos = 1
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(894)db_info()
-> versionStringLen = (struct.unpack('B',
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(895)db_info()
(Pdb)
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(895)db_info()
-> int2byte(buf[pos]))[0])
(Pdb) unt
--Return--
> /usr/lib/python2.7/site-packages/fdb/fbcore.py(895)db_info()->None
-> int2byte(buf[pos]))[0])
(Pdb)
TypeError: 'an integer is required'
Commits: 9bf1220
The text was updated successfully, but these errors were encountered: