- Give them their own icon in dbtree and ListTables
- Disable pure table actions (like "Alter table", "Optimize" etc.) in context menus when a view is selected
- Add new column in ListTables: "Type" which is filled either with "Base table" or "View"
- Introduce new property "NodeType" in TVTreeData record, used currently to store NODETYPE_VIEW or NODETYPE_TABLE. This new property is meant to be used for various purposes in other VirtualTrees in the future.
- Introduce Childwin.SelectedTableType, corresponding to Childwin.SelectedTable
- Make DropTable action fit for also dropping views (and surely a list with a mixture of views and tables)
- Don't fetch rowcount from views in DisplayRowCountStats to fix bug #1844952
TODO: find some sleep command for the batch file, as we sometimes get "access denied" while trying to overwrite the just terminated exe. Seems like taskkill doesn't close all handles itself.
* TNTGrid is not capable of displaying a sort arrow in column titles. So, signalize sort direction of columns in grids and listviews by lightgrey (= ascending) and mediumgrey (= descending)
* Remove special color for NULL cells in grids because it can conflict with the new sorting colors. Instead, place a grey (NULL) text in these cells. Less gaudy colors now.
* Also remove grey background in primary key columns for the benefit of sorting colors. PK cells have bold font anyway, should be noticable enough.
- Implement an alternative solution for handling sorted columns without usage of SMDBGrid's sortcolumns. Move relevant structures and functions from data_sorting.pas to childwin.pas and use them in both units.
- Upgrade some code parts to use WideStrings instead of Strings so they don't break with the new grid.
- Use Grid.OnDrawDataCell as an alternative to Grid.OnGetCellParams as the latter one is a feature of SMDBGrid
- Cosmetic: enhance screen real estate in viewdata()
- Introduce helper "MakeFloat" which does exactly the same as MakeInt except from truncating floats
- Use MakeFloat instead of MakeInt in vstCompareNodes to fix the above mentioned bug
* 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.
- Consistency:
- Move all global preferences vars from mainform to childwin.
- Get rid of unused legacy vars NativeFieldTypes + LanguageOffset
- Readability:
- Add documentation
- Prefix preferences vars with "pref"
- Get rid of WITH .. DO statements
Pros:
- ShowDBProperties doesn't reset column layout
- Sort direction is remembered automatically
- Reading columnlist from registry is done once in a TMDIChild, not on each ShowDBProperties
- Hiding/unhiding columns doesn't call ShowDBProperties
- No more hassling with what is called a "default column" or not. popupDBGrid is usable like in Windows Explorer.
- Column layout is stored global, not per session.
Cons:
- Column layout from old settings logic needed to be discarded
Side effect:
- Fixes a potential AV in FormatNumber(str) with empty strings.
- Created an overloaded FormatByteNumber() which can take a string as input