From 1f108c9cfb8912685715687d10f77bd13abb46de Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Thu, 22 Oct 2020 15:39:57 +0300 Subject: [PATCH] Limit book count in database: Add SQL notes Signed-off-by: Pekka Helenius --- .../bookstore/web/BookBasePathAwareController.java | 7 +++++++ .../java/com/fjordtek/bookstore/web/BookController.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java index cbf60db..af5c87a 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java @@ -123,6 +123,13 @@ public class BookBasePathAwareController { * In real life, this must never be a case! * Instead, we should have a proper admin-only * configuration panel where to set these values. + * + * On SQL server, consider adding the following + * configuration: + * + * ALTER TABLE BOOK MAX_ROWS=; + * + * See also: https://dev.mysql.com/doc/refman/5.7/en/table-size-limit.html */ if (webRestrictions.limitBookMaxCount("prod")) { return new ResponseEntity<>(HttpStatus.BAD_REQUEST); diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java index 04fa155..6069a06 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java @@ -209,6 +209,13 @@ public class BookController { * In real life, this must never be a case! * Instead, we should have a proper admin-only * configuration panel where to set these values. + * + * On SQL server, consider adding the following + * configuration: + * + * ALTER TABLE BOOK MAX_ROWS=; + * + * See also: https://dev.mysql.com/doc/refman/5.7/en/table-size-limit.html */ if (webRestrictions.limitBookMaxCount("prod")) { redirectAttributes.addFlashAttribute(