Commit Graph

259 Commits

Author SHA1 Message Date
rosenfield
22daed7044 Move include files to include directory. 2007-10-10 11:46:27 +00:00
rosenfield
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
Ansgar Becker
8002d0bd46 Minor GUI fix: Scroll and repaint SQL Log AFTER adjusting line numbers. 2007-10-08 22:07:21 +00:00
rosenfield
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
rosenfield
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
rosenfield
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
531a32e69a Refresh active DB's tablelist in dbtree after renaming a table from within ListTables. 2007-10-06 06:01:55 +00:00
rosenfield
4286244eda Add meaningful messages to the SQL log when a delimiter is selected or declined. 2007-10-06 00:08:19 +00:00
Ansgar Becker
55ef55d546 Enable displaying tooltips for shortened celltext in VirtualTrees like the old TListView did by default. 2007-10-05 23:41:25 +00:00
rosenfield
db55bbcbe3 Code optimization: avoid a Length() call and a comparison in scanReverse(). 2007-10-05 23:08:19 +00:00
rosenfield
4c4c1aabfe Add an extra guard. 2007-10-05 22:26:55 +00:00
rosenfield
e3fb1070d9 Code optimization: remove a superfluous bit compare.
(Guess I'll be the one buying beer ;-).)
2007-10-05 22:11:09 +00:00
Ansgar Becker
cae34f1a6c Write date + time to logfiles to enable more debugging on the users side. 2007-10-05 22:04:08 +00:00
Ansgar Becker
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
rosenfield
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
rosenfield
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
rosenfield
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
rosenfield
fccb838455 Bugfix: Handle errors which happen during "async" query execution. 2007-10-05 13:03:24 +00:00
rosenfield
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
Ansgar Becker
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
Ansgar Becker
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
rosenfield
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
rosenfield
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
Ansgar Becker
17d41b8494 Fix/avoid AV on servers with 0 databases 2007-10-03 12:38:52 +00:00
Ansgar Becker
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
Ansgar Becker
7581a86986 Slightly optimize LogSQL, avoid a workaround using bookmarks. 2007-10-02 22:57:09 +00:00
Ansgar Becker
c822132304 Bring the checkboxes on the first page in a reasonable order. 2007-10-02 22:46:40 +00:00
Ansgar Becker
46fd6af6d3 Fullfill feature wish #1789651 "export tables as sql to another host" (preselect matching remote database) 2007-10-02 22:32:37 +00:00
Ansgar Becker
7ad12eb55c Fix bug #1805416 "quick filter on enum checkbox" 2007-10-02 22:19:04 +00:00
Ansgar Becker
a13f4d65f9 Adjust popupTreeView:
- Add "Alter table ..." command, according to popupDbGrid
- Minor case spelling ("Table" -> "table")
2007-10-02 19:22:10 +00:00
Ansgar Becker
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
Ansgar Becker
d26e85c34f Followup to broken rev 965: Add missing event assignments to listClick in fieldeditor form. 2007-10-02 18:15:33 +00:00
Ansgar Becker
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
Francisco Ernesto Teixeira
93eb8003c3 SQL Process: DELIMITER optimization (minor fix) 2007-10-02 12:33:47 +00:00
Ansgar Becker
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
Ansgar Becker
7d96c41a53 - Fix detection of focused SynMemo in popupQueryPopup
- Fix initial enabled-status of "Paste" menuitem by setting the cursor into the relevant SynMemo when the contextmenu pops up. Should be handled automatically by SynMemo, but it doesn't. And no "FocusOnRightClick" property in sight.
- Don't hide Copy + Paste menuitems in SynMemoFilter. (Probably accidently hidden in rev 759)
2007-10-01 18:03:05 +00:00
Ansgar Becker
3b1bdbea7d Populate engine dropdown in CREATE TABLE dialog automatically if the server supports SHOW ENGINES. Preselect servers default engine. 2007-09-29 23:47:22 +00:00
Ansgar Becker
884574e05b Rename menuitem "Advanced table properties" to "Alter table ..." . According to the "Alter database ..." menuitem. 2007-09-29 23:31:38 +00:00
Ansgar Becker
f097207afd Remove redundant buttons/menuitems "Insert Record" from Database and Table tab. The functions was buggy and is already fullfilled by the button/menuitem "View data" and the Data tab itself. 2007-09-29 23:27:30 +00:00
Ansgar Becker
b98582f283 Follow up to prior commit: Set the event of the first toolbutton beneath ListTables to the same which is assigned to the relevant popupmenu. Adds (fixes) a needed call to ShowTable(). 2007-09-29 23:19:28 +00:00
Ansgar Becker
f150b336ff Fix AV and multiple times called procs since rev 961. PopulateTreeTableList lead to calling LoadDatabaseProperties, which then again lead to the AV in ListTablesDblClick. Reproduction:
1. Doubleclick a table in ListTables
2. Go back to Database tab and doubleclick another table. -> AV
3. Look at the SQL log - shows at least 2 times the SHOW COLUMNS FROM table

This commit sets the behaviour of PopulateTreeTableList + SetSelectedTable to gracefully ignore the change-events of dbtree while adding or deleting tree items. Avoids unwanted cascaded procedure calls in some places.
2007-09-29 23:10:48 +00:00
Ansgar Becker
ac8a9e4473 Add support for moving header columns in all 5 VirtualStringGrids and remembering their position between sessions. 2007-09-29 12:34:01 +00:00
Ansgar Becker
88c23b9705 Fix enabled-status of "Move column from or to index" buttons. 2007-09-28 21:39:29 +00:00
Ansgar Becker
6e9a08c12f Follow up to rev 870 and 958:
Implement an optimized and universal way to safe and restore the column visibibility of ListTables (and all other VirtualStringTrees) by merging that code with the code for the column-resizing feature.
- Drops global var ListTablesColumnNames and proc SetupListTablesHeader.
- Change + move "RestoreColumnWidths" to private "RestoreListSetup", add code from SetupListTablesHeader
- Change + move "SafeColumnWidths" to private "SafeListSetup", add code from MenuTablelistColumnsClick
- Default visible columns are (must be) set at design time now

Pro:
- RestoreListSetup is called once in FormShow, while SetupListTablesHeader was called each time in LoadDatabaseProperties.
- SafeListSetup is only called once in FormClose
- Just safes the column indexes, not the column names in registry. Makes it safe to rename columns in the future
- Less registry read/write access in general.
- Safe/RestoreListSetup open an easy way to implement further list features (column moving, etc.)
- Makes it a cakewalk to implement the same column un/hiding feature for the remaining 4 Lists.
Contra:
- people/developers who used a build from 870 to this one on will see their activated columns in ListTables reset to the default (7 first columns) because the registry key and value has changed. (but: better do that now than after an official relase)
2007-09-28 21:08:37 +00:00
Ansgar Becker
cfafa94e68 Fix needed after change in rev 961: createtable-dialog refreshed the cached table dataset twice. Set ActiveDatabase early, so we only need to call MenuRefreshClick instead of RefreshDbTableList + PopulateTreeTableList. 2007-09-28 19:02:06 +00:00
Ansgar Becker
515bee7049 Disable time consuming animation when DBtree items are deleted and restored. 2007-09-28 16:57:47 +00:00