Skip to content

Commit 346f3f8

Browse files
committed
Add connection debugging
1 parent e0bf8af commit 346f3f8

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = singlestoredb
3-
version = 0.7.1
3+
version = 0.7.2
44
description = Interface to the SingleStore database and cluster management APIs
55
long_description = file: README.md
66
long_description_content_type = text/markdown

singlestoredb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
"""
1515

16-
__version__ = '0.7.1'
16+
__version__ = '0.7.2'
1717

1818
from .config import options, get_option, set_option, describe_option
1919
from .connection import connect, apilevel, threadsafety, paramstyle

singlestoredb/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,10 @@
230230
'Print queries and parameters to stderr.',
231231
environ='SINGLESTOREDB_DEBUG_QUERIES',
232232
)
233+
234+
235+
register_option(
236+
'debug.connection', 'bool', check_bool, False,
237+
'Print connection tracing information.',
238+
environ='SINGLESTOREDB_DEBUG_CONNECTION',
239+
)

singlestoredb/mysql/_auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
from functools import partial
1717
import hashlib
1818

19+
from ..config import get_option
1920

20-
DEBUG = False
21+
22+
DEBUG = get_option('debug.connection')
2123
SCRAMBLE_LENGTH = 20
2224
sha1_new = partial(hashlib.new, 'sha1')
2325

singlestoredb/mysql/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
LoadLocalPacketWrapper,
4747
)
4848
from . import err
49+
from ..config import get_option
4950
from ..connection import Connection as BaseConnection
5051

5152
try:
@@ -65,7 +66,7 @@
6566
# KeyError occurs when there's no entry in OS database for a current user.
6667
DEFAULT_USER = None
6768

68-
DEBUG = False
69+
DEBUG = get_option('debug.connection')
6970

7071
TEXT_TYPES = {
7172
FIELD_TYPE.BIT,

singlestoredb/mysql/protocol.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import sys
66

77
from . import err
8+
from ..config import get_option
89
from ..utils.results import Description
910
from .charset import MBLENGTH
1011
from .constants import FIELD_TYPE
1112
from .constants import SERVER_STATUS
1213

1314

14-
DEBUG = False
15+
DEBUG = get_option('debug.connection')
1516

1617
NULL_COLUMN = 251
1718
UNSIGNED_CHAR_COLUMN = 251

0 commit comments

Comments
 (0)