Fatal error: Uncaught mysqli_sql_exception: Out of range value for column 'category_id' at row 1 in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /srv/hfr-internal/include/functions.inc.php(533): pwg_query() #2 /srv/hfr-internal/index.php(723): pwg_log() #3 {main} thrown in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php on line 132
The problem is that the category_id type table is SMALLINT(5) SIGNED. That gives me a range of -32768 to 32767. My max category id value is 38738, so above that range.
If I am logged in as an admin I get no message, probably because pwg_log() doesn't record admin activity to the piwigo_history table? However, if I am logged in as a normal user I see the error at the bottom of the page. In addition, the thumbnail doesn't show up and I can't open the image (while everything works if I am an admin).
The solution seems somewhat simple - I just changed the attribute to UNSIGNED. I am not sure having it SIGNED confers any benefits given that half of that range is not usable for us (we don't have categories with negative category_ids). But not sure it is the optimal solution.
Hello,
I am getting this error:
Fatal error: Uncaught mysqli_sql_exception: Out of range value for column 'category_id' at row 1 in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /srv/hfr-internal/include/functions.inc.php(533): pwg_query() #2 /srv/hfr-internal/index.php(723): pwg_log() #3 {main} thrown in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php on line 132
The problem is that the category_id type table is SMALLINT(5) SIGNED. That gives me a range of -32768 to 32767. My max category id value is 38738, so above that range.
If I am logged in as an admin I get no message, probably because pwg_log() doesn't record admin activity to the piwigo_history table? However, if I am logged in as a normal user I see the error at the bottom of the page. In addition, the thumbnail doesn't show up and I can't open the image (while everything works if I am an admin).
The solution seems somewhat simple - I just changed the attribute to UNSIGNED. I am not sure having it SIGNED confers any benefits given that half of that range is not usable for us (we don't have categories with negative category_ids). But not sure it is the optimal solution.
<!-- github-sync-id:2192583181 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hello,
I am getting this error:
Fatal error: Uncaught mysqli_sql_exception: Out of range value for column 'category_id' at row 1 in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /srv/hfr-internal/include/functions.inc.php(533): pwg_query() #2 /srv/hfr-internal/index.php(723): pwg_log() #3 {main} thrown in /srv/hfr-internal/include/dblayer/functions_mysqli.inc.php on line 132
The problem is that the category_id type table is SMALLINT(5) SIGNED. That gives me a range of -32768 to 32767. My max category id value is 38738, so above that range.
If I am logged in as an admin I get no message, probably because pwg_log() doesn't record admin activity to the piwigo_history table? However, if I am logged in as a normal user I see the error at the bottom of the page. In addition, the thumbnail doesn't show up and I can't open the image (while everything works if I am an admin).
The solution seems somewhat simple - I just changed the attribute to UNSIGNED. I am not sure having it SIGNED confers any benefits given that half of that range is not usable for us (we don't have categories with negative category_ids). But not sure it is the optimal solution.