singlestoredb 1.6.0__cp38-abi3-macosx_10_9_universal2.whl → 1.6.2__cp38-abi3-macosx_10_9_universal2.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.

Binary file
singlestoredb/__init__.py CHANGED
@@ -13,7 +13,7 @@ Examples
13
13
 
14
14
  """
15
15
 
16
- __version__ = '1.6.0'
16
+ __version__ = '1.6.2'
17
17
 
18
18
  from typing import Any
19
19
 
@@ -716,6 +716,7 @@ class Connection(BaseConnection):
716
716
  Error : If the connection is already closed.
717
717
 
718
718
  """
719
+ self._result = None
719
720
  if self.host == 'singlestore.com':
720
721
  return
721
722
  if self._closed:
@@ -1909,12 +1910,12 @@ class MySQLResultSV(MySQLResult):
1909
1910
  encoding_errors=connection.encoding_errors,
1910
1911
  ).items() if v is not UNSET
1911
1912
  }
1912
- self._read_rowdata_packet = functools.partial(
1913
- _singlestoredb_accel.read_rowdata_packet, self, False,
1914
- )
1915
- self._read_rowdata_packet_unbuffered = functools.partial(
1916
- _singlestoredb_accel.read_rowdata_packet, self, True,
1917
- )
1913
+
1914
+ def _read_rowdata_packet(self, *args, **kwargs):
1915
+ return _singlestoredb_accel.read_rowdata_packet(self, False, *args, **kwargs)
1916
+
1917
+ def _read_rowdata_packet_unbuffered(self, *args, **kwargs):
1918
+ return _singlestoredb_accel.read_rowdata_packet(self, True, *args, **kwargs)
1918
1919
 
1919
1920
 
1920
1921
  class LoadLocalFile:
@@ -1197,6 +1197,64 @@ class TestBasics(unittest.TestCase):
1197
1197
  cur.execute('SELECT * FROM badutf8')
1198
1198
  list(cur)
1199
1199
 
1200
+ def test_character_lengths(self):
1201
+ if 'http' in self.conn.driver:
1202
+ self.skipTest('Character lengths too long for HTTP interface')
1203
+
1204
+ tbl_id = str(id(self))
1205
+
1206
+ self.cur.execute('DROP TABLE IF EXISTS test_character_lengths')
1207
+ self.cur.execute(rf'''
1208
+ CREATE TABLE `test_character_lengths_{tbl_id}` (
1209
+ `id` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
1210
+ `char_col` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
1211
+ `int_col` INT,
1212
+ PRIMARY KEY (`id`),
1213
+ SORT KEY `id` (`id`)
1214
+ ) AUTOSTATS_CARDINALITY_MODE=INCREMENTAL
1215
+ AUTOSTATS_HISTOGRAM_MODE=CREATE
1216
+ AUTOSTATS_SAMPLING=ON
1217
+ SQL_MODE='STRICT_ALL_TABLES'
1218
+ ''')
1219
+
1220
+ CHAR_STR_SHORT = 'a'
1221
+ CHAR_STR_LONG = 'a' * (2**8-1)
1222
+ SHORT_STR_SHORT = 'a' * ((2**8-1) + 1)
1223
+ SHORT_STR_LONG = 'a' * (2**16-1)
1224
+ INT24_STR_SHORT = 'a' * ((2**16-1) + 1)
1225
+ INT24_STR_LONG = 'a' * (2**24-1)
1226
+ INT64_STR_SHORT = 'a' * ((2**24-1) + 1)
1227
+ INT64_STR_LONG = 'a' * ((2**24-1) + 100000)
1228
+
1229
+ data = [
1230
+ ['CHAR_SHORT', CHAR_STR_SHORT, 123456],
1231
+ ['CHAR_LONG', CHAR_STR_LONG, 123456],
1232
+ ['SHORT_SHORT', SHORT_STR_SHORT, 123456],
1233
+ ['SHORT_LONG', SHORT_STR_LONG, 123456],
1234
+ ['INT24_SHORT', INT24_STR_SHORT, 123456],
1235
+ ['INT24_LONG', INT24_STR_LONG, 123456],
1236
+ ['INT64_SHORT', INT64_STR_SHORT, 123456],
1237
+ ['INT64_LONG', INT64_STR_LONG, 123456],
1238
+ ]
1239
+
1240
+ self.cur.executemany(
1241
+ f'INSERT INTO test_character_lengths_{tbl_id}(id, char_col, int_col) '
1242
+ 'VALUES (%s, %s, %s)', data,
1243
+ )
1244
+
1245
+ for i, row in enumerate(data):
1246
+ self.cur.execute(
1247
+ f'SELECT id, char_col, int_col FROM test_character_lengths_{tbl_id} '
1248
+ 'WHERE id = %s',
1249
+ [row[0]],
1250
+ )
1251
+ assert data[i] == list(list(self.cur)[0])
1252
+
1253
+ try:
1254
+ self.cur.execute(f'DROP TABLE test_character_lengths_{tbl_id}')
1255
+ except Exception:
1256
+ pass
1257
+
1200
1258
 
1201
1259
  if __name__ == '__main__':
1202
1260
  import nose2
@@ -685,7 +685,8 @@ class TestJobsFusion(unittest.TestCase):
685
685
  'Status', 'ScheduledStartTime', 'StartedAt', 'FinishedAt',
686
686
  ]
687
687
  exec_job_ids = [x[2] for x in out]
688
- assert [x for x in exec_job_ids] == [job_id]
688
+ for x in exec_job_ids:
689
+ assert x == job_id
689
690
 
690
691
  # show executions for job with id job_id from 1 to 5 extended
691
692
  self.cur.execute(f'show job executions for {job_id} from 1 to 5 extended')
@@ -698,7 +699,8 @@ class TestJobsFusion(unittest.TestCase):
698
699
  'SnapshotNotebookPath',
699
700
  ]
700
701
  exec_job_ids = [x[2] for x in out]
701
- assert [x for x in exec_job_ids] == [job_id]
702
+ for x in exec_job_ids:
703
+ assert x == job_id
702
704
 
703
705
  # drop job
704
706
  self.cur.execute(f'drop jobs {job_id}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: singlestoredb
3
- Version: 1.6.0
3
+ Version: 1.6.2
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,13 +1,13 @@
1
- _singlestoredb_accel.abi3.so,sha256=aiwE77j965rr4m6HQ44CsFtxkIJS5j0O8_BrhXtQy1M,206633
2
- singlestoredb-1.6.0.dist-info/RECORD,,
3
- singlestoredb-1.6.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
- singlestoredb-1.6.0.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
- singlestoredb-1.6.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
- singlestoredb-1.6.0.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
7
- singlestoredb-1.6.0.dist-info/METADATA,sha256=j8Ftto3l0UXSMHdEOhN-4wBWkV3Vezu3ywBaX2_FND0,5570
1
+ _singlestoredb_accel.abi3.so,sha256=hRjG3QnnDg7GD4mUjNjh56mTfZ5QQIXaBNlIBhtK5bY,206633
2
+ singlestoredb-1.6.2.dist-info/RECORD,,
3
+ singlestoredb-1.6.2.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
+ singlestoredb-1.6.2.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
+ singlestoredb-1.6.2.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
+ singlestoredb-1.6.2.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
7
+ singlestoredb-1.6.2.dist-info/METADATA,sha256=7KUsmerUlYlEQ4_wF6WXOABhsIcfCL-I4RLuSS7BNxw,5570
8
8
  singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
9
9
  singlestoredb/config.py,sha256=0qU2lweqHIA5yuV0ZN_JS-cZCfLIxIHutgS2YKRuwXw,12067
10
- singlestoredb/__init__.py,sha256=UtFF-Njj_GrzPJfAt4suKqpVaYVLc4rLgJ60Ary0ndQ,1634
10
+ singlestoredb/__init__.py,sha256=k-LJN-GeJeTKCSDSlMPr4-mM2_k1vOO643_TA8IyyOs,1634
11
11
  singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
12
12
  singlestoredb/connection.py,sha256=Gzq38vG8lXTx5v2WvHkdMg-abSTS6lguTsVMxbYHZmQ,45306
13
13
  singlestoredb/pytest.py,sha256=OyF3BO9mgxenifYhOihnzGk8WzCJ_zN5_mxe8XyFPOc,9074
@@ -26,9 +26,9 @@ singlestoredb/fusion/handlers/workspace.py,sha256=4xN2TFO4yF7KZB2Fcht7IuvoDdAT6f
26
26
  singlestoredb/tests/test.sql,sha256=dfMehVCQ9wObSVTQKyQi-fRFDZeqRxV4Cj8doBCPEFM,17679
27
27
  singlestoredb/tests/test_xdict.py,sha256=fqHspoi39nbX3fIDVkkRXcd5H50xdOsSvK0bxAMQnaE,10408
28
28
  singlestoredb/tests/test_results.py,sha256=wg93sujwt-R9_eJCgSCElgAZhLDkIiAo3qPkPydOv78,6582
29
- singlestoredb/tests/test_fusion.py,sha256=QDBjU3OfBJoQqtzwlN2dQHwA3W91_wyJvun6HZ-YcmQ,23810
29
+ singlestoredb/tests/test_fusion.py,sha256=W3aRfBeu8HBGm1CIQWFIeWUPBUlfHBCbJy8vejPHdRs,23828
30
30
  singlestoredb/tests/test_plugin.py,sha256=qpO9wmWc62VaijN1sJ97YSYIX7I7Y5C6sY-WzwrutDQ,812
31
- singlestoredb/tests/test_basics.py,sha256=rUfUGZ54xybvgp11XYWdqnUYMKa6VckB3XkX9LFnxRw,44180
31
+ singlestoredb/tests/test_basics.py,sha256=1__lEF7FmQF4_pFi5R53TtJidtQznmQ592Ci6aDVgrc,46368
32
32
  singlestoredb/tests/test_ext_func.py,sha256=OWd-CJ1Owhx72nikSWWEF2EQFCJk7vEXZM2Oy9EbYQo,37357
33
33
  singlestoredb/tests/test_connection.py,sha256=ZmhnECusipQAuc6bfZOfMMZULrtxUhnxjxNNSSi6xH4,117697
34
34
  singlestoredb/tests/test_ext_func_data.py,sha256=yTADD93nPxX6_rZXXLZaOWEI_yPvYyir9psn5PK9ctU,47695
@@ -71,7 +71,7 @@ singlestoredb/mysql/protocol.py,sha256=2GG8qTXy5npqo7z2D2K5T0S8PtoUOS-hFDEXy8VCo
71
71
  singlestoredb/mysql/cursors.py,sha256=Eqe7jITRvOo4P_TxIarTumg_2PG1DcCfZ4Uo9IFdDa8,26794
72
72
  singlestoredb/mysql/__init__.py,sha256=olUTAvkiERhDW41JXQMawkg-i0tvBEkoTkII1tt6lxU,4492
73
73
  singlestoredb/mysql/times.py,sha256=2j7purNVnJmjhOUgwUze-r3kNlCWqxjXj-jtqOzBfZI,463
74
- singlestoredb/mysql/connection.py,sha256=cUVILM5q2tVkGAf-GpPK2pvPto3AOB_9PifK8iXaiKw,72216
74
+ singlestoredb/mysql/connection.py,sha256=NpehiK8NTPSc2KH4toLqik3e63XMZSov4s9gOVcBfko,72260
75
75
  singlestoredb/mysql/charset.py,sha256=-FlONDS_oAUF5B3mIgeHBPb_SCt4zHD33arUeBNctU0,10510
76
76
  singlestoredb/mysql/converters.py,sha256=CVe8SDmjbIAhy1xpQ2N5OKWw6t5eWpw-EU3QTlA0Hh0,7500
77
77
  singlestoredb/mysql/optionfile.py,sha256=DqL-rOQcqQncD5eVbPRkwZqo7Pj3Vh40VLx3E_e87TU,655