The following issues were found
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_colgap.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, simple_key, simple_value
from wtscenario import make_scenarios
# test_colgap.py
# Test variable-length column-store gap performance.
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 wtdataset import SimpleDataSet, simple_key, simple_value
from wtscenario import make_scenarios
# test_colgap.py
# Test variable-length column-store gap performance.
Reported by Pylint.
Line: 35
Column: 1
# test_colgap.py
# Test variable-length column-store gap performance.
class test_column_store_gap(wttest.WiredTigerTestCase):
nentries = 13
# Cursor forward
def forward(self, cursor, expected):
cursor.reset()
Reported by Pylint.
Line: 35
Column: 1
# test_colgap.py
# Test variable-length column-store gap performance.
class test_column_store_gap(wttest.WiredTigerTestCase):
nentries = 13
# Cursor forward
def forward(self, cursor, expected):
cursor.reset()
Reported by Pylint.
Line: 39
Column: 5
nentries = 13
# Cursor forward
def forward(self, cursor, expected):
cursor.reset()
i = 0
while True:
if cursor.next() != 0:
break
Reported by Pylint.
Line: 50
Column: 5
self.assertEqual(i, self.nentries)
# Cursor backward
def backward(self, cursor, expected):
cursor.reset()
i = 0
while True:
if cursor.prev() != 0:
break
Reported by Pylint.
Line: 62
Column: 5
# Create a variable-length column-store table with really big gaps in the
# namespace. If this runs in less-than-glacial time, it's working.
def test_column_store_gap(self):
uri = 'table:gap'
# Initially just create tables.
ds = SimpleDataSet(self, uri, 0, key_format='r')
ds.populate()
cursor = self.session.open_cursor(uri, None, None)
Reported by Pylint.
Line: 65
Column: 9
def test_column_store_gap(self):
uri = 'table:gap'
# Initially just create tables.
ds = SimpleDataSet(self, uri, 0, key_format='r')
ds.populate()
cursor = self.session.open_cursor(uri, None, None)
self.nentries = 0
# Create a column-store table with large gaps in the name-space.
Reported by Pylint.
Line: 71
Column: 9
self.nentries = 0
# Create a column-store table with large gaps in the name-space.
v = [ 1000, 2000000000000, 30000000000000 ]
for i in v:
cursor[ds.key(i)] = ds.value(i)
self.nentries += 1
# In-memory cursor forward, backward.
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/3rdparty/testtools-0.9.34/testtools/content.py
18 issues
Line: 22
Column: 1
import sys
import traceback
from extras import try_import
from testtools.compat import (
_b,
_format_exception_only,
_format_stack_list,
Reported by Pylint.
Line: 217
Column: 26
and isinstance(value, test.failureException)):
# Skip assert*() traceback levels
limit = 0
while tb and not self._is_relevant_tb_level(tb):
limit += 1
tb = tb.tb_next
prefix = _TB_HEADER
stack_lines = traceback.extract_tb(tb, limit)
Reported by Pylint.
Line: 19
Column: 1
import inspect
import json
import os
import sys
import traceback
from extras import try_import
from testtools.compat import (
Reported by Pylint.
Line: 106
Column: 61
no charset parameter is present in the MIME type. (This is somewhat
arbitrary, but consistent with RFC2617 3.7.1).
:raises ValueError: If the content type is not text/\*.
"""
if self.content_type.type != "text":
raise ValueError("Not a text type %r" % self.content_type)
return self._iter_text()
Reported by Pylint.
Line: 118
Column: 17
try:
# 2.5+
decoder = codecs.getincrementaldecoder(encoding)()
for bytes in self.iter_bytes():
yield decoder.decode(bytes)
final = decoder.decode(_b(''), True)
if final:
yield final
except AttributeError:
Reported by Pylint.
Line: 217
Column: 26
and isinstance(value, test.failureException)):
# Skip assert*() traceback levels
limit = 0
while tb and not self._is_relevant_tb_level(tb):
limit += 1
tb = tb.tb_next
prefix = _TB_HEADER
stack_lines = traceback.extract_tb(tb, limit)
Reported by Pylint.
Line: 62
Column: 1
chunk = stream.read(chunk_size)
class Content(object):
"""A MIME-like Content object.
Content objects can be serialised to bytes using the iter_bytes method.
If the Content-Type is recognised by other code, they are welcome to
look for richer contents that mere byte serialisation - for example in
Reported by Pylint.
Line: 165
Column: 9
value = prefix_content + \
self._stack_lines_to_unicode(stack_lines) + \
postfix_content
super(StackLinesContent, self).__init__(
content_type, lambda: [value.encode("utf8")])
def _stack_lines_to_unicode(self, stack_lines):
"""Converts a list of pre-processed stack lines into a unicode string.
"""
Reported by Pylint.
Line: 168
Column: 5
super(StackLinesContent, self).__init__(
content_type, lambda: [value.encode("utf8")])
def _stack_lines_to_unicode(self, stack_lines):
"""Converts a list of pre-processed stack lines into a unicode string.
"""
# testtools customization. When str is unicode (e.g. IronPython,
# Python 3), traceback.format_exception returns unicode. For Python 2,
Reported by Pylint.
Line: 185
Column: 1
return ''.join(msg_lines)
def TracebackContent(err, test):
"""Content object for tracebacks.
This adapts an exc_info tuple to the Content interface.
text/x-traceback;language=python is used for the mime type, in order to
provide room for other languages to format their tracebacks differently.
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_stat09.py
18 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import random
import wiredtiger, wttest
# test_stat09.py
# Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
tablename = 'test_stat09'
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import random
import wiredtiger, wttest
# test_stat09.py
# Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
tablename = 'test_stat09'
Reported by Pylint.
Line: 63
Column: 13
found = False
foundval = 0
for id, desc, valstr, val in statcursor:
if desc == lookfor:
found = True
foundval = val
self.printVerbose(2, ' stat: \'' + desc + '\', \'' +
valstr + '\', ' + str(val))
Reported by Pylint.
Line: 63
Column: 13
found = False
foundval = 0
for id, desc, valstr, val in statcursor:
if desc == lookfor:
found = True
foundval = val
self.printVerbose(2, ' stat: \'' + desc + '\', \'' +
valstr + '\', ' + str(val))
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.
import random
import wiredtiger, wttest
# test_stat09.py
# Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
tablename = 'test_stat09'
Reported by Pylint.
Line: 34
Column: 1
# test_stat09.py
# Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
tablename = 'test_stat09'
uri = 'table:' + tablename
conn_config = 'statistics=(all)'
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 34
Column: 1
# test_stat09.py
# Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
tablename = 'test_stat09'
uri = 'table:' + tablename
conn_config = 'statistics=(all)'
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 41
Column: 5
session_config = 'isolation=snapshot'
# Check the oldest active read statistic to be at the expected values
def check_stat_oldest_read(self, statcursor, expected_oldest, all_committed):
self.check_stats(statcursor, expected_oldest,
'transaction: transaction read timestamp of the oldest active reader')
# If the active oldest timestamp is 0, it implies there are no active readers,
# the pinned range because of them is expected to be 0 in that case
Reported by Pylint.
Line: 57
Column: 5
# Do a quick check of the entries in the stats cursor, the "lookfor"
# string should appear with the exact val of "expected_val".
def check_stats(self, statcursor, expected_val, lookfor):
# Reset the cursor, we're called multiple times.
statcursor.reset()
found = False
foundval = 0
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_home.py
18 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os
import wiredtiger, wttest
# test_isnew
# database is-new method
class test_isnew(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os
import wiredtiger, wttest
# test_isnew
# database is-new method
class test_isnew(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 39
Column: 9
# Test is-new of a connection.
def test_isnew(self):
# We just created a connection, is_new should return True.
self.assertEquals(self.conn.is_new(), True)
# Close and re-open the connection, is_new should return False.
self.conn.close()
self.conn = self.setUpConnectionOpen(".")
self.assertEquals(self.conn.is_new(), False)
Reported by Pylint.
Line: 44
Column: 9
# Close and re-open the connection, is_new should return False.
self.conn.close()
self.conn = self.setUpConnectionOpen(".")
self.assertEquals(self.conn.is_new(), False)
# test_gethome
# database get-home method
class test_gethome(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 52
Column: 9
# Test gethome of a connection, the initially created one is ".".
def test_gethome_default(self):
self.assertEquals(self.conn.get_home(), '.')
# Create a new database directory, open it and check its name.
def test_gethome_new(self):
name = 'new_database'
os.mkdir(name)
Reported by Pylint.
Line: 60
Column: 9
os.mkdir(name)
self.conn.close()
self.conn = self.setUpConnectionOpen(name)
self.assertEquals(self.conn.get_home(), name)
# test_base_config
# test base configuration file config.
class test_base_config(wttest.WiredTigerTestCase):
def test_base_config(self):
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.
import os
import wiredtiger, wttest
# test_isnew
# database is-new method
class test_isnew(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 34
Column: 1
# test_isnew
# database is-new method
class test_isnew(wttest.WiredTigerTestCase):
# Test is-new of a connection.
def test_isnew(self):
# We just created a connection, is_new should return True.
self.assertEquals(self.conn.is_new(), True)
Reported by Pylint.
Line: 34
Column: 1
# test_isnew
# database is-new method
class test_isnew(wttest.WiredTigerTestCase):
# Test is-new of a connection.
def test_isnew(self):
# We just created a connection, is_new should return True.
self.assertEquals(self.conn.is_new(), True)
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_jsondump01.py
18 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
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, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
Reported by Pylint.
Line: 115
Column: 9
dumpin.close()
# spot check
configs = tables[uri][0]
data = tables[uri][1]["data"]
d = data[24]
if 'column5' in d:
self.assertEqual(d['column5'], '25: abcde')
else:
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, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
Reported by Pylint.
Line: 40
Column: 1
# A 'fake' cursor based on a set of rows.
# It emulates a WT cursor well enough for the *_check_cursor methods.
# They just need an iterable object.
class FakeCursor:
def __init__(self, uri, keyfmt, valuefmt, rows):
self.uri = uri
self.key_format = keyfmt
self.value_format = valuefmt
self.rows = rows
Reported by Pylint.
Line: 54
Column: 5
def __next__(self):
return self.next()
def next(self):
if self.pos >= len(self.rows):
raise StopIteration
else:
row = self.rows[self.pos]
self.pos += 1
Reported by Pylint.
Line: 55
Column: 9
return self.next()
def next(self):
if self.pos >= len(self.rows):
raise StopIteration
else:
row = self.rows[self.pos]
self.pos += 1
tup = []
Reported by Pylint.