66 Commits

Author SHA1 Message Date
5e8bf8306a Remove unused unit inclusions, detected by CNPack/Uses cleaner 2012-05-01 08:34:12 +00:00
ba14143238 Export whole CREATE VIEW code, not only the VIEW body. Fixes issue #2625. 2012-02-04 06:52:21 +00:00
3c725b3d76 Quote collation clause in all places. Fixes issue #2479. Related: issue #1852. 2011-06-27 19:44:07 +00:00
e96fa77cbd Do not cache dialog instances any longer. OnCreate code is mostly very quick, and caching them adds quite some pitfalls into the code. Not to mention 30 lines less code in main.pas now :) 2011-06-26 20:01:42 +00:00
2d548b5ef6 Introduce some wrapper functions for message and error dialogs in order to have less code and to avoid hidden titles on Windows XP. Fixes issue #2425. 2011-05-27 04:48:21 +00:00
4fbf2c23dd Introduce experimental MS SQL support 2011-03-29 23:20:21 +00:00
49a97584e6 Code preparation for non-MySQL connections: Extract abstract stuff into a new TDBConnection class, and let TMySQLConnection derive from that. Same with TDBQuery / TMySQLQuery. See issue #1008. 2011-03-17 23:03:54 +00:00
6f95a796e1 Modify identifier quoting logic:
- Move QuoteIdent() and DeQuoteIdent() out of TMySQLConnection, make them classless
- Remove TMainForm.mask(), instead always use QuoteIdent()
- Introduce a third parameter to QuoteIdent(): "AlwaysQuote" - setting this to false will quote only if required
- Set AlwaysQuote to false for all stuff which drops some code into the query editor, see http://www.heidisql.com/forum.php?t=6986
2010-11-24 23:12:13 +00:00
9a3211466a Fix detection of focused db object for usage in copy table dialog. Could happen that a trigger with the same name of the wanted table was taken, instead of the table. 2010-10-26 18:47:59 +00:00
6c2a100945 Implement combo box for definer in routine + view + trigger editor. Fixes issue #2189. Some related changes here:
- Remove ensureValidIdentifier() and its partly uncatched exceptions. Instead, disable "OK" buttons for empty table/view/proc name.
- QuoteIdent and DeQuoteIdent now take the glue char instead of a "HasMultiSegments" boolean param, so they're more exact when "user@host" or "db.name" come in.
2010-10-12 22:13:08 +00:00
5d13d0677b The 3 procedures Parse(Table|View|Routine)Structure() already do some connection specific stuff, and now even more, so they're moved to TMySQLConnection now. In order to display the right collation even if only the character set was found in a CREATE TABLE code, the default collation per charset is detected via CollationTable. See http://www.heidisql.com/forum.php?t=6348 . 2010-10-08 20:16:53 +00:00
081858679a Split copy table query into two: a) CREATE and b) INSERT INTO target (..) SELECT (..) FROM src, to avoid "Duplicate column name" error on old 4.0 servers. Fixes issue #2205. 2010-10-07 21:51:09 +00:00
0fa6c15c9d Implement multiple connections per window. DBtree and friends now have their nodes bound to TDBObject instances. Fixes issue #2144. 2010-10-05 23:06:29 +00:00
f86a72dd36 Attempt to fix some weird effects on tree node selection and refreshing logic. Unhides "Data" tab after creating a new table. Fixes issue #2148. Details:
* Do process OnFocusChanged also while tree db refreshes, just avoid calling actEditObjectExecute.
* Make SelectedTable a property, rename to SelectedDbObj
* Remove calls to debug(), prefer LogSQL with lcDebug parameter
2010-09-15 23:09:43 +00:00
6fa29605fd SHOW VIEW may be not allowed. Disable VIEW editor in that case, but do not run regular expression into a no-match AV. Fixes issue #2159. 2010-09-08 19:48:18 +00:00
f323420ef1 Enable TDBObject instances to return and cache their own CREATE code, and replace various manual SHOW CREATE xyz occurrences with this new function call. Additionally, modify ParseViewStructure so it takes the CREATE code instead of just the VIEWs name, so it works similar to ParseTableStructure and ParseRoutineStructure. Finally, take this CREATE code to detect all settings for a VIEW, instead of taking them from information_schema.VIEWS. Fixes issue #2131. 2010-09-07 20:58:48 +00:00
88e7f7aa05 Implement query profiling in helpers box. Enhance usability of turning the listbox + tabset into a tree, with 5 root nodes instead of 5 tabs. Fixes issue #902. 2010-08-13 19:42:54 +00:00
33bf95ba12 Foreign key constraint symbol names must be unique in a database. To avoid violation errors the "Copy table" dialog should just leave the CONSTRAINT clause out from the CREATE TABLE code. In that case MySQL auto creates a valid name on demand. See http://www.heidisql.com/forum.php?t=6086 2010-06-30 23:37:23 +00:00
c15baee972 Fix recently broken support for views in "Copy table" dialog. 2010-06-16 22:30:03 +00:00
63be11dd14 Implement recent filters in "Copy table" dialog, selectable via button + dropdown menu. 2010-06-15 18:36:58 +00:00
3444383466 Tweak copy table dialog:
- display number of checked/total child nodes per option node
- display row count on "Data" option
- remove plus button from disabled option nodes, and do not check them
- code cosmetic
2010-06-14 22:52:06 +00:00
a6b761ba17 Enhancement: Prompt if target table exists, ask if it shall be dropped before creating the new table copy. 2010-06-14 17:28:54 +00:00
44e21a0fbd Bugfix: Only disable WHERE memo on first level "Data" node, not on second level nodes. 2010-06-14 17:19:40 +00:00
3f60d711e7 Enhancement: Disable "Indexes" and "Foreign keys" node to indicate they have 0 child nodes 2010-06-14 06:04:39 +00:00
56548f29c0 Bugfix: Mixed check state also means that this node was checked 2010-06-14 06:03:10 +00:00
c0da6e5a21 Refactor "Copy table" dialog:
* Replace checkboxes, radio buttons and checklistbox by a VirtualTree using checkbox support
* Support selecting/deselecting single indexes
* Support foreign keys
* Place a SynMemo at the bottom in which the user can type an optional WHERE clause to filter incoming data. Fixes issue #2000.
* Move code for SQL generation into TTableColumn etc.
2010-06-14 00:21:33 +00:00
b3b1710c35 Introduce EDatabaseError exception class, so we're able to handle only those and let others raise the exception up to MadExcept. Helps finding non-database related AVs as users are able to get the callstack now. Similar to r3292 but more consistent all over the code now. 2010-04-24 13:56:57 +00:00
97f01a175b Move database filter again from mainform to session manager, so people without privilege to run SHOW DATABASE are not stuck. Fixes issue #1485. Also, allow to see available databases when user does a dropdown. Also, simplify logic for refreshing database list in mainform. 2010-04-22 15:16:27 +00:00
cc0b931551 Internal refactoring: Directly bind TDBObject's to nodes in ListTables, instead of copying everything to an internal array structure first. Most events on ListTables have their own procedures now. Also, when selecting a database in the tree without expanding it and a query tab is selected, do not fetch objects. Could annoy some SQL writers which won't see the objects in selected db highlighted in that case. On the other hand this avoids loading objects in situations where you don't need them. For larger databases this should be really helpful, e.g. for the reporter of issue #1742. 2010-03-07 09:46:49 +00:00
5c37b3024d Old servers need TYPE instead of ENGINE in CREATE TABLE statement. Fixes issue #1732. 2010-03-01 07:52:23 +00:00
0e271ee7de Replace remaining loadXYZwindow() functions for dialogs by a more native way. 2010-02-21 10:44:55 +00:00
9080ad7607 No need to use the Wide* version of string functions any longer. 2010-01-15 20:28:48 +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
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
eff81d8e35 Code cosmetic: Let GetSelectedTable return a TDBObject which has the same properties as TListNode but even more. 2009-12-25 11:26:05 +00:00
e356cb7ed7 Sanitize all "uses" clauses from unneeded unit references. 2009-12-22 23:19:56 +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
44c0cfbfe8 Overtake comment of original table in "Create table copy". Fixes issue #1141. 2009-11-24 19:43:47 +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
b378aa7af3 Fix fatal error in "Copy table" dialog. Column names are handled case sensitive now. 2009-10-29 00:52:31 +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
c0f445185d Fix issue #1239: table copy from context menu copies wrong table 2009-07-21 06:10:18 +00:00
ffe82bc8c7 Bugfix: avoid calling FieldByName() with a field name that doesn't exist, it causes an exception. Fixes issue #1118. 2009-05-05 08:53:54 +00:00
f5c1839acd Fix target table lacking CURRENT_TIMESTAMP defaults in copy table dialog. (Issue #996) 2009-03-17 19:37:09 +00:00
4babc8c103 Include collation and engine in tables created by "Copy table" dialog. Fixes one part of issue #996. 2009-03-15 19:47:32 +00:00
d905f69e10 * Fix the various refresh menu items to use the one and only refresh TAction.
* Move the auto refresh items to main menu (Tools) so it is usable in all places now, including the Data tab (which makes it working similar to tail -f).
2009-01-14 21:30:06 +00:00
909d31fd64 Simplify writing settings to registry:
* Keep only one TRegistry object in memory instead of creating a new one in each routine.
* Move out relevant functions and TRegistry object from main to helpers to make them usable globally.
2009-01-03 17:16:11 +00:00
f1b3f5501f Remove last traces of MDI (issue #513). Merges code, controls and events from childwin into main. 2009-01-01 23:24:36 +00:00
30e6e5a403 Do not readd auto_increment property if indexes were deselected in copy table dialog. Issue #918. 2008-12-17 20:00:52 +00:00