From c03da2a6212a0fc6ce55b7a0ba62a12177072688 Mon Sep 17 00:00:00 2001 From: Etienne Petrel Date: Tue, 7 Feb 2023 03:53:14 +0000 Subject: Import wiredtiger: 3e8c3bdd675df363540399db8c4e3b409db95bd8 from branch mongodb-master ref: e32dbb148b..3e8c3bdd67 for: 6.3.0-rc0 Revert "WT-10140 Add a new API to retrieve record count of a table" --- src/third_party/wiredtiger/dist/api_data.py | 2 - src/third_party/wiredtiger/import.data | 2 +- .../wiredtiger/lang/python/wiredtiger.i | 6 -- src/third_party/wiredtiger/src/config/config_def.c | 1 - src/third_party/wiredtiger/src/include/config.h | 69 +++++++++++----------- src/third_party/wiredtiger/src/include/extern.h | 2 - .../wiredtiger/src/include/wiredtiger.in | 10 ---- .../wiredtiger/src/session/session_api.c | 48 ++------------- .../wiredtiger/test/suite/test_count01.py | 49 --------------- 9 files changed, 39 insertions(+), 150 deletions(-) delete mode 100644 src/third_party/wiredtiger/test/suite/test_count01.py diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py index f226bc005fd..b32f4b331c2 100644 --- a/src/third_party/wiredtiger/dist/api_data.py +++ b/src/third_party/wiredtiger/dist/api_data.py @@ -1305,8 +1305,6 @@ methods = { type='int'), ]), -'WT_SESSION.count' : Method([]), - 'WT_SESSION.create' : Method(file_config + lsm_config + tiered_config + source_meta + index_only_config + table_only_config + [ Config('exclusive', 'false', r''' diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 2ed0baeae56..83f6f45a5a0 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "e32dbb148b3eeaa82bb5378027428c037eb668c6" + "commit": "3e8c3bdd675df363540399db8c4e3b409db95bd8" } diff --git a/src/third_party/wiredtiger/lang/python/wiredtiger.i b/src/third_party/wiredtiger/lang/python/wiredtiger.i index bae0d66298f..1a4f8a269f1 100644 --- a/src/third_party/wiredtiger/lang/python/wiredtiger.i +++ b/src/third_party/wiredtiger/lang/python/wiredtiger.i @@ -30,7 +30,6 @@ * wiredtiger.i * The SWIG interface file defining the wiredtiger python API. */ -%include %include %define DOCSTRING @@ -322,11 +321,6 @@ from packing import pack, unpack %typemap(out) uint64_t { $result = PyLong_FromUnsignedLongLong($1); } -%typemap(out) int64_t { - $result = PyLong_FromLongLong($1); -} - -%pointer_class(int64_t, int64_t_ptr); /* Internal _set_key, _set_value methods take a 'bytes' object as parameter. */ %pybuffer_binary(unsigned char *data, int); diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c index dd029a63472..f9b6b3472c6 100644 --- a/src/third_party/wiredtiger/src/config/config_def.c +++ b/src/third_party/wiredtiger/src/config/config_def.c @@ -1294,7 +1294,6 @@ static const WT_CONFIG_ENTRY config_entries[] = {{"WT_CONNECTION.add_collator", "sync=", confchk_WT_SESSION_commit_transaction, 4}, {"WT_SESSION.compact", "timeout=1200", confchk_WT_SESSION_compact, 1}, - {"WT_SESSION.count", "", NULL, 0}, {"WT_SESSION.create", "access_pattern_hint=none,allocation_size=4KB,app_metadata=," "assert=(commit_timestamp=none,durable_timestamp=none," diff --git a/src/third_party/wiredtiger/src/include/config.h b/src/third_party/wiredtiger/src/include/config.h index eb70ad92195..a876e858bba 100644 --- a/src/third_party/wiredtiger/src/include/config.h +++ b/src/third_party/wiredtiger/src/include/config.h @@ -90,41 +90,40 @@ struct __wt_config_parser_impl { #define WT_CONFIG_ENTRY_WT_SESSION_close 21 #define WT_CONFIG_ENTRY_WT_SESSION_commit_transaction 22 #define WT_CONFIG_ENTRY_WT_SESSION_compact 23 -#define WT_CONFIG_ENTRY_WT_SESSION_count 24 -#define WT_CONFIG_ENTRY_WT_SESSION_create 25 -#define WT_CONFIG_ENTRY_WT_SESSION_drop 26 -#define WT_CONFIG_ENTRY_WT_SESSION_flush_tier 27 -#define WT_CONFIG_ENTRY_WT_SESSION_join 28 -#define WT_CONFIG_ENTRY_WT_SESSION_log_flush 29 -#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 30 -#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 31 -#define WT_CONFIG_ENTRY_WT_SESSION_prepare_transaction 32 -#define WT_CONFIG_ENTRY_WT_SESSION_query_timestamp 33 -#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 34 -#define WT_CONFIG_ENTRY_WT_SESSION_rename 35 -#define WT_CONFIG_ENTRY_WT_SESSION_reset 36 -#define WT_CONFIG_ENTRY_WT_SESSION_reset_snapshot 37 -#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 38 -#define WT_CONFIG_ENTRY_WT_SESSION_salvage 39 -#define WT_CONFIG_ENTRY_WT_SESSION_strerror 40 -#define WT_CONFIG_ENTRY_WT_SESSION_timestamp_transaction 41 -#define WT_CONFIG_ENTRY_WT_SESSION_timestamp_transaction_uint 42 -#define WT_CONFIG_ENTRY_WT_SESSION_truncate 43 -#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 44 -#define WT_CONFIG_ENTRY_WT_SESSION_verify 45 -#define WT_CONFIG_ENTRY_colgroup_meta 46 -#define WT_CONFIG_ENTRY_file_config 47 -#define WT_CONFIG_ENTRY_file_meta 48 -#define WT_CONFIG_ENTRY_index_meta 49 -#define WT_CONFIG_ENTRY_lsm_meta 50 -#define WT_CONFIG_ENTRY_object_meta 51 -#define WT_CONFIG_ENTRY_table_meta 52 -#define WT_CONFIG_ENTRY_tier_meta 53 -#define WT_CONFIG_ENTRY_tiered_meta 54 -#define WT_CONFIG_ENTRY_wiredtiger_open 55 -#define WT_CONFIG_ENTRY_wiredtiger_open_all 56 -#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 57 -#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 58 +#define WT_CONFIG_ENTRY_WT_SESSION_create 24 +#define WT_CONFIG_ENTRY_WT_SESSION_drop 25 +#define WT_CONFIG_ENTRY_WT_SESSION_flush_tier 26 +#define WT_CONFIG_ENTRY_WT_SESSION_join 27 +#define WT_CONFIG_ENTRY_WT_SESSION_log_flush 28 +#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 29 +#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 30 +#define WT_CONFIG_ENTRY_WT_SESSION_prepare_transaction 31 +#define WT_CONFIG_ENTRY_WT_SESSION_query_timestamp 32 +#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 33 +#define WT_CONFIG_ENTRY_WT_SESSION_rename 34 +#define WT_CONFIG_ENTRY_WT_SESSION_reset 35 +#define WT_CONFIG_ENTRY_WT_SESSION_reset_snapshot 36 +#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 37 +#define WT_CONFIG_ENTRY_WT_SESSION_salvage 38 +#define WT_CONFIG_ENTRY_WT_SESSION_strerror 39 +#define WT_CONFIG_ENTRY_WT_SESSION_timestamp_transaction 40 +#define WT_CONFIG_ENTRY_WT_SESSION_timestamp_transaction_uint 41 +#define WT_CONFIG_ENTRY_WT_SESSION_truncate 42 +#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 43 +#define WT_CONFIG_ENTRY_WT_SESSION_verify 44 +#define WT_CONFIG_ENTRY_colgroup_meta 45 +#define WT_CONFIG_ENTRY_file_config 46 +#define WT_CONFIG_ENTRY_file_meta 47 +#define WT_CONFIG_ENTRY_index_meta 48 +#define WT_CONFIG_ENTRY_lsm_meta 49 +#define WT_CONFIG_ENTRY_object_meta 50 +#define WT_CONFIG_ENTRY_table_meta 51 +#define WT_CONFIG_ENTRY_tier_meta 52 +#define WT_CONFIG_ENTRY_tiered_meta 53 +#define WT_CONFIG_ENTRY_wiredtiger_open 54 +#define WT_CONFIG_ENTRY_wiredtiger_open_all 55 +#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 56 +#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 57 /* * configuration section: END * DO NOT EDIT: automatically built by dist/flags.py. diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index a27bc23eb22..1c56ccc7538 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -1455,8 +1455,6 @@ extern int __wt_session_compact_readonly(WT_SESSION *wt_session, const char *uri const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_session_copy_values(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_session_count(WT_SESSION *wt_session, const char *uri, int64_t *count) - WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_session_create(WT_SESSION_IMPL *session, const char *uri, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_session_cursor_cache_sweep(WT_SESSION_IMPL *session, bool big_sweep) diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index 721fd4b9e30..990f7333865 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -1975,16 +1975,6 @@ struct __wt_session { */ int __F(timestamp_transaction_uint)(WT_SESSION *session, WT_TS_TXN_TYPE which, uint64_t ts); - - /*! - * Returns the number of records in the table. - * - * @param session the session handle - * @param uri the URI of the table, such as \c "table:old" - * @param count the number of records in the table - * @errors - */ - int __F(count)(WT_SESSION *session, const char *uri, int64_t *count); /*! @} */ /*! diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c index a6fa29dc8d0..b2881ab09c4 100644 --- a/src/third_party/wiredtiger/src/session/session_api.c +++ b/src/third_party/wiredtiger/src/session/session_api.c @@ -870,45 +870,6 @@ err: API_END_RET(session, ret); } -/* - * __wt_session_count -- - * WT_SESSION->count method. - */ -int -__wt_session_count(WT_SESSION *wt_session, const char *uri, int64_t *count) -{ - WT_DECL_RET; - - WT_UNUSED(uri); - WT_UNUSED(wt_session); - - *count = -1; - if (*count == -1) - ret = WT_NOTFOUND; - - return (ret); -} - -/* - * __wt_session_count_notsup -- - * WT_SESSION->count method; not supported version. - */ -static int -__wt_session_count_notsup(WT_SESSION *wt_session, const char *uri, int64_t *count) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(uri); - WT_UNUSED(count); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, count); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - /* * __wt_session_create -- * Internal version of WT_SESSION::create. @@ -2425,9 +2386,8 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const __session_truncate, __session_upgrade, __session_verify, __session_begin_transaction, __session_commit_transaction, __session_prepare_transaction, __session_rollback_transaction, __session_query_timestamp, __session_timestamp_transaction, - __session_timestamp_transaction_uint, __wt_session_count, __session_checkpoint, - __session_reset_snapshot, __session_transaction_pinned_range, __session_get_rollback_reason, - __wt_session_breakpoint}, + __session_timestamp_transaction_uint, __session_checkpoint, __session_reset_snapshot, + __session_transaction_pinned_range, __session_get_rollback_reason, __wt_session_breakpoint}, stds_min = {NULL, NULL, __session_close, __session_reconfigure_notsup, __session_flush_tier_readonly, __wt_session_strerror, __session_open_cursor, __session_alter_readonly, __session_create_readonly, __wt_session_compact_readonly, @@ -2438,7 +2398,7 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const __session_commit_transaction_notsup, __session_prepare_transaction_readonly, __session_rollback_transaction_notsup, __session_query_timestamp_notsup, __session_timestamp_transaction_notsup, __session_timestamp_transaction_uint_notsup, - __wt_session_count_notsup, __session_checkpoint_readonly, __session_reset_snapshot_notsup, + __session_checkpoint_readonly, __session_reset_snapshot_notsup, __session_transaction_pinned_range_notsup, __session_get_rollback_reason, __wt_session_breakpoint}, stds_readonly = {NULL, NULL, __session_close, __session_reconfigure, @@ -2450,7 +2410,7 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const __session_verify, __session_begin_transaction, __session_commit_transaction, __session_prepare_transaction_readonly, __session_rollback_transaction, __session_query_timestamp, __session_timestamp_transaction, - __session_timestamp_transaction_uint, __wt_session_count, __session_checkpoint_readonly, + __session_timestamp_transaction_uint, __session_checkpoint_readonly, __session_reset_snapshot, __session_transaction_pinned_range, __session_get_rollback_reason, __wt_session_breakpoint}; WT_DECL_RET; diff --git a/src/third_party/wiredtiger/test/suite/test_count01.py b/src/third_party/wiredtiger/test/suite/test_count01.py deleted file mode 100644 index 3ddd127d162..00000000000 --- a/src/third_party/wiredtiger/test/suite/test_count01.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/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 -# binary, for any purpose, commercial or non-commercial, and by any -# means. -# -# In jurisdictions that recognize copyright laws, the author or authors -# of this software dedicate any and all copyright interest in the -# software to the public domain. We make this dedication for the benefit -# of the public at large and to the detriment of our heirs and -# successors. We intend this dedication to be an overt act of -# relinquishment in perpetuity of all present and future rights to this -# software under copyright law. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -# test_count01.py -# Tests WT_SESSION->count -# - -import wiredtiger, wttest - -class test_count01(wttest.WiredTigerTestCase): - tablename = 'test_count01' - uri = 'table:' + tablename - - def test_count_api(self): - self.session.create(self.uri, 'key_format=i,value_format=i') - - count = wiredtiger.int64_t_ptr() - self.assertRaisesException( - wiredtiger.WiredTigerError, lambda: self.session.count(self.uri, count)) - self.assertEqual(count.value(), -1) - - -if __name__ == '__main__': - wttest.run() -- cgit v1.2.1