Bug 22472 - Should column_exists explode if the table does not exist?
Summary: Should column_exists explode if the table does not exist?
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-07 12:13 UTC by Jonathan Druart
Modified: 2020-06-04 20:32 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 22472: Add tests (1.24 KB, patch)
2019-03-07 12:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22472: Make column_exists early return if the table does not exist (2.36 KB, patch)
2019-03-07 12:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22472: Add tests (1.30 KB, patch)
2019-04-04 07:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22472: Make column_exists early return if the table does not exist (2.42 KB, patch)
2019-04-04 07:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22472: Add tests (1.36 KB, patch)
2019-04-08 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22472: Make column_exists early return if the table does not exist (2.48 KB, patch)
2019-04-08 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22742: FIX : RenewLoan returns correct datetime format (1.08 KB, patch)
2019-05-10 19:54 UTC, Bin Wen
Details | Diff | Splinter Review
Bug 22742: FIX : RenewLoan returns correct datetime format (1.12 KB, patch)
2019-05-10 19:55 UTC, Bin Wen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-03-07 12:13:44 UTC
See bug 18936 comment 33.
If C4::Installer::column_exists is called with a table that has been removed, the methods will print an error.

I think it should early return if the table does not exist (not an exception, we do not want to make more complex the update DB script)
Comment 1 Jonathan Druart 2019-03-07 12:27:33 UTC
Created attachment 86240 [details] [review]
Bug 22472: Add tests
Comment 2 Jonathan Druart 2019-03-07 12:27:39 UTC
Created attachment 86241 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.
Comment 3 Katrin Fischer 2019-04-04 07:25:33 UTC
Created attachment 87381 [details] [review]
Bug 22472: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-04-04 07:25:36 UTC
Created attachment 87382 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2019-04-04 07:26:46 UTC
   FAIL	  pod coverage
		POD is missing for TableExists

Is a false positive as the method was only moved in the file. I think renaming it to table_exists might be a nice clean-up, but could be done separately.
Comment 6 Martin Renvoize 2019-04-08 12:52:21 UTC
Created attachment 87512 [details] [review]
Bug 22472: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-04-08 12:52:23 UTC
Created attachment 87513 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2019-04-08 12:53:13 UTC
Sane and sensible change.. no regressions found and I agree that the function rename would be nice but can be in another bug.

Passing QA
Comment 9 Nick Clemens 2019-04-11 13:57:17 UTC
Awesome work all!

Pushed to master for 19.05
Comment 10 Martin Renvoize 2019-04-15 17:52:06 UTC
Pushed to 18.11.x for 18.11.05
Comment 11 Bin Wen 2019-05-10 19:54:22 UTC
Created attachment 89566 [details] [review]
Bug 22742: FIX : RenewLoan returns correct datetime format

Test plan :
Call RenewLoan a few times and check the date returned is correct (minute wise).

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 12 Bin Wen 2019-05-10 19:55:54 UTC
Created attachment 89567 [details] [review]
Bug 22742: FIX : RenewLoan returns correct datetime format

Test plan :
Call RenewLoan a few times and check the date returned is correct (minute wise).

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

https://bugs.koha-community.org/show_bug.cgi?id=22472