- 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)
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.
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)
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
- Give the user a prettier confirmation message with listed tables to drop.
- Add documentation
- Drop large WITH .. DO statement
- Correctly call refresh-procedures
- 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.
- 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.
- Drop pagecontrol to access more than one selected table. Didn't seem helpful for any case, looked ugly and was a click hell to use.
- Implement changeable editors for table name, comment, engine, charset, collation and auto_increment value.
- Backward compatibility kept: A 3.23.58 server leads to disabling editors for engine, charset and collation while keeping the others working.
A table's charset and collation can now be provided at creation time and at altering time. Just as it's implemented for databases. Fullfills now most of the wishes in RFE #1693393.
So, after changing the engine of a table the table status dataset was refreshed but never displayed, until having switched to a different db. So, MenuRefreshClick was loading but not displaying the table status.
a) option "Remember last used database" is active
b) the last used db was dropped externally or
the session was just opened with "OnlyDBs" in place and the last db is not contained in this list.
* Make export table locks local to current connection work.
* Bugfix: In non-file mode, export commands go directly to server without being parsed; thus they must not have semicolons at end of sentence. A regression here causes issue #1747558 and issue #1795486, which this commit fixes again.
(Briefly considered adding a cleanSql() which just runs result := parseSql(sql)[0], which would do the same in fewer lines of code, albeit with the small overhead of having the semicolon both added and afterwards removed again..)