Commit Graph

247 Commits

Author SHA1 Message Date
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
Ansgar Becker
6f114624f4 Ensure PopulateTreeTableList does its job even when it's called with ForceRefresh=False and the node was already filled before. Refreshing the table status dataset again is not wanted when we
1. drop, create or rename table(s)
2. call RefreshDbTableList + LoadDatabaseProperties
3. call PopulateTreeTableList

Pro: Safes an extra and superflous "SHOW TABLE STATUS FROM..." query
Contra: PopulateTreeTableList is called in quite many places and doesn't exit early now
2007-09-28 16:55:45 +00:00
Ansgar Becker
c6fff14ed0 Refactor DROP TABLE procedure:
- Give the user a prettier confirmation message with listed tables to drop.
- Add documentation
- Drop large WITH .. DO statement
- Correctly call refresh-procedures
2007-09-28 16:43:59 +00:00
Ansgar Becker
d315e45885 Nuke various never called procedures and functions. Just readd them if you want to use them somewhere, especially the helpers-functions. 2007-09-26 23:13:18 +00:00
Ansgar Becker
4f0d2b9403 Spam registry with column widths of all 5 VirtualTrees on FormClose. Restore these values in ReadWindowOptions. Should make users happy which resize columns precisely to fit their needs. 2007-09-26 20:45:10 +00:00
Ansgar Becker
c13318714e Upgrade old forms to use Tahoma font. Adjust widths of various TLabel's to make their captions fit with the new font. 2007-09-26 19:36:19 +00:00
Ansgar Becker
6968817941 Minor enhancements and consistency fixes for CreateDatabase + CreateTable dialogs:
- Fetch charsets from collations dataset rather than firing an extra "SHOW CHARSET"
- Move fetching defaultCharset to existing TRY clause. No functionality change, just more consistent.
- Sort all comboboxes with charsets and collations alphabetically
- Leave the responsibility for disabling the comboboxes on old servers to the code rather than to the DFM file.
- Adapt Enabled-property of TLables to the comboboxes they belong to.
2007-09-25 18:47:34 +00:00
Francisco Ernesto Teixeira
ee1fb08158 SQL Process: handling of DELIMITER to mimic mysql CLI (minor fix) 2007-09-25 02:13:03 +00:00
Francisco Ernesto Teixeira
a8809f4975 SQL Process: handling of DELIMITER to mimic mysql CLI 2007-09-25 02:05:38 +00:00
Ansgar Becker
ceccf7dc68 Hide left gutter of SynMemoSQLLog. We neither display line numbers nor bookmarks there. 2007-09-24 23:17:48 +00:00
Ansgar Becker
b7e88148fc Set ActiveLineColor of SynMemoQuery to light yellow, just like in common editor applications. Should make writing queries slightly comfortable. 2007-09-24 23:12:24 +00:00
Ansgar Becker
adfac67b1a Nuke now superflous, redundant table features since we have them all gathered in "Advanced properties" dialog:
- Change table engine via popupmenu in ListTables
- Edit comment via same popupmenu + an own dialog

Not keeping the same feature in different corners of the application looks more straight forward. Users will have exactly one point where they can modify all table related properties. Should simplify it in the end, although some users will have to get used to it.
2007-09-24 22:00:43 +00:00
Ansgar Becker
69572e38a7 Create once and then cache tbl_properties_form when it's needed. Avoids querying COLLATIONS and ENGINES each time the form gets displayed. 2007-09-24 20:04:46 +00:00