Bug 145582 - Query → Edit in SQL-View treats file as changed when no changes have occurred
Summary: Query → Edit in SQL-View treats file as changed when no changes have occurred
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.2.2.2 release
Hardware: All All
: medium minor
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-11-07 18:37 UTC by boriente
Modified: 2021-12-06 13:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description boriente 2021-11-07 18:37:46 UTC
Description:
When I open an SQL file in BASE, the file is already marked a "changed" when I haven't made any changes. This forces me to respond to the SAVE dialog when I close the unedited file. Not a showstopper by any means but annoying nonetheless.

This doesn't happen in CALC or WRITE.

Steps to Reproduce:
1. Open any SQL file Edit/Edit in SQL Mode
2. The SAVE icon has a red dot indicating the file has been changed when it hasn't 
3. Close the unedited file

Actual Results:
Closing the unedited SQL file cause the File Save dialog to pop up. 

Expected Results:
Upon opening, the SQL file should not be considered "changed" when no changes have occurred. The File Save dialog should not pop up when closing an unedited file. 


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 6; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Robert Großkopf 2021-11-08 10:05:14 UTC
Think you are writing about a query:

Right mouse click on a query
Edit in SQL-View
Query indicates it has been changed

This happens here with LO 7.2.2.2, not with LO 7.1.5.2 on OpenSUSE 15.2 64bit rpm Linux. So it's a regression.
Comment 2 Alex Thurgood 2021-11-09 15:18:47 UTC
@boriente :

what do you mean by "when I open a SQL file in Base" ?

There is no direct mechanism by which to open SQL files (which are usually text files, with a ".sql" file extension, unless you mean that you load them into Writer and yet you mention that the problem you are seeing doesn't occur in Writer ?

Please be more precise in your detailed explanation of how to reproduce the problem.

If Robert has correctly deduced that your are talking about copy/pasting a SQL query (presumably from a separate file), then please correct the title of this bug to reflect that.
Comment 3 boriente 2021-11-09 16:11:21 UTC
Sorry for the confusion.

I'm not copy/pasting. I'm using BASE. I have a database that I have written queries against. When I right click the existing query in Base and choose "Edit in SQl Mode" the query opens as having been changed (see little red dot on the Save icon) when I haven't made any changes yet.


This is from a previous comment by Robert Grobkopf (which pretty much sums up what just wrote above):
Right mouse click on a query
Edit in SQL-View
Query indicates it has been changed

This happens here with LO 7.2.2.2, not with LO 7.1.5.2 on OpenSUSE 15.2 64bit rpm Linux. So it's a regression.
Comment 4 Alex Thurgood 2021-11-10 10:40:30 UTC
(In reply to boriente from comment #3)
> Sorry for the confusion.
> 
> I'm not copy/pasting. I'm using BASE. I have a database that I have written
> queries against. When I right click the existing query in Base and choose
> "Edit in SQl Mode" the query opens as having been changed (see little red
> dot on the Save icon) when I haven't made any changes yet.
> 
> 
> This is from a previous comment by Robert Grobkopf (which pretty much sums
> up what just wrote above):
> Right mouse click on a query
> Edit in SQL-View
> Query indicates it has been changed


Thanks for the clarification, and I see that the title has already been changed to reflect the situation. Thanks to whoever it was !
Comment 5 raal 2021-11-10 22:08:44 UTC
This seems to have begun at the below commit.
Adding Cc: to Caolán McNamara ; Could you possibly take a look at this one?
Thanks
 2a82ac4cd48a43ff63eb367b8804735565bc9a4b is the first bad commit
commit 2a82ac4cd48a43ff63eb367b8804735565bc9a4b
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Tue Aug 3 16:50:39 2021 +0200

    source 5b98dd53c7dc101d3a5ff693d3f0520ec1abd3d1

https://git.libreoffice.org/core/+/5b98dd53c7dc101d3a5ff693d3f0520ec1abd3d1
   tdf#143657 'execute' button doesn't get enabled when contents changed
Comment 6 Commit Notification 2021-11-12 12:15:19 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e467d936452bd428fe71339803fa22eb0a5f31e2

Resolves: tdf#145582 modify called too often

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Caolán McNamara 2021-11-12 12:31:28 UTC
done in trunk, backport to 7-2 in gerrit
Comment 8 Commit Notification 2021-11-15 11:39:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/7cffe43f0dc063b90e60f1698c30444297fb6f6a

Resolves: tdf#145582 modify called too often

It will be available in 7.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard