0002-src-mongo-db-exec-plan_stats.h-fix-build-with-gcc-11.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 0941e560850d54160c24778fa66b605714fd5012 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 9 Aug 2021 21:18:50 +0200
  4. Subject: [PATCH] src/mongo/db/exec/plan_stats.h: fix build with gcc
  5. 11
  6. Fix the following build failure with gcc 11:
  7. In file included from src/mongo/db/query/plan_cache.h:36,
  8. from src/mongo/db/catalog/collection_info_cache.h:33,
  9. from src/mongo/db/catalog/collection.h:42,
  10. from src/mongo/db/exec/requires_collection_stage.h:32,
  11. from src/mongo/db/exec/delete.h:32,
  12. from src/mongo/db/query/internal_plans.h:33,
  13. from src/mongo/db/query/internal_plans.cpp:32:
  14. src/mongo/db/exec/plan_stats.h:214:10: error: 'optional' in namespace 'std' does not name a template type
  15. 214 | std::optional<std::string> replanReason;
  16. | ^~~~~~~~
  17. Fixes:
  18. - http://autobuild.buildroot.org/results/8c0875fa413923504515a83d8b679366418c2444
  19. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  20. [Upstream status: already fixed by
  21. https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0]
  22. ---
  23. src/mongo/db/exec/plan_stats.h | 1 +
  24. 1 file changed, 1 insertion(+)
  25. diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h
  26. index 43053e27be..813e4edc9e 100644
  27. --- a/src/mongo/db/exec/plan_stats.h
  28. +++ b/src/mongo/db/exec/plan_stats.h
  29. @@ -31,6 +31,7 @@
  30. #include <cstdint>
  31. #include <cstdlib>
  32. +#include <optional>
  33. #include <string>
  34. #include <vector>
  35. --
  36. 2.30.2