Commit Graph

334 Commits

Author SHA1 Message Date
Ansgar Becker
d39517a8c2 Fix part 2 of "bug" 1803650 (actually not a bug but unwanted behaviour): Switch to "Database" tab if "Host" was active and a database is clicked in dbtree. 2007-10-01 18:43:06 +00:00
Ansgar Becker
7d96c41a53 - Fix detection of focused SynMemo in popupQueryPopup
- Fix initial enabled-status of "Paste" menuitem by setting the cursor into the relevant SynMemo when the contextmenu pops up. Should be handled automatically by SynMemo, but it doesn't. And no "FocusOnRightClick" property in sight.
- Don't hide Copy + Paste menuitems in SynMemoFilter. (Probably accidently hidden in rev 759)
2007-10-01 18:03:05 +00:00
Ansgar Becker
3b1bdbea7d Populate engine dropdown in CREATE TABLE dialog automatically if the server supports SHOW ENGINES. Preselect servers default engine. 2007-09-29 23:47:22 +00:00
Ansgar Becker
884574e05b Rename menuitem "Advanced table properties" to "Alter table ..." . According to the "Alter database ..." menuitem. 2007-09-29 23:31:38 +00:00
Ansgar Becker
f097207afd Remove redundant buttons/menuitems "Insert Record" from Database and Table tab. The functions was buggy and is already fullfilled by the button/menuitem "View data" and the Data tab itself. 2007-09-29 23:27:30 +00:00
Ansgar Becker
b98582f283 Follow up to prior commit: Set the event of the first toolbutton beneath ListTables to the same which is assigned to the relevant popupmenu. Adds (fixes) a needed call to ShowTable(). 2007-09-29 23:19:28 +00:00
Ansgar Becker
f150b336ff Fix AV and multiple times called procs since rev 961. PopulateTreeTableList lead to calling LoadDatabaseProperties, which then again lead to the AV in ListTablesDblClick. Reproduction:
1. Doubleclick a table in ListTables
2. Go back to Database tab and doubleclick another table. -> AV
3. Look at the SQL log - shows at least 2 times the SHOW COLUMNS FROM table

This commit sets the behaviour of PopulateTreeTableList + SetSelectedTable to gracefully ignore the change-events of dbtree while adding or deleting tree items. Avoids unwanted cascaded procedure calls in some places.
2007-09-29 23:10:48 +00:00
Ansgar Becker
ac8a9e4473 Add support for moving header columns in all 5 VirtualStringGrids and remembering their position between sessions. 2007-09-29 12:34:01 +00:00
Ansgar Becker
88c23b9705 Fix enabled-status of "Move column from or to index" buttons. 2007-09-28 21:39:29 +00:00
Ansgar Becker
6e9a08c12f Follow up to rev 870 and 958:
Implement an optimized and universal way to safe and restore the column visibibility of ListTables (and all other VirtualStringTrees) by merging that code with the code for the column-resizing feature.
- Drops global var ListTablesColumnNames and proc SetupListTablesHeader.
- Change + move "RestoreColumnWidths" to private "RestoreListSetup", add code from SetupListTablesHeader
- Change + move "SafeColumnWidths" to private "SafeListSetup", add code from MenuTablelistColumnsClick
- Default visible columns are (must be) set at design time now

Pro:
- RestoreListSetup is called once in FormShow, while SetupListTablesHeader was called each time in LoadDatabaseProperties.
- SafeListSetup is only called once in FormClose
- Just safes the column indexes, not the column names in registry. Makes it safe to rename columns in the future
- Less registry read/write access in general.
- Safe/RestoreListSetup open an easy way to implement further list features (column moving, etc.)
- Makes it a cakewalk to implement the same column un/hiding feature for the remaining 4 Lists.
Contra:
- people/developers who used a build from 870 to this one on will see their activated columns in ListTables reset to the default (7 first columns) because the registry key and value has changed. (but: better do that now than after an official relase)
2007-09-28 21:08:37 +00:00
Ansgar Becker
cfafa94e68 Fix needed after change in rev 961: createtable-dialog refreshed the cached table dataset twice. Set ActiveDatabase early, so we only need to call MenuRefreshClick instead of RefreshDbTableList + PopulateTreeTableList. 2007-09-28 19:02:06 +00:00
Ansgar Becker
515bee7049 Disable time consuming animation when DBtree items are deleted and restored. 2007-09-28 16:57:47 +00:00
Ansgar Becker
6f114624f4 Ensure PopulateTreeTableList does its job even when it's called with ForceRefresh=False and the node was already filled before. Refreshing the table status dataset again is not wanted when we
1. drop, create or rename table(s)
2. call RefreshDbTableList + LoadDatabaseProperties
3. call PopulateTreeTableList

Pro: Safes an extra and superflous "SHOW TABLE STATUS FROM..." query
Contra: PopulateTreeTableList is called in quite many places and doesn't exit early now
2007-09-28 16:55:45 +00:00
Ansgar Becker
c6fff14ed0 Refactor DROP TABLE procedure:
- Give the user a prettier confirmation message with listed tables to drop.
- Add documentation
- Drop large WITH .. DO statement
- Correctly call refresh-procedures
2007-09-28 16:43:59 +00:00
Ansgar Becker
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
Ansgar Becker
4f0d2b9403 Spam registry with column widths of all 5 VirtualTrees on FormClose. Restore these values in ReadWindowOptions. Should make users happy which resize columns precisely to fit their needs. 2007-09-26 20:45:10 +00:00
Ansgar Becker
a9d86b4bbd Stop D2007's behaviour of overwriting DCC_ResourcePath with what is given in one of the other DCC_*Path, by setting all paths to the same value. Fixes compiler error "VirtualTrees.res not found". 2007-09-26 19:46:09 +00:00
Ansgar Becker
c13318714e Upgrade old forms to use Tahoma font. Adjust widths of various TLabel's to make their captions fit with the new font. 2007-09-26 19:36:19 +00:00
Francisco Ernesto Teixeira
9ef861313b Installation: enable the support of creation of update package with Inno Setup 2007-09-25 20:59:22 +00:00
Ansgar Becker
6968817941 Minor enhancements and consistency fixes for CreateDatabase + CreateTable dialogs:
- Fetch charsets from collations dataset rather than firing an extra "SHOW CHARSET"
- Move fetching defaultCharset to existing TRY clause. No functionality change, just more consistent.
- Sort all comboboxes with charsets and collations alphabetically
- Leave the responsibility for disabling the comboboxes on old servers to the code rather than to the DFM file.
- Adapt Enabled-property of TLables to the comboboxes they belong to.
2007-09-25 18:47:34 +00:00
Francisco Ernesto Teixeira
ee1fb08158 SQL Process: handling of DELIMITER to mimic mysql CLI (minor fix) 2007-09-25 02:13:03 +00:00
Francisco Ernesto Teixeira
a8809f4975 SQL Process: handling of DELIMITER to mimic mysql CLI 2007-09-25 02:05:38 +00:00
Ansgar Becker
0ce5dd72a7 Preparation for coming 3.1 RC1 release "Gazelle" :) 2007-09-24 23:27:38 +00:00
Ansgar Becker
ceccf7dc68 Hide left gutter of SynMemoSQLLog. We neither display line numbers nor bookmarks there. 2007-09-24 23:17:48 +00:00
Ansgar Becker
b7e88148fc Set ActiveLineColor of SynMemoQuery to light yellow, just like in common editor applications. Should make writing queries slightly comfortable. 2007-09-24 23:12:24 +00:00
Ansgar Becker
adfac67b1a Nuke now superflous, redundant table features since we have them all gathered in "Advanced properties" dialog:
- Change table engine via popupmenu in ListTables
- Edit comment via same popupmenu + an own dialog

Not keeping the same feature in different corners of the application looks more straight forward. Users will have exactly one point where they can modify all table related properties. Should simplify it in the end, although some users will have to get used to it.
2007-09-24 22:00:43 +00:00
Ansgar Becker
69572e38a7 Create once and then cache tbl_properties_form when it's needed. Avoids querying COLLATIONS and ENGINES each time the form gets displayed. 2007-09-24 20:04:46 +00:00
Ansgar Becker
6a36dbf83f Minor fix for rev 944: Don't add auto_increment to ALTER statement if it was empty (was silently converted to "0"). 2007-09-24 20:02:39 +00:00
Ansgar Becker
b9155a63ef Minor: Give a menuitem a prettier name. 2007-09-24 19:57:41 +00:00
Ansgar Becker
d69d81a4b1 Renovate "Advanced properties" dialog:
- Drop pagecontrol to access more than one selected table. Didn't seem helpful for any case, looked ugly and was a click hell to use.
- Implement changeable editors for table name, comment, engine, charset, collation and auto_increment value.
- Backward compatibility kept: A 3.23.58 server leads to disabling editors for engine, charset and collation while keeping the others working.

A table's charset and collation can now be provided at creation time and at altering time. Just as it's implemented for databases. Fullfills now most of the wishes in RFE #1693393.
2007-09-24 19:56:16 +00:00
Ansgar Becker
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
Ansgar Becker
4b2af25072 Fix bug: MenuChangeTypeClick called MenuRefreshClick, which called RefreshActiveDbTableList + ShowDBProperties, but not LoadDatabaseProperties.
So, after changing the engine of a table the table status dataset was refreshed but never displayed, until having switched to a different db. So, MenuRefreshClick was loading but not displaying the table status.
2007-09-23 22:36:25 +00:00
Ansgar Becker
76a37d3552 Implement selection of character set and collation in "create table" dialog. 2007-09-23 12:24:26 +00:00
Ansgar Becker
e5410f177f - Add reasonable opCompress to default client-options
- TMySQLConnection.Query now returns the result if any. Fill RowsAffected and RowsFound at the same time.
- TMySQLConnection.GetRow / GetVar implemented for simple query-logic with minimal overhead.
- Give SetDatabase the chance to reset FDatabase to the prior value by catching a potential exception.
2007-09-20 21:54:51 +00:00
Ansgar Becker
febc6ac04e - Resolve hex and shifted numbers to readable integers
- Switch cardinal parameter to integer to avoid typecasting in callers. Safe, because mysql_num_fields will never return more than 2^31 columns - maximum columncount in MySQL is ~3000.
2007-09-20 21:38:50 +00:00
Ansgar Becker
b1d8ac345f Cleanly name TMySQLServerCapabilities and TMySQLClientOptions, so they tell what they're for. 2007-09-19 21:07:30 +00:00
Ansgar Becker
9b5c32ead1 - Extend TMySQLCapability record
- Implement TMySQLConnectionOptions, replace property "Compressed" by single option.
- Introduce published events for DB aware components
- Add register procedure to enable installation into IDE
- Correctly set Active := False before raising an exeption
- Reset Database property to old value if USE command was not successful
- Introduce QuoteIdent function
- Various half-ready code blocks in TDataset procedures
2007-09-19 21:03:10 +00:00
Ansgar Becker
9481386bdc - Sanitize API from Zeos specifics and unused types
- Clean indentation
2007-09-19 20:53:35 +00:00
Ansgar Becker
04e272e2c6 Display a SQL dynamic preview for the CREATE DATABASE statement using a SynMemo. 2007-09-18 22:44:17 +00:00
Ansgar Becker
5d00783b02 Safety fixes:
- Only generate COLLATE in CREATE DATABASE if CHARACTER SET was not empty.
- Surround CHARACTER SET + COLLATE in version conditional comment.
2007-09-18 22:19:01 +00:00
Ansgar Becker
917ede28d7 Implement new feature: "Alter database", reachable in rightclick menu from within dbtree. Supports renaming a database and changing existing charset + collation. 2007-09-18 22:10:55 +00:00
Ansgar Becker
a0fb2f7f1b Creation of databases should follow the servers charset by default, not the charset of the currently used database. 2007-09-18 16:13:59 +00:00
Ansgar Becker
7c05ba1f75 Recycle CreateDatabase-form after first usage / don't FreeAndNil' it. Avoids 3 SQL-queries for each calling time after the first one. 2007-09-18 16:10:29 +00:00
Ansgar Becker
e1d76db62d Suppress exception message about not finding the ActiveDatabase node in dbtree when
a) option "Remember last used database" is active
b) the last used db was dropped externally or
   the session was just opened with "OnlyDBs" in place and the last db is not contained in this list.
2007-09-17 23:23:29 +00:00
Ansgar Becker
1dbc19b16d Add contributor Mike Lischke for VirtualTreeView 2007-09-17 23:12:43 +00:00
Ansgar Becker
1e08e582e8 Partly fullfill feature wish #1693393 "Selection of charset and engine at creation"
By turning the CREATE DATABASE dialog from an InputQuery into a real form with 2 additional pulldowns:
- character set
- collation

See also: http://www.heidisql.com/forum/viewtopic.php?p=1322#1322
2007-09-17 23:11:39 +00:00
rosenfield
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
rosenfield
fab28c1068 Bugfix: Update control state in optimize table window when switching databases (see code). 2007-09-17 19:25:35 +00:00
rosenfield
4449a6c055 * Bugfix: regression from r903: Fix the last couple of cases where ExecUseQuery was being used to no effect.
* Make export table locks local to current connection work.
 * Bugfix: In non-file mode, export commands go directly to server without being parsed; thus they must not have semicolons at end of sentence.  A regression here causes issue #1747558 and issue #1795486, which this commit fixes again.

(Briefly considered adding a cleanSql() which just runs result := parseSql(sql)[0], which would do the same in fewer lines of code, albeit with the small overhead of having the semicolon both added and afterwards removed again..)
2007-09-17 19:10:38 +00:00
rosenfield
fe893ed517 Bugfix: regression from r903: optimize tables was malfunctioning. 2007-09-17 18:13:23 +00:00