Skip to content

Commit 72400a2

Browse files
committed
Fix mangled DbInfoCode items
1 parent 23a7291 commit 72400a2

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88

99
### Fixed
1010

11+
- Mangled output for `DbInfoCode` itsens `CRYPT_PLUGIN`, `WIRE_CRYPT`, `DB_GUID` and `DB_FILE_ID`
1112
- #34 - Pre-1970 dates causes OverflowError
1213
- #38 - 'datetime.date' object has no attribute 'date'
1314

docs/changelog.txt

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
#########
44

5+
Version 1.10.2
6+
==============
7+
8+
* Fix: mangled output for `.DbInfoCode` itsens `CRYPT_PLUGIN`, `WIRE_CRYPT`, `DB_GUID` and `DB_FILE_ID`
9+
* Fix: #34 - Pre-1970 dates causes OverflowError
10+
* Fix: #38 - 'datetime.date' object has no attribute 'date'
11+
512
Version 1.10.1
613
==============
714

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
sphinx-bootstrap-theme>=0.8.1
22
sphinx-autodoc-typehints>=1.24.0
3-
sphinx>=5.3
3+
sphinx==7.2.6
44
.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ python = ["3.8", "3.9", "3.10", "3.11"]
8282
detached = false
8383
platforms = ["linux"]
8484
dependencies = [
85-
"Sphinx>=7.1",
85+
"Sphinx==7.2.6",
8686
"sphinx-bootstrap-theme>=0.8.1",
8787
"sphinx-autodoc-typehints>=1.24.0",
8888
"doc2dash>=3.0.0"

src/firebird/driver/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
Server, Statement)
6262

6363
#: Current driver version, SEMVER string.
64-
__VERSION__ = '1.10.1'
64+
__VERSION__ = '1.10.2'

src/firebird/driver/core.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ def __init__(self, connection: Connection):
11541154
DbInfoCode.DB_PROVIDER: self.response.read_sized_int,
11551155
DbInfoCode.PAGES_USED: self.response.read_sized_int,
11561156
DbInfoCode.PAGES_FREE: self.response.read_sized_int,
1157-
DbInfoCode.CRYPT_KEY: self._info_string,
1157+
DbInfoCode.CRYPT_KEY: self._single_info_string,
11581158
DbInfoCode.CRYPT_STATE: self.__crypt_state,
11591159
DbInfoCode.CONN_FLAGS: self.__con_state,
11601160
DbInfoCode.BACKOUT_COUNT: self.__tbl_perf_count,
@@ -1198,6 +1198,9 @@ def _info_string(self) -> str:
11981198
self.response.read_byte() # Cluster length
11991199
self.response.read_short() # number of strings
12001200
return self.response.read_pascal_string()
1201+
def _single_info_string(self) -> str:
1202+
self.response.read_byte() # Cluster length
1203+
return self.response.read_pascal_string()
12011204
def __user_names(self) -> Dict[str, str]:
12021205
self.response.rewind() # necessary to process names separated by info tag
12031206
usernames = []
@@ -1559,14 +1562,14 @@ def __init__(self, connection: Connection):
15591562
DbInfoCode.STMT_TIMEOUT_DB: self.response.read_sized_int,
15601563
DbInfoCode.STMT_TIMEOUT_ATT: self.response.read_sized_int,
15611564
DbInfoCode.PROTOCOL_VERSION: self.response.read_sized_int,
1562-
DbInfoCode.CRYPT_PLUGIN: self._info_string,
1565+
DbInfoCode.CRYPT_PLUGIN: self._single_info_string,
15631566
DbInfoCode.CREATION_TIMESTAMP_TZ: self.__creation_tstz,
1564-
DbInfoCode.WIRE_CRYPT: self._info_string,
1567+
DbInfoCode.WIRE_CRYPT: self._single_info_string,
15651568
DbInfoCode.FEATURES: self.__features,
15661569
DbInfoCode.NEXT_ATTACHMENT: self.response.read_sized_int,
15671570
DbInfoCode.NEXT_STATEMENT: self.response.read_sized_int,
1568-
DbInfoCode.DB_GUID: self._info_string,
1569-
DbInfoCode.DB_FILE_ID: self._info_string,
1571+
DbInfoCode.DB_GUID: self._single_info_string,
1572+
DbInfoCode.DB_FILE_ID: self._single_info_string,
15701573
DbInfoCode.REPLICA_MODE: self.__replica_mode,
15711574
})
15721575
def __creation_tstz(self) -> datetime.datetime:
@@ -4974,7 +4977,7 @@ class ServerDbServices(ServerDbServices4):
49744977
"""Database-related actions and services [Firebird 5+].
49754978
"""
49764979
def upgrade(self, *, database: FILESPEC) -> bytes:
4977-
"""Perform database repair operation. **(SYNC service)**
4980+
"""Perform database ODS upgrade operation. **(SYNC service)**
49784981
49794982
Arguments:
49804983
database: Database specification or alias.
@@ -5501,7 +5504,7 @@ def info(self) -> ServerInfoProvider:
55015504
self.__info = ServerInfoProvider(self.encoding, self)
55025505
return self.__info
55035506
@property
5504-
def database(self) -> Union[ServerDbServices3, ServerDbServices]:
5507+
def database(self) -> Union[ServerDbServices4, ServerDbServices3, ServerDbServices]:
55055508
"""Access to various database-related actions and services.
55065509
"""
55075510
if self.__dbsvc is None:

0 commit comments

Comments
 (0)