103 Commits

Author SHA1 Message Date
5c29403c7b Auto-fix user selected, non working default value/type when data type has changed. Fixes issue #1411. 2010-01-17 07:43:14 +00:00
9080ad7607 No need to use the Wide* version of string functions any longer. 2010-01-15 20:28:48 +00:00
d70ea85786 Ask user if in-memory modifications to table, view, trigger or routine should get saved, this time including a Cancel button, which cancels either
* focusing a different object in database tree and/or
* closing application
TODO: Internal switching to different connection probably needs that too?
2010-01-15 17:13:24 +00:00
52ea8f410a Use Unicode enabled TStringList instead of TWideStringList in all places. Should have no visible effect, apart from a very minor performance optimization, as String reference pointers are handled by Delphi, WideString by Windows. 2010-01-14 19:41:58 +00:00
25ac096554 Make more use of Generics, this time for columns, keys and foreigne keys lists, used by main unit and table editor. Frees code from annoying casting and makes it more type safe. 2010-01-08 00:30:51 +00:00
c2883e0f3d Don't display quotes around default values for numeric columns, so it's more clear what the server will insert by default. 2010-01-07 23:04:55 +00:00
a4652d39a4 * Fix compiler warnings due to implicit AnsiString to (Unicode)String or vice versa
* Remove workaround for Unicode text to and from clipboard
* Fix writing/reading wrong encoded text into/from registry - no need to use Utf8Encode() any longer
* Implement TMySQLQuery.ColAsAnsi() for cases in which we read binary data.
2010-01-07 00:00:56 +00:00
7d401ffde8 Upgrade to Delphi 2010:
* Removes TNT Unicode controls, which are no longer required. All VCL controls now have native Unicode support.
* Remove Delphi 11 packages, otherwise we would either need to keep TNT or break Unicode
* PngComponents update from Uwe Raabe on http://cc.embarcadero.com/Item/26127
* Adjust auto build process
* Since Delphi 2009, Strings are now UnicodeStrings, not AnsiStrings any longer. Fix a bunch of compiler errors which came along with this change.
TODO: Project should compile but give tons of compiler warnings.
2010-01-05 23:14:33 +00:00
eb9915d5be Invalidate columns and keys of an edited table when pressing the "Save" button, to avoid SQL errors when switching to "Data" tab. Fixes issue #1556 2009-12-22 23:38:38 +00:00
e356cb7ed7 Sanitize all "uses" clauses from unneeded unit references. 2009-12-22 23:19:56 +00:00
d92a7d4394 Indicate ON UPDATE clause in table editor's column list. Fixes issue #1545. 2009-12-21 12:42:16 +00:00
35e8bbb304 Do not fetch database objects from information_schema, which has gotten extremely slow on servers with many databases and triggers, since we support triggers.
* Instead, use separate SHOW commands for tables, functions, procedures and triggers
* Catch this chance to move these methods from main unit to mysql_connection, so they're accessible in a more generic way
* Additionally, introduce new classes TDBObject and TDBObjectList which provide a more generic way than TMySQLQuery to access these database objects.
Fixes issue #1529
2009-12-19 11:40:28 +00:00
27ebadce95 Work around unassigned menu variable. Fixes issue #1536. 2009-12-15 23:02:46 +00:00
d100a9f029 Add <Select All> and <Copy> menu items to SQL code memos. Fixes issue #1530. 2009-12-15 00:37:54 +00:00
03d7052d78 Fix ALTER code for modified index names, and added + deleted indexes. Fixes issue #1533. 2009-12-15 00:25:46 +00:00
0d81ddde51 Invalidate CREATE and ALTER code in table editor one more time. Fixes issue #1532. 2009-12-15 00:07:12 +00:00
dd398bb101 * Factor more code out of each database object editors into parent TDBObjectEditor.
* Use this chance to add a confirmation dialog when leaving the editors, to ask the user if he wants to save modifications. Fixes issue #1524.
* Also, enhance Mainform.RefreshTreeDB in a way that it does not trigger the OnFocusChange event. Important for the editors when saving changes.
2009-12-14 23:55:36 +00:00
cbedf0d163 Fix enabled save button in table editor before anything was changed. 2009-12-13 15:01:22 +00:00
8520f97fff Hack editor class descendants so that Delphi sees them as TFrame subclasses instead of TDBObjectEditor. Works around Delphi bug 73397 - see http://qc.embarcadero.com/wc/qcmain.aspx?d=73397 2009-12-13 14:29:18 +00:00
8670cdba97 Consistently use "Enter xyz name" as default text for new database objects 2009-12-13 07:44:01 +00:00
3aef5bb5e5 Unify Init() method of database object editors. 2009-12-13 07:32:46 +00:00
2dcf02feb3 Implement a parent class for all database object editors (table, view, routine, trigger) and let these editors derive from this class. Could simplify code in the future. 2009-12-11 18:20:16 +00:00
1de8e6344b Fix SQL error in table editor on MySQL below 4.0.18: Use TYPE instead of ENGINE in these cases. Fixes issue #1517 2009-12-09 18:12:45 +00:00
7a8477c57f VirtualStringTree.InsertNode internally calls .DoCancelEdit, which is not what we want when the user clicks the "Add column" button while editing another column. Instead, explicitly call .EndEditNode before .InsertNode. Fixes issue #1508. 2009-12-07 20:00:35 +00:00
400f4dd040 Indicate "No default" for a column in table editor. Fixes issue #1510. 2009-12-06 20:12:21 +00:00
43fe695bc1 Make SHOW KEYS FROM <selected-table> and SHOW COLUMNS FROM <selected-table> superfluous. To achieve that, move parser for SHOW CREATE TABLE string from table editor to helpers unit, where it can be called by everyone. For consistency reasons the index list in table editor is converted from a TWideStringList to a TObjectList, like both table and foreign key list. However, that results in a large diff here. 2009-12-04 21:20:06 +00:00
8ac6fbd15c There is no 64 bit unsigned integer type in Delphi, but MySQL has it: bigint unsigned. Handle these as strings in the table editor. Fixes issue #1489. 2009-11-29 00:18:20 +00:00
92bd620309 Introduce caching of collation table and table engines list in connection layer. Remove that stuff from main unit and automatically clear cached stuff on disconnection. 2009-11-22 23:42:39 +00:00
45fa64fe81 Wrap most queries in a try..except block which may fail with a SQL privilege error. So these places do not raise an exception at user level. Exceptions should only raise in unpredictable error situations. Important for reactivating the MadExcept dialog. 2009-11-22 18:07:53 +00:00
e1a9bb0281 Add support for sql_mode=ANSI_QUOTES in table editor. 2009-11-06 21:59:33 +00:00
c560d5a37e Do not clone collation when adding a new column. Better use the table's default collation. Fixes issue #1429. 2009-11-03 19:38:28 +00:00
f3ff47313c TStringList.CommaText seems to interprete spaces also as comma. Messes foreign key columns if one of them has spaces. Fix that by using Explode() and ImplodeStr(). 2009-10-30 16:36:24 +00:00
8354c106ca Try to fix broken characters in SHOW CREATE TABLE result by using UTF8StringToWideString(). Fixes issue #1328. 2009-10-28 01:16:29 +00:00
12a8e2ebc5 Implement a more lightweight connection layer, consisting of 2 units in source directory. Breaks threading and window to window communication, which should be reimplemented later. 2009-10-28 00:08:49 +00:00
37cae6cdb4 Discard cashed stuff for data tab when the table was altered. Fixes issue #1376. 2009-10-15 20:35:33 +00:00
c6be8dd575 Implement customizing of shortcuts for all available TActions and SynEditor commands. Fixes issue #536. 2009-09-21 23:12:21 +00:00
a5da6f7255 Implement forgotten checksum option for existing tables. Fixes issue #1358. 2009-09-16 18:40:46 +00:00
2146332be6 Automatically refresh children of active database node after creating a new table or renaming one. Fixes issue #1248 and part 1 of issue #1352 2009-09-12 06:47:17 +00:00
7013441d1f Table editor: When adding a new column and the focused one is used as template, make sure we don't overtake the AUTO_INCREMENT default, as there can be only one auto-inc column in a table. 2009-09-05 09:59:10 +00:00
2f11cbca88 Table editor: When creating a new index by using the columns context menu "Create index", use the concatenated column names as index name, instead of "Index 123". 2009-09-05 09:50:02 +00:00
eb955ac3b3 D'oh - missing file for previous commit 2009-09-05 09:48:06 +00:00
a7eedd3823 Table editor, "Add column" action: Pointer to added TColumn object was mixed up with an existing column. ALTER code also needs to follow the order of tree nodes. Fixes issue #1340 . 2009-09-05 09:30:49 +00:00
a2c327fd26 Find a more self-explanatory name for ResetVTNodes() 2009-09-03 22:26:40 +00:00
be2ec499f8 Refactor internal handling of columns in table editor. Replaces the multi TStringList workaround with a more readable, object oriented approach. One minor visible effect is lightning fast initializing on very huge tables with several 100 columns. Apart from that this change should not affect any visible stuff. 2009-09-03 22:18:29 +00:00
9ff75351fd Don't eat leading whitespace, needed for separation to base ALTER query. Fixes issue #1333 2009-08-31 19:54:00 +00:00
9e731a78e1 Allow columns to have no default value at all. Important for TEXTs and BLOBs which cannot have one. Fixes issue #1261. 2009-08-30 18:31:31 +00:00
b1aaeaaaf4 Disable foreign key editor for table engines which don't support that. Display a red hint label so the user knows what to do to enable foreign keys. 2009-08-23 21:59:57 +00:00
679bbb428c Fix column clause detection of SHOW CREATE TABLE result, so foreign key clauses are not displayed as columns. 2009-08-23 18:49:27 +00:00
c058039c40 Allow reference table in foreign key tab to be from a different database. See comment #17 in issue #400 : http://code.google.com/p/heidisql/issues/detail?id=400#c17 2009-08-22 16:07:03 +00:00
8e57faf265 Start editing in columns list only on exact label click. Should avoid annoyance described in issue #1305 2009-08-19 05:57:29 +00:00