@@ -103,27 +103,29 @@ def test_string_with_surrogates(self):
103
103
row = self .cur .fetchone ()
104
104
self .assertIsNone (row )
105
105
106
- @unittest .skipUnless (sys .maxsize > 2 ** 32 , 'requires 64bit platform ' )
107
- @support .bigmemtest (size = 2 ** 31 , memuse = 4 , dry_run = False )
106
+ @unittest .skipUnless (sys .maxsize > 2 ** 64 , 'requires (s)size_t > 64bit ' )
107
+ @support .bigmemtest (size = 2 ** 64 + 1 , memuse = 4 , dry_run = False )
108
108
def test_too_large_string (self , maxsize ):
109
109
with self .assertRaises (sqlite .DataError ):
110
- self .cur .execute ("insert into test(s) values (?)" , ('x' * (2 ** 31 - 1 ),))
111
- with self .assertRaises (sqlite .DataError ):
112
- self .cur .execute ("insert into test(s) values (?)" , ('x' * (2 ** 31 ),))
110
+ self .cur .execute ("insert into test(s) values (?)" , ('x' * (2 ** 64 + 1 ),))
113
111
self .cur .execute ("select 1 from test" )
114
112
row = self .cur .fetchone ()
115
113
self .assertIsNone (row )
114
+ self .cur .execute ("insert into test(s) values (?)" , ('x' * (2 ** 64 ),))
115
+ row = self .cur .fetchone ()
116
+ self .assertEqual (len (row ), 1 )
116
117
117
- @unittest .skipUnless (sys .maxsize > 2 ** 32 , 'requires 64bit platform ' )
118
- @support .bigmemtest (size = 2 ** 31 , memuse = 3 , dry_run = False )
118
+ @unittest .skipUnless (sys .maxsize > 2 ** 64 , 'requires (s)size_t > 64bit ' )
119
+ @support .bigmemtest (size = 2 ** 64 + 1 , memuse = 3 , dry_run = False )
119
120
def test_too_large_blob (self , maxsize ):
120
121
with self .assertRaises (sqlite .DataError ):
121
- self .cur .execute ("insert into test(s) values (?)" , (b'x' * (2 ** 31 - 1 ),))
122
- with self .assertRaises (sqlite .DataError ):
123
- self .cur .execute ("insert into test(s) values (?)" , (b'x' * (2 ** 31 ),))
122
+ self .cur .execute ("insert into test(s) values (?)" , (b'x' * (2 ** 64 + 1 ),))
124
123
self .cur .execute ("select 1 from test" )
125
124
row = self .cur .fetchone ()
126
125
self .assertIsNone (row )
126
+ self .cur .execute ("insert into test(s) values (?)" , (b'x' * (2 ** 64 ),))
127
+ row = self .cur .fetchone ()
128
+ self .assertEqual (len (row ), 1 )
127
129
128
130
129
131
class DeclTypesTests (unittest .TestCase ):
0 commit comments