The following issues were found
src/third_party/wiredtiger/test/suite/test_util03.py
18 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_util03.py
# Utilities: wt create
class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 68
Column: 17
self.assertEqual(cursor.key_format, self.key_format)
if self.value_format != None:
self.assertEqual(cursor.value_format, self.value_format)
for key,val in cursor:
self.fail('table should be empty')
cursor.close()
class test_util03_import(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_util03.a'
Reported by Pylint.
Line: 68
Column: 13
self.assertEqual(cursor.key_format, self.key_format)
if self.value_format != None:
self.assertEqual(cursor.value_format, self.value_format)
for key,val in cursor:
self.fail('table should be empty')
cursor.close()
class test_util03_import(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_util03.a'
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_util03.py
# Utilities: wt create
class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_util03.py
# Utilities: wt create
class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 35
Column: 1
# test_util03.py
# Utilities: wt create
class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_util03.a'
nentries = 1000
scenarios = make_scenarios([
('none', dict(key_format=None,value_format=None)),
Reported by Pylint.
Line: 35
Column: 1
# test_util03.py
# Utilities: wt create
class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_util03.a'
nentries = 1000
scenarios = make_scenarios([
('none', dict(key_format=None,value_format=None)),
Reported by Pylint.
Line: 52
Column: 39
"""
args = ["create"]
if self.key_format != None or self.value_format != None:
args.append('-c')
config = ''
if self.key_format != None:
config += 'key_format=' + self.key_format + ','
if self.value_format != None:
Reported by Pylint.
Line: 52
Column: 12
"""
args = ["create"]
if self.key_format != None or self.value_format != None:
args.append('-c')
config = ''
if self.key_format != None:
config += 'key_format=' + self.key_format + ','
if self.value_format != None:
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/test_distutilscmd.py
18 issues
Line: 7
Column: 1
from distutils.dist import Distribution
from extras import try_import
from testtools.compat import (
_b,
_u,
BytesIO,
Reported by Pylint.
Line: 9
Column: 1
from extras import try_import
from testtools.compat import (
_b,
_u,
BytesIO,
)
fixtures = try_import('fixtures')
Reported by Pylint.
Line: 64
Column: 9
dist.cmdclass = {'test': TestCommand}
dist.command_options = {
'test': {'test_module': ('command line', 'testtools.runexample')}}
cmd = dist.reinitialize_command('test')
with fixtures.MonkeyPatch('sys.stdout', stdout.stream):
dist.run_command('test')
self.assertThat(
stdout.getDetails()['stdout'].as_text(),
MatchesRegex(_u("""Tests running...
Reported by Pylint.
Line: 86
Column: 9
'test': {
'test_suite': (
'command line', 'testtools.runexample.test_suite')}}
cmd = dist.reinitialize_command('test')
with fixtures.MonkeyPatch('sys.stdout', stdout.stream):
dist.run_command('test')
self.assertThat(
stdout.getDetails()['stdout'].as_text(),
MatchesRegex(_u("""Tests running...
Reported by Pylint.
Line: 16
Column: 1
)
fixtures = try_import('fixtures')
import testtools
from testtools import TestCase
from testtools.distutilscmd import TestCommand
from testtools.matchers import MatchesRegex
Reported by Pylint.
Line: 17
Column: 1
fixtures = try_import('fixtures')
import testtools
from testtools import TestCase
from testtools.distutilscmd import TestCommand
from testtools.matchers import MatchesRegex
if fixtures:
Reported by Pylint.
Line: 18
Column: 1
import testtools
from testtools import TestCase
from testtools.distutilscmd import TestCommand
from testtools.matchers import MatchesRegex
if fixtures:
class SampleTestFixture(fixtures.Fixture):
Reported by Pylint.
Line: 19
Column: 1
import testtools
from testtools import TestCase
from testtools.distutilscmd import TestCommand
from testtools.matchers import MatchesRegex
if fixtures:
class SampleTestFixture(fixtures.Fixture):
"""Creates testtools.runexample temporarily."""
Reported by Pylint.
Line: 23
Column: 5
if fixtures:
class SampleTestFixture(fixtures.Fixture):
"""Creates testtools.runexample temporarily."""
def __init__(self):
self.package = fixtures.PythonPackage(
'runexample', [('__init__.py', _b("""
Reported by Pylint.
Line: 41
Column: 9
return TestLoader().loadTestsFromName(__name__)
"""))])
def setUp(self):
super(SampleTestFixture, self).setUp()
self.useFixture(self.package)
testtools.__path__.append(self.package.base)
self.addCleanup(testtools.__path__.remove, self.package.base)
Reported by Pylint.
src/third_party/boost/boost/container/detail/copy_move_algo.hpp
18 issues
Line: 1047
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
void *const large_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f));
void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
std::memcpy(stora_ptr, large_ptr, n_i_bytes);
std::memcpy(large_ptr, short_ptr, n_i_bytes);
std::memcpy(short_ptr, stora_ptr, n_i_bytes);
boost::container::iterator_advance(large_range_f, n_i);
boost::container::iterator_advance(short_range_f, n_i);
boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw
Reported by FlawFinder.
Line: 1048
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
std::memcpy(stora_ptr, large_ptr, n_i_bytes);
std::memcpy(large_ptr, short_ptr, n_i_bytes);
std::memcpy(short_ptr, stora_ptr, n_i_bytes);
boost::container::iterator_advance(large_range_f, n_i);
boost::container::iterator_advance(short_range_f, n_i);
boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw
boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
Reported by FlawFinder.
Line: 1049
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
std::memcpy(stora_ptr, large_ptr, n_i_bytes);
std::memcpy(large_ptr, short_ptr, n_i_bytes);
std::memcpy(short_ptr, stora_ptr, n_i_bytes);
boost::container::iterator_advance(large_range_f, n_i);
boost::container::iterator_advance(short_range_f, n_i);
boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw
boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
}
Reported by FlawFinder.
Line: 1090
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
case 4:
break;
case 0: do{
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
Reported by FlawFinder.
Line: 1091
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
break;
case 0: do{
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 3:
Reported by FlawFinder.
Line: 1092
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
case 0: do{
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 3:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
Reported by FlawFinder.
Line: 1097
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 3:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
Reported by FlawFinder.
Line: 1098
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
BOOST_FALLTHROUGH;
case 3:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 2:
Reported by FlawFinder.
Line: 1099
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
case 3:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 2:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
Reported by FlawFinder.
Line: 1104
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
case 2:
std::memcpy(stora_ptr, large_ptr, sizeof_storage);
std::memcpy(large_ptr, short_ptr, sizeof_storage);
std::memcpy(short_ptr, stora_ptr, sizeof_storage);
large_ptr += sizeof_storage;
short_ptr += sizeof_storage;
BOOST_FALLTHROUGH;
Reported by FlawFinder.
src/third_party/wiredtiger/test/suite/test_prepare_cursor02.py
18 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleIndexDataSet
from wtdataset import SimpleLSMDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import make_scenarios
# test_prepare_cursor02.py
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleIndexDataSet
from wtdataset import SimpleLSMDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import make_scenarios
# test_prepare_cursor02.py
# WT_CURSOR navigation (next/prev) tests with prepared transactions
Reported by Pylint.
Line: 31
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleIndexDataSet
from wtdataset import SimpleLSMDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import make_scenarios
# test_prepare_cursor02.py
# WT_CURSOR navigation (next/prev) tests with prepared transactions
class test_prepare_cursor02(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 31
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleIndexDataSet
from wtdataset import SimpleLSMDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import make_scenarios
# test_prepare_cursor02.py
# WT_CURSOR navigation (next/prev) tests with prepared transactions
class test_prepare_cursor02(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 31
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleIndexDataSet
from wtdataset import SimpleLSMDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import make_scenarios
# test_prepare_cursor02.py
# WT_CURSOR navigation (next/prev) tests with prepared transactions
class test_prepare_cursor02(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 80
Column: 64
prep_session.begin_transaction()
# Check next operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
# Check prev operation.
prep_cursor.set_key(ds.key(1))
Reported by Pylint.
Line: 81
Column: 64
# Check next operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
# Check prev operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
Reported by Pylint.
Line: 82
Column: 64
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.next())
# Check prev operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.prev())
Reported by Pylint.
Line: 86
Column: 64
# Check prev operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.prev())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.prev())
prep_cursor.close()
prep_session.commit_transaction()
Reported by Pylint.
Line: 87
Column: 64
# Check prev operation.
prep_cursor.set_key(ds.key(1))
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.search())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.prev())
self.assertRaisesException(wiredtiger.WiredTigerError, lambda: prep_cursor.prev())
prep_cursor.close()
prep_session.commit_transaction()
session.rollback_transaction()
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_salvage.py
18 issues
Line: 31
Column: 1
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_salvage.py
# Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_salvage.a'
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_salvage.py
# Utilities: wt salvage
Reported by Pylint.
Line: 104
Column: 13
def check_empty_table(self, tablename):
cursor = self.session.open_cursor('table:' + tablename, None, None)
for gotkey, gotval in cursor:
self.fail(tablename + ': has unexpected entries')
cursor.close()
def damage(self, tablename):
self.damage_inner(tablename, self.unique.encode())
Reported by Pylint.
Line: 104
Column: 21
def check_empty_table(self, tablename):
cursor = self.session.open_cursor('table:' + tablename, None, None)
for gotkey, gotval in cursor:
self.fail(tablename + ': has unexpected entries')
cursor.close()
def damage(self, tablename):
self.damage_inner(tablename, self.unique.encode())
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_salvage.py
# Utilities: wt salvage
Reported by Pylint.
Line: 31
Column: 1
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_salvage.py
# Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_salvage.a'
Reported by Pylint.
Line: 31
Column: 1
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_salvage.py
# Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_salvage.a'
Reported by Pylint.
Line: 35
Column: 1
# test_salvage.py
# Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_salvage.a'
nentries = 1000
session_params = 'key_format=S,value_format=S'
unique = 'SomeUniqueString'
Reported by Pylint.
Line: 35
Column: 1
# test_salvage.py
# Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_salvage.a'
nentries = 1000
session_params = 'key_format=S,value_format=S'
unique = 'SomeUniqueString'
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_bug019.py
18 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
Reported by Pylint.
Line: 31
Column: 1
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
Reported by Pylint.
Line: 32
Column: 1
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
conn_config = 'log=(enabled,file_max=100K),statistics=(fast)'
Reported by Pylint.
Line: 88
Column: 13
# Wait for a log file to be pre-allocated. Avoid timing problems, but
# assert a file is created within 90 seconds.
def prepfiles(self):
for i in range(1,90):
f = fnmatch.filter(os.listdir('.'), "*Prep*")
if f:
return
time.sleep(1.0)
self.fail('No pre-allocated files created after 90 seconds')
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
Reported by Pylint.
Line: 31
Column: 1
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 36
Column: 1
# test_bug019.py
# Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
conn_config = 'log=(enabled,file_max=100K),statistics=(fast)'
uri = "table:bug019"
entries = 5000
max_initial_entries = 50000
max_prealloc = 1
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py
18 issues
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
Reported by Pylint.
Line: 34
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
# Test that rollback to stable does not open any dhandles that don't have unstable updates.
class test_rollback_to_stable20(test_rollback_to_stable_base):
Reported by Pylint.
Line: 49
Column: 5
scenarios = make_scenarios(key_format_values)
def conn_config(self):
config = 'cache_size=50MB,statistics=(all)'
return config
def test_rollback_to_stable(self):
nrows = 10000
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
Reported by Pylint.
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
Reported by Pylint.
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
Reported by Pylint.
Line: 34
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
# Test that rollback to stable does not open any dhandles that don't have unstable updates.
class test_rollback_to_stable20(test_rollback_to_stable_base):
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_hs07.py
18 issues
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_hs07.py
Reported by Pylint.
Line: 64
Column: 13
session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
cursor = session.open_cursor(uri)
count = 0
for k, v in cursor:
self.assertEqual(v, check_value)
count += 1
session.rollback_transaction()
self.assertEqual(count, nrows)
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
Reported by Pylint.
Line: 31
Column: 1
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
Reported by Pylint.
Line: 36
Column: 1
from wtscenario import make_scenarios
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
# Force a small cache.
conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
'eviction_updates_target=80,log=(enabled)')
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 37
Column: 1
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
# Force a small cache.
conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
'eviction_updates_target=80,log=(enabled)')
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 37
Column: 1
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
# Force a small cache.
conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
'eviction_updates_target=80,log=(enabled)')
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 49
Column: 5
)
scenarios = make_scenarios(key_format_values)
def large_updates(self, uri, value, ds, nrows, commit_ts):
# Update a large number of records, we'll hang if the history store table isn't working.
session = self.session
cursor = session.open_cursor(uri)
for i in range(1, nrows + 1):
session.begin_transaction()
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_prepare01.py
18 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_prepare01.py
# Transactions: basic functionality with prepare
class test_prepare01(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_prepare01.py
# Transactions: basic functionality with prepare
class test_prepare01(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 52
Column: 13
count = 0
# Column-store appends result in phantoms, ignore records unless they
# have our flag value.
for r in cursor:
if self.value_format == 'S' or cursor.get_value() == 0xab:
count += 1
return count
# Checkpoint the database and assert the number of records visible to the
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_prepare01.py
# Transactions: basic functionality with prepare
class test_prepare01(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 34
Column: 1
# test_prepare01.py
# Transactions: basic functionality with prepare
class test_prepare01(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
nentries = 1000
scenarios = make_scenarios([
('col-f', dict(uri='file:text_txn01',key_format='r',value_format='S')),
Reported by Pylint.
Line: 34
Column: 1
# test_prepare01.py
# Transactions: basic functionality with prepare
class test_prepare01(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
nentries = 1000
scenarios = make_scenarios([
('col-f', dict(uri='file:text_txn01',key_format='r',value_format='S')),
Reported by Pylint.
Line: 48
Column: 5
])
# Return the number of records visible to the cursor.
def cursor_count(self, cursor):
count = 0
# Column-store appends result in phantoms, ignore records unless they
# have our flag value.
for r in cursor:
if self.value_format == 'S' or cursor.get_value() == 0xab:
Reported by Pylint.
Line: 52
Column: 13
count = 0
# Column-store appends result in phantoms, ignore records unless they
# have our flag value.
for r in cursor:
if self.value_format == 'S' or cursor.get_value() == 0xab:
count += 1
return count
# Checkpoint the database and assert the number of records visible to the
Reported by Pylint.
Line: 59
Column: 5
# Checkpoint the database and assert the number of records visible to the
# checkpoint matches the expected value.
def check_checkpoint(self, expected):
s = self.conn.open_session()
s.checkpoint("name=test")
cursor = s.open_cursor(self.uri, None, "checkpoint=test")
self.assertEqual(self.cursor_count(cursor), expected)
s.close()
Reported by Pylint.
src/third_party/variant-1.4.0/include/mpark/variant.hpp
18 issues
Line: 441
Column: 15
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
std::is_destructible>()...);
};
namespace access {
struct recursive_union {
#ifdef MPARK_RETURN_TYPE_DEDUCTION
template <typename V>
inline static constexpr auto &&get_alt(V &&v, in_place_index_t<0>) {
Reported by FlawFinder.
Line: 505
Column: 25
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
template <typename Visitor, typename... Vs>
using dispatch_result_t = decltype(
lib::invoke(std::declval<Visitor>(),
access::base::get_alt<0>(std::declval<Vs>())...));
template <typename Expected>
struct expected {
template <typename Actual>
inline static constexpr bool but_got() {
Reported by FlawFinder.
Line: 561
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
using Expected = R;
using Actual = decltype(lib::invoke(
lib::forward<F>(f),
access::base::get_alt<ITs::value>(
lib::forward<typename ITs::type>(visited_vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<ITs::value>(
lib::forward<typename ITs::type>(visited_vs))...);
Reported by FlawFinder.
Line: 565
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
lib::forward<typename ITs::type>(visited_vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<ITs::value>(
lib::forward<typename ITs::type>(visited_vs))...);
}
template <std::size_t B, typename F, typename V, typename... Vs>
MPARK_ALWAYS_INLINE static constexpr R dispatch(
Reported by FlawFinder.
Line: 635
Column: 29
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
using Expected = R;
using Actual = decltype(
lib::invoke(lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...);
}
Reported by FlawFinder.
Line: 638
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
access::base::get_alt<I>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...);
}
template <std::size_t B, typename F, typename V, typename... Vs>
MPARK_ALWAYS_INLINE static constexpr R dispatch_at(std::size_t index,
F &&f,
Reported by FlawFinder.
Line: 724
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
using Expected = dispatch_result_t<F, Vs...>;
using Actual = decltype(lib::invoke(
lib::forward<F>(f),
access::base::get_alt<Is>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<Is>(lib::forward<Vs>(vs))...);
}
Reported by FlawFinder.
Line: 727
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
access::base::get_alt<Is>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<Is>(lib::forward<Vs>(vs))...);
}
#ifdef MPARK_RETURN_TYPE_DEDUCTION
template <std::size_t... Is>
inline static constexpr auto impl(lib::index_sequence<Is...>) {
Reported by FlawFinder.
Line: 785
Column: 29
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
using Expected = dispatch_result_t<F, Vs...>;
using Actual = decltype(
lib::invoke(lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...);
}
Reported by FlawFinder.
Line: 788
Column: 17
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
access::base::get_alt<I>(lib::forward<Vs>(vs))...));
return visit_return_type_check<Expected, Actual>::invoke(
lib::forward<F>(f),
access::base::get_alt<I>(lib::forward<Vs>(vs))...);
}
template <std::size_t... Is>
inline static constexpr AUTO impl(lib::index_sequence<Is...>)
AUTO_RETURN(make_farray(&dispatch<Is>...))
Reported by FlawFinder.