From 8493aff051e675d77d4340f0f61b63def6269848 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 10 Jun 2024 08:48:28 -0700 Subject: [PATCH 1/5] Add change log entry for #346 --- Changes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes.md b/Changes.md index cee28510..fe1b413c 100644 --- a/Changes.md +++ b/Changes.md @@ -4,6 +4,8 @@ of binaries (e.g., `mmdblookup`) with the `MAXMINDDB_BUILD_BINARIES` option and the install target generation with the `MAXMINDDB_INSTALL` option. Pull request by Seena Fallah. GitHub #342. +* CMake now makes greater use of GNUInstallDirs. Pull request by Maximilian + Downey Twiss. GitHub #346. * The reader can now lookup records on a database with a search tree that is greater than 4 gigabytes without sometimes returning erroneous results due to an integer overflow. From 19bc81a013a831599de5c42c65b12650149111f8 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 10 Jun 2024 08:49:34 -0700 Subject: [PATCH 2/5] Update test submodule --- t/maxmind-db | 2 +- t/metadata_t.c | 6 +- t/read_node_t.c | 279 +++++++++++++++++++++++++----------------------- 3 files changed, 151 insertions(+), 136 deletions(-) diff --git a/t/maxmind-db b/t/maxmind-db index 31a33b3c..880f6b4b 160000 --- a/t/maxmind-db +++ b/t/maxmind-db @@ -1 +1 @@ -Subproject commit 31a33b3c09ac53028216e82f3d8a6d33749a8df5 +Subproject commit 880f6b4b5eb6c12ea9d5c70dd201dec2cb5639a2 diff --git a/t/metadata_t.c b/t/metadata_t.c index 8acf7c73..a7e58560 100644 --- a/t/metadata_t.c +++ b/t/metadata_t.c @@ -3,8 +3,8 @@ void test_metadata(MMDB_s *mmdb, const char *mode_desc) { cmp_ok(mmdb->metadata.node_count, "==", - 37, - "node_count is 37 - %s", + 163, + "node_count is 163 - %s", mode_desc); cmp_ok(mmdb->metadata.record_size, "==", @@ -197,7 +197,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) { if (strcmp(key_name, "node_count") == 0) { MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next; - cmp_ok(value->entry_data.uint32, "==", 37, "node_count == 37"); + cmp_ok(value->entry_data.uint32, "==", 163, "node_count == 163"); } else if (strcmp(key_name, "record_size") == 0) { MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next; diff --git a/t/read_node_t.c b/t/read_node_t.c index 8941ade6..da4ec849 100644 --- a/t/read_node_t.c +++ b/t/read_node_t.c @@ -74,50 +74,55 @@ void run_24_bit_record_tests(int mode, const char *mode_desc) { MMDB_s *mmdb = open_ok(path, mode, mode_desc); free(path); - const uint32_t tests[7][5] = { - {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, - { - 80, - 81, - MMDB_RECORD_TYPE_SEARCH_NODE, - 197, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 96, - 97, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 103, - 242, - MMDB_RECORD_TYPE_EMPTY, - 104, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 127, - 242, - MMDB_RECORD_TYPE_EMPTY, - 315, - MMDB_RECORD_TYPE_DATA, - }, - { - 132, - 329, - MMDB_RECORD_TYPE_DATA, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 241, - 96, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }}; + const uint32_t tests[7][5] = {{ + 0, + 1, + MMDB_RECORD_TYPE_SEARCH_NODE, + 435, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 80, + 81, + MMDB_RECORD_TYPE_SEARCH_NODE, + 323, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 96, + 97, + MMDB_RECORD_TYPE_SEARCH_NODE, + 148, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 103, + 444, + MMDB_RECORD_TYPE_EMPTY, + 104, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 127, + 444, + MMDB_RECORD_TYPE_EMPTY, + 514, + MMDB_RECORD_TYPE_DATA, + }, + { + 132, + 527, + MMDB_RECORD_TYPE_DATA, + 444, + MMDB_RECORD_TYPE_EMPTY, + }, + { + 241, + 444, + MMDB_RECORD_TYPE_EMPTY, + 242, + MMDB_RECORD_TYPE_SEARCH_NODE, + }}; run_read_node_tests(mmdb, tests, 7, 24); MMDB_close(mmdb); @@ -130,50 +135,55 @@ void run_28_bit_record_tests(int mode, const char *mode_desc) { MMDB_s *mmdb = open_ok(path, mode, mode_desc); free(path); - const uint32_t tests[7][5] = { - {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, - { - 80, - 81, - MMDB_RECORD_TYPE_SEARCH_NODE, - 197, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 96, - 97, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 103, - 242, - MMDB_RECORD_TYPE_EMPTY, - 104, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 127, - 242, - MMDB_RECORD_TYPE_EMPTY, - 315, - MMDB_RECORD_TYPE_DATA, - }, - { - 132, - 329, - MMDB_RECORD_TYPE_DATA, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 241, - 96, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }}; + const uint32_t tests[7][5] = {{ + 0, + 1, + MMDB_RECORD_TYPE_SEARCH_NODE, + 435, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 80, + 81, + MMDB_RECORD_TYPE_SEARCH_NODE, + 323, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 96, + 97, + MMDB_RECORD_TYPE_SEARCH_NODE, + 148, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 103, + 444, + MMDB_RECORD_TYPE_EMPTY, + 104, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 127, + 444, + MMDB_RECORD_TYPE_EMPTY, + 514, + MMDB_RECORD_TYPE_DATA, + }, + { + 132, + 527, + MMDB_RECORD_TYPE_DATA, + 444, + MMDB_RECORD_TYPE_EMPTY, + }, + { + 241, + 444, + MMDB_RECORD_TYPE_EMPTY, + 242, + MMDB_RECORD_TYPE_SEARCH_NODE, + }}; run_read_node_tests(mmdb, tests, 7, 28); MMDB_close(mmdb); @@ -186,50 +196,55 @@ void run_32_bit_record_tests(int mode, const char *mode_desc) { MMDB_s *mmdb = open_ok(path, mode, mode_desc); free(path); - const uint32_t tests[7][5] = { - {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, - { - 80, - 81, - MMDB_RECORD_TYPE_SEARCH_NODE, - 197, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 96, - 97, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 103, - 242, - MMDB_RECORD_TYPE_EMPTY, - 104, - MMDB_RECORD_TYPE_SEARCH_NODE, - }, - { - 127, - 242, - MMDB_RECORD_TYPE_EMPTY, - 315, - MMDB_RECORD_TYPE_DATA, - }, - { - 132, - 329, - MMDB_RECORD_TYPE_DATA, - 242, - MMDB_RECORD_TYPE_EMPTY, - }, - { - 241, - 96, - MMDB_RECORD_TYPE_SEARCH_NODE, - 242, - MMDB_RECORD_TYPE_EMPTY, - }}; + const uint32_t tests[7][5] = {{ + 0, + 1, + MMDB_RECORD_TYPE_SEARCH_NODE, + 435, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 80, + 81, + MMDB_RECORD_TYPE_SEARCH_NODE, + 323, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 96, + 97, + MMDB_RECORD_TYPE_SEARCH_NODE, + 148, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 103, + 444, + MMDB_RECORD_TYPE_EMPTY, + 104, + MMDB_RECORD_TYPE_SEARCH_NODE, + }, + { + 127, + 444, + MMDB_RECORD_TYPE_EMPTY, + 514, + MMDB_RECORD_TYPE_DATA, + }, + { + 132, + 527, + MMDB_RECORD_TYPE_DATA, + 444, + MMDB_RECORD_TYPE_EMPTY, + }, + { + 241, + 444, + MMDB_RECORD_TYPE_EMPTY, + 242, + MMDB_RECORD_TYPE_SEARCH_NODE, + }}; run_read_node_tests(mmdb, tests, 7, 32); From 3fcb19e6e2c947ff456e18c291f333caed237b0a Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 10 Jun 2024 08:49:47 -0700 Subject: [PATCH 3/5] Set release date --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index fe1b413c..a14efa11 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,4 @@ -## 1.10.0 +## 1.10.0 - 2024-06-10 * When building with CMake, it is now possible to disable the building of binaries (e.g., `mmdblookup`) with the `MAXMINDDB_BUILD_BINARIES` From 7acfe43a72a5043d01cc3dd6429005acdf812cb3 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 10 Jun 2024 10:18:18 -0700 Subject: [PATCH 4/5] Bumped version to 1.10.0 --- CMakeLists.txt | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da3ab2a3..f8fc2ca9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.9) project(maxminddb LANGUAGES C - VERSION 1.9.1 + VERSION 1.10.0 ) set(MAXMINDDB_SOVERSION 0.0.7) set(CMAKE_C_STANDARD 99) diff --git a/configure.ac b/configure.ac index 579d3522..a56e406f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([libmaxminddb], [1.9.1], [support@maxmind.com]) +AC_INIT([libmaxminddb], [1.10.0], [support@maxmind.com]) AC_CONFIG_SRCDIR([include/maxminddb.h]) AC_CONFIG_HEADERS([config.h include/maxminddb_config.h]) From 008d6925aa1e2ffdce35347d29427b5e34b44c57 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 10 Jun 2024 10:45:44 -0700 Subject: [PATCH 5/5] Fix grammar --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index a14efa11..cddc6bb8 100644 --- a/Changes.md +++ b/Changes.md @@ -6,7 +6,7 @@ option. Pull request by Seena Fallah. GitHub #342. * CMake now makes greater use of GNUInstallDirs. Pull request by Maximilian Downey Twiss. GitHub #346. -* The reader can now lookup records on a database with a search tree +* The reader can now look up records on a database with a search tree that is greater than 4 gigabytes without sometimes returning erroneous results due to an integer overflow.