270 Commits

Author SHA1 Message Date
17f9730b76 Fix bugs
#1814411 "Incorrect SQL when changing structure on a field"
#1814293 "Incorrect SQL when changing structure on a FLOAT field"
2007-10-16 19:34:25 +00:00
0d0c0ddbef Fix bug #1813760 "TIMESTAMP fields with NULL".
Side effect: Explicitely set "Can be NULL" option if "Not Null" is unchecked
2007-10-16 19:04:59 +00:00
7f901e325b "Copy table" dialog: Use ensureValidIdentifier() to validate the name of the new table. 2007-10-12 19:27:39 +00:00
f3e98a9f5b Fix bug #1810117 Updating timestamp fields with default value "CURRENT_TIMESTAMP" 2007-10-12 19:16:04 +00:00
a027d51276 Fix logic in TFieldEditForm.OkClick which lead to closing the fieldeditor with ModalResult=mrCancel after SQL errors, although AddUpdateField() sets mrNone. 2007-10-12 18:51:07 +00:00
b16a5184a9 Do not suppress SQL errors in case the field editor generated erroneous SQL. 2007-10-12 18:44:10 +00:00
a89b1df396 Fix a bug in threaded queries: The query thread sometimes didn't call SetThreadResult. (with a good hint from rosenfield).
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"
2007-10-12 18:37:34 +00:00
0c611991e2 Fieldeditor GUI:
- Adjust position of controls
- Add shortcuts / focuscontrols
Seems like 8px is a good choice for margins to form edges.
2007-10-10 21:59:39 +00:00
db81b8af50 Save/Restore the DELIMITER list on Registry: must be BEFORE read/write the key Servers. 2007-10-10 18:39:27 +00:00
96002807d8 Save/Restore the DELIMITER list on Registry. 2007-10-10 18:33:51 +00:00
b7b652da67 Fix adjusting linenumbers in SQL log when user changed the max linecount in preferences. 2007-10-10 18:17:35 +00:00
22daed7044 Move include files to include directory. 2007-10-10 11:46:27 +00:00
29b951b843 * Add svnversion + envpipe + sed as part of build process, as a quick fix to get WC revision numbers into main.pas. 2007-10-09 16:39:57 +00:00
8002d0bd46 Minor GUI fix: Scroll and repaint SQL Log AFTER adjusting line numbers. 2007-10-08 22:07:21 +00:00
4232f36909 * Remove spam.
* Improve performance by not painting the progress form if a query completes within 300 msecs.
2007-10-08 21:52:59 +00:00
74074fe633 Bugfix: There is no thread safety mechanism in Zeos for the SQL log, so implement one in HeidiSQL. This should speed up async queries tremendously, as they no longer have to wait for the GUI to repaint before firing the actual query. Haven't bothered thinking about thread safety around the creation of the critical section protecting the TStringList, mainly because I'm infinitely annoyed by Delphi not providing a thread-safe list capable of holding lists OOTB.. 2007-10-08 21:29:16 +00:00
3c5d236555 Bugfix: Don't try to access element -1 of a collection.
Please enable DEBUGGING in your builds so you can catch these sort of things before release time.
2007-10-08 16:56:43 +00:00
fce4a738f8 Fix minor bug: LogSQL always containted one more line than the value in the preferences screen said. Fix that by moving the code for deleting the first line to after adding the new one. 2007-10-07 20:18:43 +00:00
970272ad65 Give popupSQLLog 2 new items:
- "Log to file" (checkable, (de)activates file logging)
- "Open log folder" (opens the folder with logfiles)
2007-10-07 19:48:37 +00:00
f9be3e3a83 - Revert rev 950, re-adding SynMemoSQLLog.Gutter = visible.
- 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.
2007-10-06 18:16:08 +00:00
5831c331a4 Add option to set SynMemoQuery.ActiveLineColor . By default, this color is set to clWindow (same as the memo itself has). Reverts rev 949 where ActiveLineColor was hardcoded. 2007-10-06 11:58:14 +00:00
531a32e69a Refresh active DB's tablelist in dbtree after renaming a table from within ListTables. 2007-10-06 06:01:55 +00:00
4286244eda Add meaningful messages to the SQL log when a delimiter is selected or declined. 2007-10-06 00:08:19 +00:00
55ef55d546 Enable displaying tooltips for shortened celltext in VirtualTrees like the old TListView did by default. 2007-10-05 23:41:25 +00:00
db55bbcbe3 Code optimization: avoid a Length() call and a comparison in scanReverse(). 2007-10-05 23:08:19 +00:00
4c4c1aabfe Add an extra guard. 2007-10-05 22:26:55 +00:00
e3fb1070d9 Code optimization: remove a superfluous bit compare.
(Guess I'll be the one buying beer ;-).)
2007-10-05 22:11:09 +00:00
cae34f1a6c Write date + time to logfiles to enable more debugging on the users side. 2007-10-05 22:04:08 +00:00
c4665784c2 - Give SynMemoFilter his own popupFilter instead of using popupQuery twice. Fixes broken F9 shortcut from rev 975 in both SynMemoQuery and SynMemoFilter after switching between them.
- Rename toolbutton and menuitem "Set filter" to "Apply filter"
2007-10-05 21:54:30 +00:00
213d145f3a * Add code comments.
* 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.
2007-10-05 20:17:11 +00:00
a3e18dc1dc Bugfix: one occasion assumed a delimiter length of 1, leading to superfluous character in resulting sql sentence. 2007-10-05 19:16:40 +00:00
d33be19be0 Nuke ExpectResultSet. Opted not to disable the mysql driver exceptions in zeos, instead used Anse's TZConnection.GetAffectedRowsFromLastPost().
(Messing with the internals here, please test...)
2007-10-05 18:52:38 +00:00
fccb838455 Bugfix: Handle errors which happen during "async" query execution. 2007-10-05 13:03:24 +00:00
d616f1bdce Fix various regressions:
* 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.
2007-10-05 12:49:59 +00:00
f0db5d8497 Fix queries like /*!40000 SHOW ENGINES */ to be recognized as "result"-queries while not breaking getFirstWord calls in situations where the second or later char can be a number (fx the collation in createdatabase). 2007-10-04 20:31:31 +00:00
94f1d6035f Fix compiler error in Delphi 10: Copy CSIDL_* constants from [delphi11]\source\win32\rtl\win\ShlObj.pas to const.inc to make them available also in Delphi 10. 2007-10-04 20:04:58 +00:00
f88e1ff4d6 Implement todo: support for multiple statements inside conditional comments.
* 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.
2007-10-04 17:19:30 +00:00
ed54bb2be6 Changes based on delimiter review:
* 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.
2007-10-04 17:07:27 +00:00
17d41b8494 Fix/avoid AV on servers with 0 databases 2007-10-03 12:38:52 +00:00
547b6161fa Fullfill feature request #1751455 "SQL log also in text-file".
- 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
2007-10-03 12:35:32 +00:00
7581a86986 Slightly optimize LogSQL, avoid a workaround using bookmarks. 2007-10-02 22:57:09 +00:00
c822132304 Bring the checkboxes on the first page in a reasonable order. 2007-10-02 22:46:40 +00:00
46fd6af6d3 Fullfill feature wish #1789651 "export tables as sql to another host" (preselect matching remote database) 2007-10-02 22:32:37 +00:00
7ad12eb55c Fix bug #1805416 "quick filter on enum checkbox" 2007-10-02 22:19:04 +00:00
a13f4d65f9 Adjust popupTreeView:
- Add "Alter table ..." command, according to popupDbGrid
- Minor case spelling ("Table" -> "table")
2007-10-02 19:22:10 +00:00
d80db53046 Add reasonable shortcuts to popupQuery:
- Save to file [Ctrl+S]
- Save selection to file [Shift+Ctrl+S]
- Load from file [Ctrl+O]
- Insert file at cursor [Shift+Ctrl+O]
2007-10-02 18:24:19 +00:00
d26e85c34f Followup to broken rev 965: Add missing event assignments to listClick in fieldeditor form. 2007-10-02 18:15:33 +00:00
d32b3efd1b Follow up to rev 972: Fix a AV / nil reference to ActiveSynMemo in popupQuery.OnPopup which is called when a shortcut is used (fx F9 to execute a query). 2007-10-02 18:05:52 +00:00
93eb8003c3 SQL Process: DELIMITER optimization (minor fix) 2007-10-02 12:33:47 +00:00
d39517a8c2 Fix part 2 of "bug" 1803650 (actually not a bug but unwanted behaviour): Switch to "Database" tab if "Host" was active and a database is clicked in dbtree. 2007-10-01 18:43:06 +00:00