Bug 8128 - can't seem to run new sql reports
Summary: can't seem to run new sql reports
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low blocker (vote)
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 7249
  Show dependency treegraph
 
Reported: 2012-05-18 18:39 UTC by Nicole C. Engard
Modified: 2019-06-27 09:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8128 - can't seem to run new sql reports (926 bytes, patch)
2012-05-18 19:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8128 - can't seem to run new sql reports (1003 bytes, patch)
2012-05-18 19:35 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Bug 8128 - can't seem to run new sql reports (1.05 KB, patch)
2012-05-18 19:38 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 8128 - Followup - Change default value for cache_expiry (865 bytes, patch)
2012-05-22 12:22 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8128 - [SIGNED-OFF]Followup - Change default value for cache_expiry (941 bytes, patch)
2012-05-23 08:27 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-05-18 18:39:28 UTC
I'm on master. I paste this to create an sql report.

select count(*) as circs from statistics where type in ('issue','localuse') and datetime between <<Circed between (yyyy-mm-dd)>> and <<and (yyyy-mm-dd)>>

It appears to save. I click 'Run Report' at the top and get this:



Software error:

execute_query failed to return sth for report :  at /home/nengard/kohaclone/reports/guided_reports.pl line 602.

For help, please send mail to the webmaster (webmaster@debian), giving this error message and the time and date of the error.




When I go back the report did not save.
Comment 1 Kyle M Hall 2012-05-18 18:51:48 UTC
The reports aren't getting saved:


guided_reports.pl: DBD::mysql::db do failed: Column 'cache_expiry' cannot be null at /home/koha/kohaclone/C4/Reports/Guided.pm line 480., referer: http://kohadev:8080/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL
Comment 2 Kyle M Hall 2012-05-18 19:03:45 UTC Comment hidden (obsolete)
Comment 3 Nicole C. Engard 2012-05-18 19:35:27 UTC Comment hidden (obsolete)
Comment 4 Liz Rea 2012-05-18 19:38:43 UTC
Created attachment 9650 [details] [review]
Bug 8128 - can't seem to run new sql reports

Reports cannot be saved because saved_sql.cache_expiry cannot be null.
Fixed by setting default to 0 if a cache_expiry value is not
passed into the function.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes t xt

Verified original bug, patch resolves issue.
Comment 5 Magnus Enger 2012-05-18 21:53:11 UTC
I think this is related to:

Bug 7248 - Caching for services
Bug 7249 - Report webservices

The latter got pushed, but the former has gone through some iterations.
Comment 6 Jared Camins-Esakov 2012-05-18 22:07:58 UTC
(In reply to comment #5)
> I think this is related to:
> 
> Bug 7248 - Caching for services
> Bug 7249 - Report webservices
> 
> The latter got pushed, but the former has gone through some iterations.

They've both been pushed, but somewhere in the process the database update got changed. Kyle came up with a fix that doesn't require a database update, which is what Nicole and Liz signed off on.
Comment 7 Magnus Enger 2012-05-19 07:40:07 UTC
Ah, sorry, I was a bit too quick there...
Comment 8 Jonathan Druart 2012-05-22 09:07:45 UTC
Hi Kyle,
Why do you initialize the cache expiry with 0 whereas the field in DB have a default value = 300 ?
Comment 9 Kyle M Hall 2012-05-22 12:22:55 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall 2012-05-22 12:24:01 UTC
(In reply to comment #8)
> Hi Kyle,
> Why do you initialize the cache expiry with 0 whereas the field in DB have a
> default value = 300 ?

I was not aware of the default. I've submitted a followup to fix this. Thanks!
Comment 11 Jonathan Druart 2012-05-23 08:27:08 UTC
Created attachment 9736 [details] [review]
Bug 8128 - [SIGNED-OFF]Followup - Change default value for cache_expiry

Change default value for cache_expiry from 0 to 300.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 12 Ian Walls 2012-05-23 14:54:52 UTC
Adds a default value for an otherwise-possibly-NULL field.  marking as Passed QA.