Fixes at least two things:
- Rely on getting an exception when calling ExecUpdateQuery with erroneous SQL (fx the field editor does that sometimes when you update a TIMESTAMP field
- Executing queries from the query editor, receiving "Cannot perform this operation on a closed dataset"
- Show line numbers as they can be quite useful
- Increase starting number when the first line gets deleted from the log, so the line numbers don't lie about the real number of loglines.
* Add helpful (hopefully) delimiter syntax checking.
* Protect the backslash-in-string-literal parsing a bit more by only activating it inside string literals. Also move it towards the string literal handler to improve readability.
* Fix regression: choose characters for secchar and thdchar that are really unused by the parser logic.
* When shortcutting and snipping whitespace early, the start pointer must be adjusted whenever a comment "whitespace" is accounted for.
* When handling end-of-string inside loop, shortcutting via continue must not be performed if at the last character of the string, otherwise an entire sentence might be skipped.
* Processing sentence contents must happen after processing comments (as before the delimiter changes).
* Trying to handle the conditional markers with a state variable inside the end-of-sentence block did not work, sometimes too much sql got included in the conditional.
* parsesql():
- Much added complexity.
- Handle end-of-sql inside loop instead of being a special case outside.
- Only set 'start' after a complete statement has been handled.
* addResults(): Adjustment to allow trimming of enclosed string.
* isNumber(): New helper.
* DELIMITER is not a SQL reserved word interpreted in any way by mysqld.
* ComboBoxQueryDelimiterExit was not attached to ComboBoxQueryDelimiter's exit event.
* Fork out IsValidDelimiter to avoid code duplication.
* Simplify delimiter handling:
- Shortcut on whitespace in start of SQL sentences, trims it off by skipping it.
- Remove start_of_command_pos variable in SQL parser, with the above change 'start' is interchangeable.
- Remove comment stating that a delimiter could be part of the SQL command currently being parsed (it can't).
- Disallow DELIMITER inside conditional comment.
- Remove region without matching end-region (?).
- Disallow DELIMITER DELIMITER, it makes for simpler code.
Plus minor optimizations:
* Fast continue at end of one-line comments.
* Test for most-likely-to-fail conditions first in some of the "if"'s.
* Avoid calling (?) Length() for each invocation of the loop.
- File logging can be activated in preferences dialog, by default of course NOT active.
- One file per session is written to [Documents and settings]\[username]\Application data\HeidiSQL\Sessionlogs\
- Filename pattern: "[session name] [zeropadded session nr].log"
- Fetch more descriptive CSIDL_* constants for system folders from ShlObj unit rather than hardcoded hex values