singlestoredb 1.12.3__cp38-abi3-win_amd64.whl → 1.12.4__cp38-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of singlestoredb might be problematic. Click here for more details.

_singlestoredb_accel.pyd CHANGED
Binary file
singlestoredb/__init__.py CHANGED
@@ -13,7 +13,7 @@ Examples
13
13
 
14
14
  """
15
15
 
16
- __version__ = '1.12.3'
16
+ __version__ = '1.12.4'
17
17
 
18
18
  from typing import Any
19
19
 
@@ -989,18 +989,11 @@ class Connection(BaseConnection):
989
989
 
990
990
  def set_character_set(self, charset, collation=None):
991
991
  """
992
- Set session charaset (and collation) on the server.
992
+ Set charaset (and collation) on the server.
993
993
 
994
- Send "SET [COLLATION|CHARACTER_SET]_SERVER = [collation|charset]" query.
994
+ Send "SET NAMES charset [COLLATE collation]" query.
995
995
  Update Connection.encoding based on charset.
996
996
 
997
- If charset/collation are being set to utf8mb4, the corresponding global
998
- variables (COLLATION_SERVER and CHARACTER_SET_SERVER) must be also set
999
- to utf8mb4. This is true by default for SingleStore 8.7+. For previuous
1000
- versions or non-default setting user must manully run the query
1001
- `SET global collation_connection = utf8mb4_general_ci`
1002
- replacing utf8mb4_general_ci with {collation}.
1003
-
1004
997
  Parameters
1005
998
  ----------
1006
999
  charset : str
@@ -1013,9 +1006,9 @@ class Connection(BaseConnection):
1013
1006
  encoding = charset_by_name(charset).encoding
1014
1007
 
1015
1008
  if collation:
1016
- query = f'SET COLLATION_SERVER={collation}'
1009
+ query = f'SET NAMES {charset} COLLATE {collation}'
1017
1010
  else:
1018
- query = f'SET CHARACTER_SET_SERVER={charset}'
1011
+ query = f'SET NAMES {charset}'
1019
1012
  self._execute_command(COMMAND.COM_QUERY, query)
1020
1013
  self._read_packet()
1021
1014
  self.charset = charset
@@ -1119,6 +1112,19 @@ class Connection(BaseConnection):
1119
1112
  self._get_server_information()
1120
1113
  self._request_authentication()
1121
1114
 
1115
+ # Send "SET NAMES" query on init for:
1116
+ # - Ensure charaset (and collation) is set to the server.
1117
+ # - collation_id in handshake packet may be ignored.
1118
+ # - If collation is not specified, we don't know what is server's
1119
+ # default collation for the charset. For example, default collation
1120
+ # of utf8mb4 is:
1121
+ # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci
1122
+ # - MySQL 8.0: utf8mb4_0900_ai_ci
1123
+ #
1124
+ # Reference:
1125
+ # - https://github.com/PyMySQL/PyMySQL/issues/1092
1126
+ # - https://github.com/wagtail/wagtail/issues/9477
1127
+ # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese)
1122
1128
  self.set_character_set(self.charset, self.collation)
1123
1129
 
1124
1130
  if self.sql_mode is not None:
@@ -1308,6 +1308,8 @@ class TestBasics(unittest.TestCase):
1308
1308
  )
1309
1309
 
1310
1310
  def test_charset(self):
1311
+ self.skipTest('Skip until charset commands are re-implemented')
1312
+
1311
1313
  with s2.connect(database=type(self).dbname) as conn:
1312
1314
  with conn.cursor() as cur:
1313
1315
  cur.execute('''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: singlestoredb
3
- Version: 1.12.3
3
+ Version: 1.12.4
4
4
  Summary: Interface to the SingleStoreDB database and workspace management APIs
5
5
  Home-page: https://github.com/singlestore-labs/singlestoredb-python
6
6
  Author: SingleStore
@@ -1,5 +1,5 @@
1
- _singlestoredb_accel.pyd,sha256=tWl_t2sd10DGMEUd3QEvL7DGh6nhah3stCLQU4W6ANo,59392
2
- singlestoredb/__init__.py,sha256=Mt5lSYU33x17JRX_uk7ftkZ8RmWnyWINacQdbCFPSxY,1712
1
+ _singlestoredb_accel.pyd,sha256=BjwcTKJQb9p7VofVO-Lrg_BXA6nM4nvVUNyKF9WkU7c,59392
2
+ singlestoredb/__init__.py,sha256=Y3oYr5E9O4QiB6TxEq0HF58H-agjoOb93fc2WyLXPBg,1712
3
3
  singlestoredb/auth.py,sha256=RmYiH0Wlc2RXc4pTlRMysxtBI445ggCIwojWKC_eDLE,7844
4
4
  singlestoredb/config.py,sha256=7-M2c7IAv3B1AmAKizgeNn880TDBbM4gbElLfStejIU,13035
5
5
  singlestoredb/connection.py,sha256=Ty_idVYH50Qx-j8WXy7NeB-DYLAcpdjGYTrTHkKzG9U,47309
@@ -62,7 +62,7 @@ singlestoredb/management/workspace.py,sha256=D9DzpeWU7xFjpj8bBYiXyasjVYVANeYjTzg
62
62
  singlestoredb/mysql/__init__.py,sha256=CbpwzNUJPAmKPpIobC0-ugBta_RgHCMq7X7N75QLReY,4669
63
63
  singlestoredb/mysql/_auth.py,sha256=YaqqyvAHmeraBv3BM207rNveUVPM-mPnW20ts_ynVWg,8341
64
64
  singlestoredb/mysql/charset.py,sha256=mnCdMpvdub1S2mm2PSk2j5JddgsWRjsVLtGx-y9TskE,10724
65
- singlestoredb/mysql/connection.py,sha256=Dlam7wNSfn4jVBNrqdvxLzwxJqCQUzuu_rlcKU45MB0,75113
65
+ singlestoredb/mysql/connection.py,sha256=sqcwlPopdxPt1wVUTq_1uJ5_CSRxbd_ILSgOCB1z7zQ,75387
66
66
  singlestoredb/mysql/converters.py,sha256=vebFFm6IrC0WgY-5Eh-esaPizY5cq3vDOUlEKGaYM-U,7771
67
67
  singlestoredb/mysql/cursors.py,sha256=YoZU5_weniqXcoeA0GVSxmetkPYooiDkXMbVBYUNlrU,27942
68
68
  singlestoredb/mysql/err.py,sha256=aDbmfq08gWVmfgIea735wSeiFdvYbB5wusgd3qTVq1s,2480
@@ -113,7 +113,7 @@ singlestoredb/tests/test.ipynb,sha256=IEgXbByXyWDplZvod1J2SqNHZiPOGdD4oNVMd0ArP7
113
113
  singlestoredb/tests/test.sql,sha256=winJzhZ2W52PcQ1j8X_NNIDRBmEa-xMAYrS_hoUtAP8,18337
114
114
  singlestoredb/tests/test2.ipynb,sha256=_kBQVvEoinQ1zInNcWFKpbdw-djkLsEO8l3g2MEU_Zs,236
115
115
  singlestoredb/tests/test2.sql,sha256=CEM8_lX189iQU65G3Pod7lig6osfrveQyoDz6HC35YQ,38
116
- singlestoredb/tests/test_basics.py,sha256=7JZdyudRaW3ZJkQ-m21ZstFlHz1Fyw2eSfN7y_zEhpU,49703
116
+ singlestoredb/tests/test_basics.py,sha256=tKzeSN8koMRFq5yjb98Wz5VWAOsnUKAETZEJyLhMD_o,49778
117
117
  singlestoredb/tests/test_config.py,sha256=Ad0PDmCnJMOyy9f7WTKiRasSR_3mYRByUlSb7k5ZySg,11502
118
118
  singlestoredb/tests/test_connection.py,sha256=UmoNo8erkcifEMbHZl83yAaRsyh6HANRdEtY3aViOK8,122792
119
119
  singlestoredb/tests/test_dbapi.py,sha256=cNJoTEZvYG7ckcwT7xqlkJX-2TDEYGTDDU1Igucp48k,679
@@ -141,9 +141,9 @@ singlestoredb/utils/results.py,sha256=wR70LhCqlobniZf52r67zYLBOKjWHQm68NAskdRQND
141
141
  singlestoredb/utils/xdict.py,sha256=-wi1lSPTnY99fhVMBhPKJ8cCsQhNG4GMUfkEBDKYgCw,13321
142
142
  sqlx/__init__.py,sha256=4Sdn8HN-Hf8v0_wCt60DCckCg8BvgM3-9r4YVfZycRE,89
143
143
  sqlx/magic.py,sha256=6VBlotgjautjev599tHaTYOfcfOA9m6gV_-P1_Qc4lI,3622
144
- singlestoredb-1.12.3.dist-info/LICENSE,sha256=Bojenzui8aPNjlF3w4ojguDP7sTf8vFV_9Gc2UAG1sg,11542
145
- singlestoredb-1.12.3.dist-info/METADATA,sha256=f8Qx8NA3HZiI2rGrFk1g8d41iXhAHaiEVww6DMtDixM,5778
146
- singlestoredb-1.12.3.dist-info/WHEEL,sha256=UyMHzmWA0xVqVPKfTiLs2eN3OWWZUl-kQemNbpIqlKo,100
147
- singlestoredb-1.12.3.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
148
- singlestoredb-1.12.3.dist-info/top_level.txt,sha256=lA65Vf4qAMfg_s1oG3LEO90h4t1Z-SPDbRqkevI3bSY,40
149
- singlestoredb-1.12.3.dist-info/RECORD,,
144
+ singlestoredb-1.12.4.dist-info/LICENSE,sha256=Bojenzui8aPNjlF3w4ojguDP7sTf8vFV_9Gc2UAG1sg,11542
145
+ singlestoredb-1.12.4.dist-info/METADATA,sha256=K1tOPCbyAof-bQelQHIkS3dyPZ5xx-2ckWoKxUamUSs,5778
146
+ singlestoredb-1.12.4.dist-info/WHEEL,sha256=UyMHzmWA0xVqVPKfTiLs2eN3OWWZUl-kQemNbpIqlKo,100
147
+ singlestoredb-1.12.4.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
148
+ singlestoredb-1.12.4.dist-info/top_level.txt,sha256=lA65Vf4qAMfg_s1oG3LEO90h4t1Z-SPDbRqkevI3bSY,40
149
+ singlestoredb-1.12.4.dist-info/RECORD,,