Skip to content
Permalink
Browse files

Add new log category lcScript, for queries from large scripts and imp…

…ort operations. By default disabled, which should speed up importing large files.
  • Loading branch information...
ansgarbecker committed Apr 16, 2019
1 parent 975e152 commit 85a8355e1dbe33d8942b8bfdb4b2a30a0d0bd86d
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2019-04-10 15:05+0200\n"
"PO-Revision-Date: 2019-04-16 07:16+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -2683,6 +2683,9 @@ msgstr "User-generated SQL queries"
msgid "Internal SQL queries"
msgstr "Internal SQL queries"

msgid "Import/script queries"
msgstr "Import/script queries"

#. optionsform..pagecontrolMain..tabLogging..chkLogEventInfo..Caption
#: options.dfm:312
msgid "Information messages"
@@ -173,7 +173,7 @@ TQueryThread = class(TThread)
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
asTheme, asIconPack,
asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors,
asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asFieldColorNumeric,
asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asLogScript, asFieldColorNumeric,
asFieldColorReal, asFieldColorText, asFieldColorBinary, asFieldColorDatetime, asFieldColorSpatial,
asFieldColorOther, asFieldEditorBinary, asFieldEditorDatetime, asFieldEditorDatetimePrefill, asFieldEditorEnum,
asFieldEditorSet, asFieldNullBackground, asRowBackgroundEven, asRowBackgroundOdd, asGroupTreeObjects, asDisplayObjectSizeColumn, asSQLfile,
@@ -3660,6 +3660,7 @@ constructor TAppSettings.Create;
InitSetting(asLogErrors, 'LogErrors', 0, True);
InitSetting(asLogUserSQL, 'LogUserSQL', 0, True);
InitSetting(asLogSQL, 'LogSQL', 0, True);
InitSetting(asLogScript, 'LogScript', 0, False);
InitSetting(asLogInfos, 'LogInfos', 0, True);
InitSetting(asLogDebug, 'LogDebug', 0, False);
InitSetting(asFieldColorNumeric, 'FieldColor_Numeric', $00FF0000);
@@ -281,7 +281,7 @@ TConnectionParameters = class(TObject)

{ TDBConnection }

TDBLogCategory = (lcInfo, lcSQL, lcUserFiredSQL, lcError, lcDebug);
TDBLogCategory = (lcInfo, lcSQL, lcUserFiredSQL, lcError, lcDebug, lcScript);
TDBLogEvent = procedure(Msg: String; Category: TDBLogCategory=lcInfo; Connection: TDBConnection=nil) of object;
TDBEvent = procedure(Connection: TDBConnection; Database: String) of object;
TDBDataTypeArray = Array of TDBDataType;
@@ -533,7 +533,7 @@ procedure Tloaddataform.ClientParse(Sender: TObject);
SetLength(SA, ChunkSize div SizeOf(AnsiChar));
OutStream.Read(PAnsiChar(SA)^, ChunkSize);
OutStream.Size := 0;
FConnection.Query(UTF8ToString(SA));
FConnection.Query(UTF8ToString(SA), False, lcScript);
SQL := '';
end;
end else
@@ -3783,7 +3783,7 @@ procedure TMainForm.RunQueryFile(FileName: String; Encoding: TEncoding);
// Execute single query
// Break or don't break loop, depending on the state of "Stop on errors" button
try
ActiveConnection.Query(Queries[i].SQL);
ActiveConnection.Query(Queries[i].SQL, False, lcScript);
RowsAffected := RowsAffected + ActiveConnection.RowsAffected;
except
on E:Exception do begin
@@ -4883,6 +4883,7 @@ procedure TMainForm.LogSQL(Msg: String; Category: TDBLogCategory=lcInfo; Connect
lcError: LogIt := AppSettings.ReadBool(asLogErrors);
lcUserFiredSQL: LogIt := AppSettings.ReadBool(asLogUserSQL);
lcSQL: LogIt := AppSettings.ReadBool(asLogSQL);
lcScript: LogIt := AppSettings.ReadBool(asLogScript);
lcInfo: LogIt := AppSettings.ReadBool(asLogInfos);
lcDebug: LogIt := AppSettings.ReadBool(asLogDebug);
else LogIt := False;
@@ -361,7 +361,7 @@ object optionsform: Toptionsform
end
object lblQueryHistoryKeepDays: TLabel
Left = 421
Top = 212
Top = 231
Width = 209
Height = 13
Caption = 'days to keep queries before removing them'
@@ -446,7 +446,7 @@ object optionsform: Toptionsform
end
object chkLogEventInfo: TCheckBox
Left = 190
Top = 154
Top = 180
Width = 515
Height = 17
Caption = 'Information messages'
@@ -455,7 +455,7 @@ object optionsform: Toptionsform
end
object chkLogEventDebug: TCheckBox
Left = 190
Top = 174
Top = 200
Width = 515
Height = 17
Caption = 'Debug messages'
@@ -481,7 +481,7 @@ object optionsform: Toptionsform
end
object chkQueryHistory: TCheckBox
Left = 190
Top = 211
Top = 230
Width = 145
Height = 17
Caption = 'Enable query history'
@@ -490,7 +490,7 @@ object optionsform: Toptionsform
end
object chkHorizontalScrollbar: TCheckBox
Left = 190
Top = 234
Top = 253
Width = 515
Height = 17
Caption = 'Horizontal scrollbar'
@@ -499,7 +499,7 @@ object optionsform: Toptionsform
end
object editQueryHistoryKeepDays: TEdit
Left = 344
Top = 209
Top = 228
Width = 53
Height = 21
Enabled = False
@@ -509,7 +509,7 @@ object optionsform: Toptionsform
end
object updownQueryHistoryKeepDays: TUpDown
Left = 397
Top = 209
Top = 228
Width = 16
Height = 21
Associate = editQueryHistoryKeepDays
@@ -520,6 +520,15 @@ object optionsform: Toptionsform
TabOrder = 14
OnChanging = anyUpDownLimitChanging
end
object chkLogEventScript: TCheckBox
Left = 190
Top = 157
Width = 515
Height = 17
Caption = 'Import/script queries'
TabOrder = 15
OnClick = Modified
end
end
end
object tabSQL: TTabSheet
@@ -171,6 +171,7 @@ Toptionsform = class(TFormWithSizeGrip)
tabFiles: TTabSheet;
chkAskFileSave: TCheckBox;
chkRestoreTabs: TCheckBox;
chkLogEventScript: TCheckBox;
procedure FormShow(Sender: TObject);
procedure Modified(Sender: TObject);
procedure Apply(Sender: TObject);
@@ -292,6 +293,7 @@ procedure Toptionsform.Apply(Sender: TObject);
AppSettings.WriteBool(asLogErrors, chkLogEventErrors.Checked);
AppSettings.WriteBool(asLogUserSQL, chkLogEventUserGeneratedSQL.Checked);
AppSettings.WriteBool(asLogSQL, chkLogEventSQL.Checked);
AppSettings.WriteBool(asLogScript, chkLogEventScript.Checked);
AppSettings.WriteBool(asLogInfos, chkLogEventInfo.Checked);
AppSettings.WriteBool(asLogDebug, chkLogEventDebug.Checked);
AppSettings.WriteBool(asQueryHistoryEnabled, chkQueryHistory.Checked);
@@ -660,6 +662,7 @@ procedure Toptionsform.FormShow(Sender: TObject);
chkLogEventErrors.Checked := AppSettings.ReadBool(asLogErrors);
chkLogEventUserGeneratedSQL.Checked := AppSettings.ReadBool(asLogUserSQL);
chkLogEventSQL.Checked := AppSettings.ReadBool(asLogSQL);
chkLogEventScript.Checked := AppSettings.ReadBool(asLogScript);
chkLogEventInfo.Checked := AppSettings.ReadBool(asLogInfos);
chkLogEventDebug.Checked := AppSettings.ReadBool(asLogDebug);
chkQueryHistory.Checked := AppSettings.ReadBool(asQueryHistoryEnabled);
@@ -1368,8 +1368,8 @@ procedure TfrmTableTools.Output(SQL: String; IsEndOfQuery, ForFile, ForDir, ForD
ExportStream.Size := 0;
ExportStreamStartOfQueryPos := 0;
SQL := UTF8ToString(SA);
if ToDB then MainForm.ActiveConnection.Query(SQL)
else if ToServer then FTargetConnection.Query(SQL);
if ToDB then MainForm.ActiveConnection.Query(SQL, False, lcScript)
else if ToServer then FTargetConnection.Query(SQL, False, lcScript);
SQL := '';
end;
end;

0 comments on commit 85a8355

Please sign in to comment.
You can’t perform that action at this time.