Skip to content

Commit 091af09

Browse files
committed
Bug fix: Improved the performance of SQL result tab header marking for large SQL editor content.
1 parent 368a60e commit 091af09

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

sql12/core/doc/changes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Table cell data popup now offers find, Xml/Json-reformatting and export function
8686

8787
Bug fixes:
8888

89+
Improved the performance of SQL result tab header marking for large SQL editor content.
90+
8991
SQL result tab header marks:
9092
The option "Compare SQLs disregarding comments, line feeds and other white spaces" did not work properly.
9193
The option can be found at menu File --> Global Preferences --> tab SQL --> section "SQL result tab header".

sql12/core/src/net/sourceforge/squirrel_sql/client/session/mainpanel/resulttabheader/ResultTabMatchingCurrentSqlHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private void onTextAreaPaint(boolean activateLastMarked)
8585
{
8686

8787
IQueryTokenizer qt = _entryPanel.getSession().getNewQueryTokenizer();
88-
qt.setScriptToTokenize(sqlToBeExecuted, QueryTokenizePurpose.OTHER);
88+
qt.setScriptToTokenize(sqlToBeExecuted, QueryTokenizePurpose.FIRST_STATEMENT_ONLY);
8989

9090
if(false == qt.hasQuery())
9191
{

sql12/core/src/net/sourceforge/squirrel_sql/fw/sql/querytokenizer/QueryTokenizePurpose.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
public enum QueryTokenizePurpose
44
{
55
STATEMENT_EXECUTION,
6-
OTHER
6+
FIRST_STATEMENT_ONLY
77
}

sql12/core/src/net/sourceforge/squirrel_sql/fw/sql/querytokenizer/QueryTokenizer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ public void setScriptToTokenize(String script, QueryTokenizePurpose queryTokeniz
212212
if(0 < newQuery.length())
213213
{
214214
_queries.add(new QueryHolder(curQuery.toString().trim(), curOriginalQuery.toString().trim()));
215+
216+
if(QueryTokenizePurpose.FIRST_STATEMENT_ONLY == queryTokenizePurpose)
217+
{
218+
_queryIterator = _queries.iterator();
219+
return;
220+
}
215221
}
216222
}
217223
curQuery.setLength(0);

0 commit comments

Comments
 (0)