summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-12-01 17:25:55 -0500
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-12-02 09:25:55 +1100
commit1f8860ea54b4ef6e8bcb88692e3b26ac3dbbae64 (patch)
tree5cbfa28e1ecab5cbf81fd656384b92436d8c51c6
parent13215e81fc45a12b0ec391b7f9f691180f125af6 (diff)
downloadmongo-1f8860ea54b4ef6e8bcb88692e3b26ac3dbbae64.tar.gz
WT-3048 WiredTiger maximum size warning uses the wrong format. (#3164)
Also force the type of WT_BTREE_MAX_OBJECT_SIZE, there's no guarantee all systems will consistently declare UINT32_MAX.
-rwxr-xr-xdist/s_void5
-rw-r--r--src/btree/bt_cursor.c2
-rw-r--r--src/include/btree.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/dist/s_void b/dist/s_void
index 16684e962e6..06111245fe2 100755
--- a/dist/s_void
+++ b/dist/s_void
@@ -5,7 +5,8 @@ trap 'rm -f $t' 0 1 2 3 13 15
cd ..
-# Turn a C file into a line per function that returns an int.
+# Parse a C file, discarding functions that don't return an int, and formatting
+# the remaining functions as a single line.
file_parse()
{
sed -n \
@@ -109,7 +110,7 @@ func_ok()
}
# Complain about functions which return an "int" but which don't return except
-# at the end of the function. This script is a kluge and isn't run by default.
+# at the end of the function.
for f in `find bench ext src test -name '*.[ci]'`; do
if expr "$f" : '.*/windows_shim.c' > /dev/null; then
continue
diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c
index a996b21f7ce..650289f2cd8 100644
--- a/src/btree/bt_cursor.c
+++ b/src/btree/bt_cursor.c
@@ -41,7 +41,7 @@ __cursor_size_chk(WT_SESSION_IMPL *session, WT_ITEM *kv)
if (kv->size > WT_BTREE_MAX_OBJECT_SIZE)
WT_RET_MSG(session, EINVAL,
"item size of %" WT_SIZET_FMT " exceeds the maximum "
- "supported WiredTiger size of %d",
+ "supported WiredTiger size of %" PRIu32,
kv->size, WT_BTREE_MAX_OBJECT_SIZE);
/* Check what the block manager can actually write. */
diff --git a/src/include/btree.h b/src/include/btree.h
index 0e0f7b4c40a..595afc453c8 100644
--- a/src/include/btree.h
+++ b/src/include/btree.h
@@ -44,7 +44,7 @@
* Record numbers are stored in 64-bit unsigned integers, meaning the largest
* record number is "really, really big".
*/
-#define WT_BTREE_MAX_OBJECT_SIZE (UINT32_MAX - 1024)
+#define WT_BTREE_MAX_OBJECT_SIZE ((uint32_t)(UINT32_MAX - 1024))
/*
* A location in a file is a variable-length cookie, but it has a maximum size