Bug 37307 - Update And Run SQL function appends report ID to savedsql
Summary: Update And Run SQL function appends report ID to savedsql
Status: RESOLVED DUPLICATE of bug 37763
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-10 14:51 UTC by Andrew Fuerste-Henry
Modified: 2024-09-27 15:03 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2024-07-10 14:51:00 UTC
Use of the Update And Run SQL button causes koha to append the report ID to the end of the query. It's commented out, so it doesn't break the query, but it's adding useless characters.

To recreate:
 - save and run this report:
SELECT id, savedsql
FROM saved_sql
WHERE savedsql like "%saved_sql.id: %"

- see your report returns itself
- click Edit
- click Update and Run SQL without changing anything in your report
- click Update and Run SQL again
- look at your report results, notice that the saved query is now repeating "/* saved_sql.id: 1334 */" at the end
Comment 1 Katrin Fischer 2024-07-11 08:18:59 UTC
I think that was an intentional addition - so we need to dig back on why it as added in the first place. If I remember correctly it might have been to be able to see in the server logs which reports a problematic query might belong to.
Adding Kyle - maybe he knows.
Comment 2 Andrew Fuerste-Henry 2024-07-11 13:53:16 UTC
(In reply to Katrin Fischer from comment #1)
> I think that was an intentional addition - so we need to dig back on why it
> as added in the first place. If I remember correctly it might have been to
> be able to see in the server logs which reports a problematic query might
> belong to.
> Adding Kyle - maybe he knows.

I've got no quarrel with displaying that little note of the query ID as part of the report results. However this bug is for the fact that the string "/* saved_sql.id: XXX*/" is being actually saved as part of the query and gets repeated the more one used the Update and Run button. After clicking Update and Run 7 times, my original query has become:

SELECT id, savedsql FROM saved_sql WHERE savedsql like "%saved_sql.id: %" /* saved_sql.id: 1336 */ /* saved_sql.id: 1336 */ /* saved_sql.id: 1336 */ /* saved_sql.id: 1336 */ /* saved_sql.id: 1336 */ /* saved_sql.id: 1336 */
Comment 3 Katrin Fischer 2024-07-11 14:45:51 UTC
Ok, I bet THAT was not intentional!
Comment 4 CJ Lynce 2024-08-28 18:50:55 UTC
I noticed that when fixing bug_37763, the saved_sql.id repeating issue corrected itself.
Comment 5 Brendan Lawlor 2024-09-27 15:03:42 UTC

*** This bug has been marked as a duplicate of bug 37763 ***