File tree 4 files changed +31
-7
lines changed
4 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env tarantool
2
2
3
+ local is_compat , compat = pcall (require , " compat" )
3
4
local os = require (' os' )
4
5
5
6
local admin_listen = os.getenv (" ADMIN" )
6
7
local primary_listen = os.getenv (" LISTEN" )
7
8
local auth_type = os.getenv (" AUTH_TYPE" )
8
9
10
+ local SQL_SEQ_SCAN_DEFAULT = os.getenv (" SQL_SEQ_SCAN_DEFAULT" )
11
+ if is_compat and SQL_SEQ_SCAN_DEFAULT then
12
+ compat .sql_seq_scan_default = SQL_SEQ_SCAN_DEFAULT
13
+ end
14
+
9
15
require (' console' ).listen (admin_listen )
10
16
box .cfg {
11
17
listen = primary_listen ,
Original file line number Diff line number Diff line change @@ -189,7 +189,8 @@ def __new__(cls,
189
189
ssl_password = None ,
190
190
ssl_password_file = None ,
191
191
create_unix_socket = False ,
192
- auth_type = None ):
192
+ auth_type = None ,
193
+ sql_seq_scan_default = None ):
193
194
# pylint: disable=unused-argument
194
195
195
196
if os .name == 'nt' :
@@ -205,7 +206,8 @@ def __init__(self,
205
206
ssl_password = None ,
206
207
ssl_password_file = None ,
207
208
create_unix_socket = False ,
208
- auth_type = None ):
209
+ auth_type = None ,
210
+ sql_seq_scan_default = None ):
209
211
# pylint: disable=consider-using-with
210
212
211
213
os .popen ('ulimit -c unlimited' ).close ()
@@ -235,6 +237,7 @@ def __init__(self,
235
237
self .ssl_password = ssl_password
236
238
self .ssl_password_file = ssl_password_file
237
239
self .auth_type = auth_type
240
+ self .sql_seq_scan_default = sql_seq_scan_default
238
241
self ._binary = None
239
242
self ._log_des = None
240
243
@@ -289,6 +292,8 @@ def generate_configuration(self):
289
292
os .putenv ("AUTH_TYPE" , self .auth_type )
290
293
else :
291
294
os .putenv ("AUTH_TYPE" , "" )
295
+ if self .sql_seq_scan_default is not None :
296
+ os .putenv ("SQL_SEQ_SCAN_DEFAULT" , self .sql_seq_scan_default )
292
297
293
298
def prepare_args (self ):
294
299
"""
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ class TestSuiteDBAPI(dbapi20.DatabaseAPI20Test):
27
27
def setUpClass (cls ):
28
28
print (' DBAPI ' .center (70 , '=' ), file = sys .stderr )
29
29
print ('-' * 70 , file = sys .stderr )
30
- cls .srv = TarantoolServer ()
30
+ # Select scans are not allowed with compat.sql_seq_scan_default = "new",
31
+ # but tests create cursors with fullscan.
32
+ cls .srv = TarantoolServer (sql_seq_scan_default = "old" )
31
33
cls .srv .script = 'test/suites/box.lua'
32
34
cls .srv .start ()
33
35
cls .con = tarantool .Connection (cls .srv .host , cls .srv .args ['primary' ])
Original file line number Diff line number Diff line change @@ -454,10 +454,21 @@ def test_07_schema_version_update(self):
454
454
def _run_test_schema_fetch_disable (self , con , mode = None ):
455
455
# Enable SQL test case for tarantool 2.* and higher.
456
456
if int (str (self .srv .admin .tnt_version )[0 ]) > 1 :
457
- self .testing_methods ['available' ]['execute' ] = {
458
- 'input' : ['SELECT * FROM "tester"' ],
459
- 'output' : [[1 , None ]],
460
- }
457
+ if self .srv .admin .tnt_version >= pkg_resources .parse_version ('2.11.0' ):
458
+ # SEQSCAN keyword is explicitly allowing to use seqscan
459
+ # https://github.com/tarantool/tarantool/commit/77648827326ad268ec0ffbcd620c2371b65ef2b4
460
+ # It was introduced in 2.11.0-rc1. If compat.sql_seq_scan_default
461
+ # set to "new" (default value since 3.0), returns error
462
+ # if trying to scan without keyword.
463
+ self .testing_methods ['available' ]['execute' ] = {
464
+ 'input' : ['SELECT * FROM SEQSCAN "tester"' ],
465
+ 'output' : [[1 , None ]],
466
+ }
467
+ else :
468
+ self .testing_methods ['available' ]['execute' ] = {
469
+ 'input' : ['SELECT * FROM "tester"' ],
470
+ 'output' : [[1 , None ]],
471
+ }
461
472
462
473
# Testing the schemaless connection with methods
463
474
# that should NOT be available.
You can’t perform that action at this time.
0 commit comments