Commit Graph

92 Commits

Author SHA1 Message Date
Ansgar Becker
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
Ansgar Becker
27ebadce95 Work around unassigned menu variable. Fixes issue #1536. 2009-12-15 23:02:46 +00:00
Ansgar Becker
d100a9f029 Add <Select All> and <Copy> menu items to SQL code memos. Fixes issue #1530. 2009-12-15 00:37:54 +00:00
Ansgar Becker
03d7052d78 Fix ALTER code for modified index names, and added + deleted indexes. Fixes issue #1533. 2009-12-15 00:25:46 +00:00
Ansgar Becker
0d81ddde51 Invalidate CREATE and ALTER code in table editor one more time. Fixes issue #1532. 2009-12-15 00:07:12 +00:00
Ansgar Becker
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
Ansgar Becker
cbedf0d163 Fix enabled save button in table editor before anything was changed. 2009-12-13 15:01:22 +00:00
Ansgar Becker
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
Ansgar Becker
8670cdba97 Consistently use "Enter xyz name" as default text for new database objects 2009-12-13 07:44:01 +00:00
Ansgar Becker
3aef5bb5e5 Unify Init() method of database object editors. 2009-12-13 07:32:46 +00:00
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
400f4dd040 Indicate "No default" for a column in table editor. Fixes issue #1510. 2009-12-06 20:12:21 +00:00
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
e1a9bb0281 Add support for sql_mode=ANSI_QUOTES in table editor. 2009-11-06 21:59:33 +00:00
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
37cae6cdb4 Discard cashed stuff for data tab when the table was altered. Fixes issue #1376. 2009-10-15 20:35:33 +00:00
Ansgar Becker
c6be8dd575 Implement customizing of shortcuts for all available TActions and SynEditor commands. Fixes issue #536. 2009-09-21 23:12:21 +00:00
Ansgar Becker
a5da6f7255 Implement forgotten checksum option for existing tables. Fixes issue #1358. 2009-09-16 18:40:46 +00:00
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
eb955ac3b3 D'oh - missing file for previous commit 2009-09-05 09:48:06 +00:00
Ansgar Becker
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
Ansgar Becker
a2c327fd26 Find a more self-explanatory name for ResetVTNodes() 2009-09-03 22:26:40 +00:00
Ansgar Becker
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
Ansgar Becker
9ff75351fd Don't eat leading whitespace, needed for separation to base ALTER query. Fixes issue #1333 2009-08-31 19:54:00 +00:00
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
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
Ansgar Becker
6517a04eff Implement creation and editing of foreign key constraints in a separate new tab on the table editor. Fixes issue #400. 2009-08-16 20:32:37 +00:00
Ansgar Becker
ab60b78dba Only autostart grid editor if mouse hit was *exactly* on the cell text. Avoids annoyance in index editor. 2009-08-16 09:50:57 +00:00
Ansgar Becker
4ff1acf408 Refactor session manager:
* Replace the pulldown by a list to get a better overview
* Display last connected and created date in details
* Prompt user on form closing if modifications should be saved
* Remove moreorless useless image
* Remove options "timeout" and "sort database"
TODO: Display some help text on the right side when no session at all is existant to help new users.
2009-08-09 23:57:52 +00:00
Ansgar Becker
2e7022a945 Bold font for primary key columns in table editor. Icons for all key columns, similar to earlier versions of ListColumns on mainform. Feels very useful for a quick look when the index editor is mostly not active. 2009-07-29 20:50:41 +00:00
Ansgar Becker
0e15201c71 Again, found a table with ON UPDATE CURRENT_TIMESTAMP clause which was not correctly detected. Fix case sensitiveness. 2009-07-27 22:38:07 +00:00
Ansgar Becker
be834ab34a Fix detection logic in table editor for columns which allow NULL. Fixes issue #1270. 2009-07-27 22:15:57 +00:00
Ansgar Becker
c15654aacb Do not eat last char of data type, using .+ in regular expression. Fixes issue #1260. 2009-07-27 20:10:05 +00:00
Ansgar Becker
4d9d5a1ff7 Enable multi row selection in table editor's column list. Relevant functions adjusted:
* Add to index
* Create index
* Remove Column(s) (=> makes the "Clear columns" button superfluous)
2009-07-26 19:45:02 +00:00
Ansgar Becker
d3b1cf80c9 End possible opened grid editor when tab focus changes, which unfortunately doesn't fire the OnExit event into the editor. Fixes issue #1273 2009-07-25 21:28:39 +00:00
Ansgar Becker
e0761cedd9 Extend context menu of columns list in table editor with auto index creation/addition. Fixes issue #1269. 2009-07-25 19:35:09 +00:00
Ansgar Becker
c7da465f11 Do not use blended datatype colors for displaying a NULL default value in the table editor, instead use clGray. Seems to steel attention when everything's too much colored. 2009-07-23 21:08:04 +00:00