ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no'
Created attachment 155056 [details] [review] Bug 34684: Prevent 220600007.pl to fail if run twice The error is ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no' Happens on MariaDB 10.5.22, not MySQL 8 Test plan: update systempreferences set value="0" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "no" update systempreferences set value="1" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "issueslip"
How do you "play installer/data/mysql/db_revs/220600007.pl"? I can't run it on its own using Perl. Do we need to set Version to a particular number or something else?
(In reply to David Cook from comment #2) > How do you "play installer/data/mysql/db_revs/220600007.pl"? I can't run it > on its own using Perl. Do we need to set Version to a particular number or > something else? Run the UPDATE query that is there.
(In reply to Jonathan Druart from comment #3) > (In reply to David Cook from comment #2) > > How do you "play installer/data/mysql/db_revs/220600007.pl"? I can't run it > > on its own using Perl. Do we need to set Version to a particular number or > > something else? > > Run the UPDATE query that is there. That won't trigger the DB update though and you can't run installer/data/mysql/db_revs/220600007.pl directly. I was testing a different bug of yours after this one and I came up with a test plan that I used, so tomorrow I could look at finding that and copying it over here...
Well, the change is pretty straightforward. We just want to make sure surrounding 1 with double quote won't change the result.
You can just copy the dbrev to atomicupdate to play it again. Dont forget to remove it later.
(In reply to Jonathan Druart from comment #1) > Happens on MariaDB 10.5.22, not MySQL 8 Cannot reproduce on 10.5.19. Any pointers to do so? Specific SQL modes? Etc. Both old and new version run twice without error message.
Fresh ktd, origin/master Server version: 10.5.22-MariaDB-1:10.5.22+maria~ubu2004 mariadb.org binary distribution MariaDB [koha_kohadev]> select value from systempreferences where variable="DisplayClearScreenButton"; +-------+ | value | +-------+ | no | +-------+ 1 row in set (0.000 sec) MariaDB [koha_kohadev]> UPDATE systempreferences SET options = 'no|issueslip|issueqslip', type = 'Choice', value = CASE value WHEN 1 THEN 'issueslip' ELSE 'no' END; ERROR 1292 (22007): Truncated incorrect DECIMAL value: '' Nothing else.
Created attachment 155275 [details] [review] Bug 34684: Prevent 220600007.pl to fail if run twice The error is ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no' Happens on MariaDB 10.5.22, not MySQL 8 Test plan: update systempreferences set value="0" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "no" update systempreferences set value="1" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "issueslip" Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to Jonathan Druart from comment #8) > MariaDB [koha_kohadev]> UPDATE systempreferences SET > options = 'no|issueslip|issueqslip', type = 'Choice', > value = CASE value > WHEN 1 THEN 'issueslip' ELSE 'no' > END; Wouldnt recommend this update (without WHERE).. I see the error now too. Upgrade to 22.06.00.007 [14:34:13]: Bug 29129 - Update the DisplayClearnScreenButton system pref to allow for a choice between ISSUESLIP and ISSUEQSLIP ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Truncated incorrect DECIMAL value: 'no' at /usr/share/koha/C4/Installer.pm line 741
Created attachment 155276 [details] [review] Bug 34684: Prevent 220600007.pl to fail if run twice The error is ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no' Happens on MariaDB 10.5.22, not MySQL 8 Test plan: update systempreferences set value="0" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "no" update systempreferences set value="1" where variable="DisplayClearScreenButton"; play installer/data/mysql/db_revs/220600007.pl select value from systempreferences where variable="DisplayClearScreenButton"; => "issueslip" Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.11. Nice work everyone, thanks!
Pushed to 23.05.x for 23.05.04
Nice work everyone! Pushed to oldstable for 22.11.x