61 Commits

Author SHA1 Message Date
b2bf8a4828 Add helper "ReadUnicodeFile" 2008-06-17 22:27:13 +00:00
f7ad90cd40 Add helper "SaveUnicodeFile" 2008-06-17 19:16:11 +00:00
dced2df45e Make query execution unicode safe, mainly for a bunch of procedures and functions in Heidi itself plus various neighbours in Zeos. 2008-06-17 17:06:01 +00:00
03ca9c92f4 Kill all users of StrUtils. 2008-06-17 12:44:17 +00:00
be831f11b7 Convert parsesql to use wide strings and characters. 2008-06-17 11:56:37 +00:00
2ed4507666 Code cosmetic: Sanitize NODETYPE_BASETABLE constant from superflous "BASE" 2008-06-14 12:48:04 +00:00
a2f3c7fcbf Try to fix bug #317 "Interface won't restore" by calling ActivateMainform() at startup 2008-06-14 10:24:05 +00:00
d0a0a22443 Display sizegrip in the lower right corners of all resizable forms which have no TStatusbar. (For copyright notices see code in helpers.pas) 2008-05-12 17:55:06 +00:00
bba3d2afc1 Implement option to prefer SHOW TABLES over SHOW TABLES STATUS, as discussed on the mailing list. Fix relevant AVs and detection of VIEW/BASETABLE in GetDBObjectType (at least for 5.0.2+ servers). 2008-04-11 19:23:47 +00:00
56abd6f53d - Fix detection of views in a SHOW TABLE STATUS result. Don't rely on the "Comment" field containing the exact string "VIEW", as it can also contain an error message wrt a corrupted view.
- Show this potential message in the "Comment" column of ListTables
2008-03-23 19:31:04 +00:00
b815b91039 Fix bug #1865477 "Table maintenance does not show any response"
By removing the (superflous) context menu versions of "Optimize", "Check", "Analyze" and "Repair" table.
2008-03-18 19:54:20 +00:00
112ea167a5 Add basic support for views, without changing too much GUI logic:
- 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
2008-03-17 20:35:50 +00:00
c81dd21d69 Enhancement for all VirtualTrees: Remember previously selected nodes and restore them after any refresh. Using existing helpers:GetVTCaptions plus new helpers:SetVTSelection 2008-02-29 23:07:47 +00:00
d6d8f88417 Move unused stuff from rev 1209 and 1210 out of the release relevant files, to a place where they can be reactivated if required sometime in the future. The .res file can be restored by calling /extra/updater/makeresource.cmd . 2008-02-23 22:29:41 +00:00
9f23a9b313 Updatecheck: Find a batchfile-solution to replace the running exe with a downloaded build.
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.
2008-02-23 00:54:02 +00:00
7788014258 Added methods that enable the update of running main application just giving the direction of newest main application file. 2008-02-21 03:01:10 +00:00
52c85ddabc Introduce APPDOMAIN constant (=http://www.heidisql.com/), for usage in various methods. 2008-02-08 21:11:08 +00:00
26f5d5ce88 - Get rid of lame helper notinlist(), use TStringList.IndexOf() instead.
- Get rid of TCreateTableForm.ButtonsChange(), merge code into TCreateTableForm.EditFieldnameChange()
2008-01-11 16:10:14 +00:00
1671ea2c19 Move all code for adjusting CREATE TABLE statements to a specific version from exportsql.pas to fixSQL(). Using SynEdit's nice regular expression object. Fixes bug #1843890 "Exportfile: YPE=MyISAM; (missing T)" 2007-12-17 23:12:35 +00:00
23c13d2531 Cleanup usage of background colors in grids and listviews:
* 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.
2007-12-01 22:37:21 +00:00
f6d4e637e3 Replace TSMDBGrid in Data + Query tabs by TTntDBGrid.
- 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()
2007-11-26 20:58:08 +00:00
cbc37695de Minor: Add/update documentation for MakeFloat 2007-10-23 19:00:54 +00:00
a4406b229f Fix a sorting bug in vstCompareNodes: Floats were always truncated to integers, then compared. So, sorting 0,1 and 0,2 placed these values somewhere between the 0 values.
- 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
2007-10-21 18:48:23 +00:00
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
4286244eda Add meaningful messages to the SQL log when a delimiter is selected or declined. 2007-10-06 00:08:19 +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
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
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
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
93eb8003c3 SQL Process: DELIMITER optimization (minor fix) 2007-10-02 12:33:47 +00:00
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
ee1fb08158 SQL Process: handling of DELIMITER to mimic mysql CLI (minor fix) 2007-09-25 02:13:03 +00:00
a8809f4975 SQL Process: handling of DELIMITER to mimic mysql CLI 2007-09-25 02:05:38 +00:00
6ae3e42bcd Fix bug in GetFirstWord: Last character was cut if length of input textlength matched the word length. 2007-09-23 22:38:08 +00:00
6adaf3bd6a Bugfix: Range error in getEnumValues() for any string without '(' in it, eg popping up the field editor for a 'datetime' field. 2007-09-17 21:08:49 +00:00
b056d43e4b Fix a range error and various other bugs in vstFreeNode(). 2007-09-11 20:40:41 +00:00
c8979cd114 Bugfix: A "for Cardinal(i) := 0 to -1" loop in Delphi will run for 2^32 iterations rather than 0 iterations - when a list given to AddUniqueItemsToList() is empty, avoid starting this for loop and thereby avoid a range error when clicking the '+' sign next to an empty database. 2007-09-11 09:27:17 +00:00
6d72ead5dd Refactor logic in preferences dialog:
- 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
2007-09-03 15:44:18 +00:00
895e69269f Fix AV on comparing mixed column content in VirtualTrees (strings compared to integers) 2007-09-02 13:46:07 +00:00
bab0a38fe4 MakeInt(): Correctly backconvert strings which were previously formatted by FormatByteNumber() . Fixes incorrect sorting of columns in VirtualTrees which contain some byte values. Also enables us to call FormatToByteNumber() in "Size" column of ListTables. 2007-09-02 10:05:09 +00:00
40c41d3cbe Add support for TeraByte and PetaByte in FormatByteNumber.
Overcomes a "E2099 Overflow in conversion or arithmetic operation" compiler error by using constants instead of calculating the limits.
2007-08-31 00:03:55 +00:00
8ab0b95440 Implement a more effective solution for hiding and unhiding columns in ListColumns.
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
2007-08-30 23:49:38 +00:00
bf401df253 * Implement Pos2, which takes a start parameter.
* Mask USING {BTREE,HASH,RTREE} from older servers. I wonder why mysqld doesn't do this by itself. Fixes issue #1779065.
2007-08-29 00:49:40 +00:00
5d718e5152 Iterate through data arrays of VirtualTrees rather than through the nodes to get their captions. Fixes sorting in ColumnSelection-dialog and other places where GetVTCaptions is called to get all captions (not the selection). 2007-08-27 18:46:21 +00:00