summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_join01.py
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2016-03-25 14:04:02 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-03-25 14:04:59 -0400
commit224299a6712196228b65831b6c39498caf8669d2 (patch)
treeec53aea93acb1ca4c82a33de801e1f1dd9f81fdd /src/third_party/wiredtiger/test/suite/test_join01.py
parent9df2d7019d88632d98cdfb05c807881691114bff (diff)
downloadmongo-224299a6712196228b65831b6c39498caf8669d2.tar.gz
Import wiredtiger-wiredtiger-2.7.0-1181-g43e885a.tar.gz from wiredtiger branch mongodb-3.2
ref: 5cdd3e3..43e885a SERVER-22676 WiredTiger fails to open databases created by 3.0.0 or 3.0.1 SERVER-22773 gle_shell_server5441.js fails on ppc64le SERVER-22784 Coverity analysis defect 77722: Unused value SERVER-22831 Low query rate with heavy cache pressure and an idle collection SERVER-23040 Coverity analysis defect 98151: Dereference after null check SERVER-23203 WiredTiger changes for MongoDB 3.2.5 WT-2107 Add example code including an event handler WT-2123 Don't clear allocated memory if not required WT-2173 test/format cache stuck full WT-2264 Checkpoints cannot keep up with inserts WT-2280 Add CRC32 Optimized code for PPC64LE WT-2295 WT_SESSION.create does a full-scan of the main table WT-2318 Configurable thread wake up time WT-2322 Join cursor with isolation read-uncommitted may give different results with Bloom filters WT-2345 Evicting tiny pages creates small pages on disk WT-2346 Don't hold schema lock during checkpoint I/O WT-2349 Add ability to open databases read-only WT-2361 column-store starting record number error WT-2366 Extend wtperf to support updates that grow the record size WT-2367 WT_CURSOR.next out-of-order returns failure WT-2374 read error on index file WT-2375 Need tests for collators WT-2376 Modules should compile without including wt_internal.h header file WT-2381 dump utility discards table config WT-2382 Problem with custom collator for 'u' format with join cursor WT-2384 lt, le conditions for ordering cursor in join cursor WT-2387 Fix cursor random unit test on Windows WT-2390 OS X build is broken WT-2391 De-prioritize eviction from indexes WT-2393 Unnecessary error handling labels. WT-2394 Long Unit Test for test_compact02 failed. WT-2395 Recovery failure with an LSM tree WT-2396 Jenkins Spinlock GCC task Hung WT-2397 Cursor traversal from end of the tree skips records. WT-2399 Add test case that verifies cursor traversal WT-2404 Add streaming pack/unpack methods to the extension API WT-2405 test utility error handling. WT-2406 cursor_order lint, minor bug fixes WT-2407 recovery lint WT-2409 Minor Perf Regression in LSM WT-2410 Casting function pointers to different types WT-2411 LSM drop hang WT-2412 Truncate error tag is incorrect WT-2414 Avoid extractor calls for ordering cursor in join cursor WT-2417 Windows Jenkins task is failing WT-2418 test_rebalance failing with EBUSY WT-2419 Tests fail to compile on windows due to new util functions WT-2420 LSM failed to read bytes WT-2421 test_bloom ret assigned but not used WT-2422 multiple definitions of custom die function WT-2423 Session reference count could be wrong if adding the handle fails WT-2425 evict-btree read through performance drop WT-2426 Deadlock caused by recent changes to checkpoint handle locking WT-2427 wtperf should work with builtin compression WT-2428 Make statistics logging compatible with MongoDB WT-2429 Add a statistic that tracks aggressive mode in eviction WT-2430 statistic for join cursor WT-2431 Join statistics documentation needed WT-2432 Understand eviction impact on LSM and readonly workload WT-2433 Allow read-only databases to log statistics WT-2434 Race between force-drop and sweep WT-2435 __wt_evict_file_exclusive_on/off cleanups WT-2436 lt, le conditions for ref cursor with "strategy=bloom" in join cursor WT-2437 Test suite failures on Windows WT-2438 Extend WiredTiger stat declarations to help timeseries tool WT-2440 vpmsum_crc32: Per the PPC64 ABI, v20-v31 are non-volatile register WT-2443 Getting statistic for all indexes used in join cursor WT-2444 broken flag test in wtperf, whitespace WT-2447 join cursor reads main table WT-2448 Add no_scale flag to relevant statistics WT-2449 configure should check for a 64-bit build WT-2451 Allow eviction of metadata WT-2454 checkpoint_sync=false does *not* prevent flushes/sync to disk. WT-2456 Update Power8 CRC32 Code WT-2457 Dropping an LSM table can fail with EBUSY when no user ops are active WT-2459 Allow Configure scripts to provide the --tag option for libtool when compiling on PPC WT-2460 checkpoint failing with WT_ROLLBACK WT-2461 sweep01 failing WT-2463 Test that measures idle CPU usage fails under valgrind WT-2464 Valgrind errors. WT-2465 Coverity 1352899: Dereference before null check WT-2466 Coverity 1352893 Buffer not null terminated WT-2467 Coverity 1352894: Logically dead code WT-2468 Coverity 1352896: Explicit null dereferenced WT-2469 Coverity 1352897: Integer overflowed argument WT-2470 Coverity 1352898: Resource leak WT-2471 review WiredTiger "int" printf formats WT-2473 MSVC doesn't support PRId64 WT-2475 Have reconf script remove cached configure results WT-2476 btree->evict_lock is being accessed after being destroyed WT-2477 Missing define in Windows wiredtiger_config.h WT-2478 Valgrind test failures WT-2481 Recent changes affect LSM performance WT-2482 Coverity 1353015, 1353016, out-of-bounds access WT-2483 readonly02 periodically fails WT-2484 Coverity 1345809: unchecked return value WT-2485 Test/format failure with Floating point exception WT-2487 Release memory in manydbs test WT-2489 warnings from /test/manydbs WT-2490 search_near() returns wrong key for column-store WT-2492 Windows test_config04.test_config04.test_invalid_config crashes WT-2493 verbose lsm_manager unsupported WT-2494 review calls to __wt_free, plus minor bug in an error path. WT-2495 Missing memory initialization leads to crash on Windows WT-2496 test/format unable to read root page WT-2497 test/format saves copy of backup WT-2498 LSM tree drop hangs when a user cursor is open WT-2499 LSM shutdown race causes segfault WT-2501 Dropping a just opened LSM tree isn't safe WT-2502 memory leak in locking handles for checkpoint WT-2503 build warning in lsm_tree.c WT-2506 Using an uninitialised value
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_join01.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_join01.py81
1 files changed, 62 insertions, 19 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_join01.py b/src/third_party/wiredtiger/test/suite/test_join01.py
index f03c7c6f06c..4aa2bc6e269 100644
--- a/src/third_party/wiredtiger/test/suite/test_join01.py
+++ b/src/third_party/wiredtiger/test/suite/test_join01.py
@@ -33,7 +33,6 @@ from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
# Join operations
# Basic tests for join
class test_join01(wttest.WiredTigerTestCase):
- table_name1 = 'test_join01'
nentries = 100
scenarios = [
@@ -75,8 +74,18 @@ class test_join01(wttest.WiredTigerTestCase):
# the join cursor and iterating again.
def stats(self, jc, which):
statcur = self.session.open_cursor('statistics:join', jc, None)
- self.check_stats(statcur, 0, 'join: index:join01:index1: ' +
- 'bloom filter false positives')
+ # pick a stat we always expect to see
+ statdesc = 'bloom filter false positives'
+ expectstats = [
+ 'join: index:join01:index1: ' + statdesc,
+ 'join: index:join01:index2: ' + statdesc ]
+ if self.ref == 'index':
+ expectstats.append('join: index:join01:index0: ' + statdesc)
+ else:
+ expectstats.append('join: table:join01: ' + statdesc)
+ self.check_stats(statcur, expectstats)
+ statcur.reset()
+ self.check_stats(statcur, expectstats)
statcur.close()
def statstr_to_int(self, str):
@@ -87,16 +96,14 @@ class test_join01(wttest.WiredTigerTestCase):
parts = str.rpartition('(')
return int(parts[2].rstrip(')'))
- # string should appear with a minimum value of least "min".
- def check_stats(self, statcursor, min, lookfor):
+ # All of the expect strings should appear
+ def check_stats(self, statcursor, expectstats):
stringclass = ''.__class__
intclass = (0).__class__
# Reset the cursor, we're called multiple times.
statcursor.reset()
- found = False
- foundval = 0
self.printVerbose(3, 'statistics:')
for id, desc, valstr, val in statcursor:
self.assertEqual(type(desc), stringclass)
@@ -105,12 +112,11 @@ class test_join01(wttest.WiredTigerTestCase):
self.assertEqual(val, self.statstr_to_int(valstr))
self.printVerbose(3, ' stat: \'' + desc + '\', \'' +
valstr + '\', ' + str(val))
- if desc == lookfor:
- found = True
- foundval = val
+ if desc in expectstats:
+ expectstats.remove(desc)
- self.assertTrue(found, 'in stats, did not see: ' + lookfor)
- self.assertTrue(foundval >= min)
+ self.assertTrue(len(expectstats) == 0,
+ 'missing expected values in stats: ' + str(expectstats))
# Common function for testing the most basic functionality
# of joins
@@ -142,7 +148,8 @@ class test_join01(wttest.WiredTigerTestCase):
# and examine primary keys 2,5,8,...,95,98,1,4,7,...,94,97.
jc = self.session.open_cursor('join:table:join01' + proj_suffix,
None, None)
- c2 = self.session.open_cursor('index:join01:index2', None, None)
+ # Adding a projection to a reference cursor should be allowed.
+ c2 = self.session.open_cursor('index:join01:index2(v1)', None, None)
c2.set_key(99) # skips all entries w/ primary key divisible by three
self.assertEquals(0, c2.search())
self.session.join(jc, c2, 'compare=gt')
@@ -160,12 +167,12 @@ class test_join01(wttest.WiredTigerTestCase):
# Then select all numbers whose reverse string representation
# is in '20' < x < '40'.
- c1a = self.session.open_cursor('index:join01:index1', None, None)
+ c1a = self.session.open_cursor('index:join01:index1(v1)', None, None)
c1a.set_key('21')
self.assertEquals(0, c1a.search())
self.session.join(jc, c1a, 'compare=gt' + joincfg1)
- c1b = self.session.open_cursor('index:join01:index1', None, None)
+ c1b = self.session.open_cursor('index:join01:index1(v1)', None, None)
c1b.set_key('41')
self.assertEquals(0, c1b.search())
self.session.join(jc, c1b, 'compare=lt' + joincfg1)
@@ -342,11 +349,12 @@ class test_join01(wttest.WiredTigerTestCase):
'/index cursor is being used in a join/')
# Only a small number of operations allowed on a join cursor
- self.assertRaises(wiredtiger.WiredTigerError,
- lambda: jc.search())
+ msg = "/Unsupported cursor/"
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: jc.search(), msg)
- self.assertRaises(wiredtiger.WiredTigerError,
- lambda: jc.prev())
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: jc.prev(), msg)
self.assertEquals(jc.next(), 0)
self.assertEquals(jc.next(), wiredtiger.WT_NOTFOUND)
@@ -390,6 +398,7 @@ class test_join01(wttest.WiredTigerTestCase):
def test_cursor_close2(self):
self.cursor_close_common(False)
+ # test statistics using the framework set up for this test
def test_stats(self):
bloomcfg1000 = ',strategy=bloom,count=1000'
bloomcfg10 = ',strategy=bloom,count=10'
@@ -399,6 +408,40 @@ class test_join01(wttest.WiredTigerTestCase):
# statistics should pick up some false positives.
self.join_common(bloomcfg10, bloomcfg10, False, True)
+ # test statistics with a simple one index join cursor
+ def test_simple_stats(self):
+ self.session.create("table:join01b",
+ "key_format=i,value_format=i,columns=(k,v)")
+ self.session.create("index:join01b:index", "columns=(v)")
+
+ cursor = self.session.open_cursor("table:join01b", None, None)
+ cursor[1] = 11
+ cursor[2] = 12
+ cursor[3] = 13
+ cursor.close()
+
+ cursor = self.session.open_cursor("index:join01b:index", None, None)
+ cursor.set_key(11)
+ cursor.search()
+
+ jcursor = self.session.open_cursor("join:table:join01b", None, None)
+ self.session.join(jcursor, cursor, "compare=gt")
+
+ while jcursor.next() == 0:
+ [k] = jcursor.get_keys()
+ [v] = jcursor.get_values()
+
+ statcur = self.session.open_cursor("statistics:join", jcursor, None)
+ found = False
+ while statcur.next() == 0:
+ [desc, pvalue, value] = statcur.get_values()
+ #self.tty(str(desc) + "=" + str(pvalue))
+ found = True
+ self.assertEquals(found, True)
+
+ jcursor.close()
+ cursor.close()
+
if __name__ == '__main__':
wttest.run()