142 Commits

Author SHA1 Message Date
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
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
18f67ffdc3 Internally, always use binary strings, not hex strings, when inserting or updating grid rows. Fixes SQL errors when actBlobAsText is activated and UPDATE sends unquoted "_binary foobar" as value. Fixes issue #2166. Also, do not reload grid data when activating text display. 2010-09-19 23:04:56 +00:00
3865d383da Avoid running SHOW TABLE STATUS FROM '' and friends on an empty database name, when trying to determine a column's origin. 2010-09-14 23:24:32 +00:00
4eb4a68f05 Adjust TDBObjectEditor so it works on its own instance of a TDBObject. Otherwise the object gets freed in ApplyModifications -> RefreshActiveTreeDB -> ClearDbObjects. Afterwards you got unpredictable results with the pointer to the old TDBObject, e.g. the wrong tree node was selected after that refresh. 2010-09-08 22:49:16 +00:00
909080245a Remember if create code of a view was fetched, successful or not. Avoids duplicated error messages in SQL log. 2010-09-08 19:58:37 +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
bad9c2cec3 Attempt to fix nil pointer exception (issue #2157) 2010-09-08 17:12:04 +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
461a50df40 Increase wait interval for externally run plink.exe from 1 to 4 seconds. Works around having the program left before it could establish a connection. See issue #1914. 2010-08-30 20:00:18 +00:00
36298ca567 Code cosmetic: Move code for initializing default properties of a TDBObject from TMySQLConnection.GetDBObjects (where this is done multiple times) to TDBObject.Create. 2010-08-28 15:22:40 +00:00
b87745d0d3 Implement fetching multiple results from one query, e.g. from a procedure call. Fixes remaining stuff in issue #1135. 2010-08-28 15:17:10 +00:00
dd051b95ac Internally cancel modification on running table editor when dropping its db object. Avoids asking for modifications after dropping, which then results in SQL errors. Fixes issue #1881. 2010-08-21 21:20:58 +00:00
455792dc3b Unescape escape sequences in table comment when loading a table into the table editor. Fixes issue #2118. 2010-08-14 15:36:56 +00:00
25fb0ed266 Refactor code in SQL help dialog, replace the TTreeView with a VirtualTree. 2010-07-31 17:16:08 +00:00
b3526fa9d1 If a session is configured to prompt for username + password, only prompt on the initial connect, not on each reconnection, which is annoying and superfluous. 2010-07-24 13:32:09 +00:00
f6e915b8d3 Table editor fails to detect the default collation on some tables. Fetch it from SHOW TABLE STATUS instead as fallback. See http://www.heidisql.com/forum.php?t=6202 2010-07-20 07:42:39 +00:00
8c34a9e15a Session manager: Add checkbox option for users who want to be prompted for username + password rather than saving that to registry. Prompt window itself is called from within TMySQLConnection.SetActive. 2010-07-19 20:06:09 +00:00
aad99190ae Table editor: Apply default length/set for new columns as long as user didn't touch it. Fixes issue #2084. 2010-07-14 10:52:34 +00:00
6b03976eb7 Attempt to fix some memory leaks in TMySQLQuery, when it gets destroyed. Should already be done by the compiler but who knows, probably this fixes issue #2063. 2010-07-13 17:59:00 +00:00
e7bfca41b4 Add LIMIT 1 clause to grid UPDATE queries, to make these safer on tables without sufficient unique key. Fixes issue #2079. 2010-07-11 18:56:19 +00:00
7cd1c7b0ab Add support for ZEROFILL flag in table editor. Introduces a new checkbox column in the columns list. Fixes issue #570. 2010-07-04 13:35: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
346e4698eb Be sure later calls to SetRecNo are executed after discarding a new grid row. Fixes issue #2031. 2010-06-22 05:39:45 +00:00
3ddf240983 Trim db names to ignore such minor typos. Fixes issue #2036. 2010-06-21 10:00:15 +00:00
35ea591027 Do not overtake empty strings in semicolon separated list of databases. Fixes issue #2032. 2010-06-21 06:03:13 +00:00
b215089ada Make data in VIEWs editable again by fetching table name and column names in a slightly different way. Fixes issue #1999. 2010-06-20 16:45:17 +00:00
edb9ce1487 Split identifiers with dot only in explicit cases, so column names containing a dot can be loaded and created. Fixes issue #2026. 2010-06-18 16:52:41 +00:00
e16d1bcc59 Fix wrong "DROP [index name]" clause when turning a normal key into a primary key. Fixes issue #2011. 2010-06-16 18:55:33 +00:00
e359ad2f98 Reset FRecNo after executing a new query, otherwise SetRecNo does nothing if FRecNo was already 0. Fixes issue #2009. 2010-06-14 21:50:27 +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
5bc81b96d2 Make grid scrolling incredibly much faster, by exiting early in SetRecNo if current row is already the right one. See http://www.heidisql.com/forum.php?t=5890 2010-06-11 21:04:52 +00:00
24295f111e Immediately prepare editing when data grid fetches rows, as that implicitly fixes BLOBs detection and enables "Image preview" action. Fixes issue #1948. 2010-06-11 19:52:42 +00:00
d81cc6cd7b Treat BLOBs like required in grid INSERTs and UPDATEs. Bug report: http://www.heidisql.com/forum.php?t=5883 2010-06-04 18:19:30 +00:00
f01823fb56 Fix AV when checking if "Image view" shall be enabled or disabled. Fixes issue #1974. 2010-05-31 22:18:05 +00:00
7c83d1a01e mysql_data_seek() is required for cumulated results (datagrid) on the very first row of an added result, to avoid AVs when that result has its cursor at the end or somewhere in the middle. Fixes an AV when exporting grid data. 2010-05-29 00:21:38 +00:00
5351f8df23 New feature: When mouse hovers over status bar panel holding the server version, display various connection related details in a hint. 2010-05-28 19:41:17 +00:00
9984bf0236 Issue #1135: Implement tabs for multiple batch results in a query tab. Does not yet show multi results of stored procedures. Maximum number of tabs is customizable in Preferences > Data. 2010-05-26 23:11:08 +00:00
53f3010689 Make QuotedDbAndTableName more universal, and let DatabaseName return current db on old servers early. 2010-05-22 07:03:03 +00:00
a353aa3008 Introduce helper function TMySQLConnection.DecodeAPIString() which auto decodes incoming data as required by charset. Also, call this on Field.name when fetching column names in TMySQLQuery.Execute - fixes issue #1943. 2010-05-15 17:11:53 +00:00
1ab975b0d5 Move responsibility for well formed floats and integers from TMySQLQuery.SetCol() to caller, so new values don't get touched at all, and to avoid double-unformatted numbers in "Duplicate row" feature. Fixes issue #1936. 2010-05-12 18:33:21 +00:00
d3711b5d62 Work around empty members of PMYSQL_FIELD on servers below 4.1 - org_name and db are empty on such servers, but Heidi needs both to compose safe and valid INSERT/UPDATE/DELETE queries. In order to at least allow grid editing, do some unsafe stuff for old servers: Never take db name into posted queries, neither use original fieldnames (instead, use the normal name). Should be ok as this is just to satisfy 2% of all Heidi users. Fixes issue #1934.
See also: http://dev.mysql.com/doc/refman/4.1/en/c-api-datatypes.html
2010-05-11 22:04:24 +00:00
133de5850a Remove unused member 2010-05-10 23:35:09 +00:00
1368508685 Do not display grid cells as modified if new value is effectively the same as the old one. Especially minimizes INSERTs for "Duplicate row" feature. 2010-05-10 23:34:36 +00:00
6355102eb0 In editing mode, when cursor points to a virtual edited row, we need to call mysql_data_seek() in SetRecNo, even if FRecNo points the previous row. Do that by checking for nil. Fixes issue #1931. Fixes issue #1919. 2010-05-10 23:26:47 +00:00
1319abe2c0 Number magic:
* Rewrite UnformatNumber() so it throws away characters other than digits, thousand or decimal separator. This is critical for adding WHERE clauses, where it was previously possible to update a whole table column accidentally: "UPDATE mytable SET numcol=123# WHERE id=567"
* Do not fetch last insert id when user passed a number to it. In that case LAST_INSERT_ID() would return 0
2010-05-10 22:04:21 +00:00
1838a0eaa7 Use original name of a foreign key in DROP FOREIGN KEY query when renaming. Fixes issue #1930. 2010-05-10 18:51:10 +00:00
e258f7ccec mysql_free_result() frees memory but does not set pointer to nil. Do that by hand, so later checks for nil don't run into AVs. Probably fixes issue #1901. 2010-05-08 17:49:47 +00:00
ae4b7faacd Binary column type detection is still a mess. But now TMySQLQuery parses its column names from a SHOW CREATE TABLE grid editing can benefit from the parsed stuff. Effect: data type of LEFT(bincol, 256) in data grid is re-detected when going into editing mode. Still displays these as green text before editing is tried, which could probably be solved by immediately call PrepareEditing for DataGrid result. 2010-05-08 15:53:37 +00:00
634f5cb951 Ensure column correct lengths are set in SetRecNo. Fixes issue #1921. 2010-05-08 13:50:32 +00:00