1948 Commits

Author SHA1 Message Date
d846ff4326 Remove dead code, previously used by rewritten parseSQL(). 2010-05-22 06:47:40 +00:00
3bc8ec6612 In OpenTextFile(), when detecting the file's encoding, loop through 100K of text instead of only 16K, to make it slightly more stable against BOMless files containing only few UTF8 chars. Fixes issue #1860. 2010-05-22 06:45:54 +00:00
6468776ba0 Display size of SQL file while loading into query editor, so it's easier to decide whether to load or run the file. 2010-05-22 06:34:09 +00:00
58b8f5451d "Run current query" ran previous query when cursor is placed behind the delimiter of it. Fixes issue #1956. 2010-05-22 06:19:53 +00:00
779b08bdc8 Fix offset number current query while executing a query batch. 2010-05-21 06:02:50 +00:00
336f991bc2 Display original length of snipped queries in SQL log. 2010-05-21 06:01:43 +00:00
698f078773 When exporting tables with various ENUM columns, these can distort the max-rows-calculation, based on the table's avg_row_len. Instead, examine the current stream's size at the end of each exported data row. Fixes issue #1682 - this time more effectively. 2010-05-20 19:55:29 +00:00
e38db938b7 Rewrite parseSQL routine into two new ones: GetSQLSplitMarkers() and SplitSQL(). Also, use these to turn "Run current line" query action into "Run current query". Fixes issue #821. 2010-05-20 18:30:55 +00:00
c733544585 Fix breakage of signed numbers in UnformatNumber(). 2010-05-18 22:21:20 +00:00
ec16b98755 Cosmetic: Add "approximately" notice behind InnoDB row count, so noone takes the value for real. Fixes issue #1945. 2010-05-18 18:40:15 +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
03394a8d96 Reformat SQL feature: Introduce a new list of keywords which followers shall not get separated into a new line. Just using the complete list of important keywords does not add a new line in front of WHERE and so on. Fixes issue #1942. 2010-05-15 08:50:59 +00:00
14d39481f1 Again add some more missing keywords to internal list which is used in "Reformat SQL" action besides other places. 2010-05-14 23:04:33 +00:00
f1ae13770d Bugfix: After click on password generator button, user was not marked as modified. 2010-05-14 22:37:53 +00:00
ab210d5758 Add CASE and WHEN to list of keywords, so they are uppercased in "Reformat SQL" action. 2010-05-13 08:50:06 +00:00
4e49324d03 Exports to database + server were missing SET FOREIGN_KEY_CHECKS header + footer. Moving critical Output() procedure from local to private scope, so we can call it in Execute(). Fixes issue #1915. 2010-05-12 19:14:45 +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
dd40361d81 Always invalidate db objects in "Database" tab in some refresh action. Active database is probably even indeterminable within a refresh and so a check for same db name fails and AVs follow because of non initialized nodes in ListTables. Fixes issue #1909. 2010-05-11 22:31:47 +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
10ae384a81 Avoid attempt to access item index -1 of internal value list when nothing is selected in an enum editor. Fixes issue #1903. 2010-05-10 18:37:07 +00:00
6c05e7f6c8 AnyGridEnsureFullRow does surely fail on non-result grids. Avoid AV when copying cell text. Fixes issue #1929. 2010-05-10 18:28:08 +00:00
556b0f54a1 Silence compiler warning 2010-05-09 20:46:51 +00:00
2d8633ffcf Enhance auto generation of foreign key names, after user selected the same reference table as in another key, a counter is appended (FK_tbl_rfr_2, FK_tbl_rfr_3, ...). Fixes issue #1894. 2010-05-09 10:04:42 +00:00
361580a03c Don't throw exceptions when user tries to set disallowed delimiter, just pop up an error message. Fixes issue #1899. Also, bring some nearby stuff in ExecSQLClick() into the right order: Show hour glass, display number of current query in status bar, and optimize some minor stuff. 2010-05-08 23:20:11 +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
593520dc1b Prefer server over local date/time as default value when starting grid editor on a NULL date/time. Fixes issue #1835. 2010-05-08 17:05:38 +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
de4c929020 Fix image view in grid cell. 2010-05-08 13:53:14 +00:00
634f5cb951 Ensure column correct lengths are set in SetRecNo. Fixes issue #1921. 2010-05-08 13:50:32 +00:00
88a524a1f0 Validate state of grid actions when query grid gets or loses focus. Fixes issue #1882. 2010-05-08 12:34:46 +00:00
fa9daf9406 Before inserting a new grid row, ensure current row modifications don't throw SQL errors. Related to issue #1882. 2010-05-08 12:19:36 +00:00
db5c5a1dc3 Ensure FCurrentResults is set, also in the special case when result has 0 rows, to avoid AVs in DatabaseName() and TableName(). Fixes issue #1917. 2010-05-08 10:37:34 +00:00
30ba2df509 Fix wrong example label in trigger editor. Fixes issue #1924. 2010-05-08 10:26:21 +00:00
6b6dd6f973 Reset indicators of currently loaded db.table in DataGrid when disconnecting. Fixes issue #1898. 2010-05-08 08:29:50 +00:00
ede2fab6f1 SaveModifications() should process all virtual rows, but ignore just inserted ones, so we can call InsertRow and then SaveModifications for yet modified rows. Fixes issue #1918. 2010-05-08 08:14:35 +00:00
18c08dc4d1 Handle all types of exceptions when renaming database, not only connection related ones. Fixes issue #1912. 2010-05-07 17:22:28 +00:00
0b1c6d350c Enable "Delete row(s)" action and friends after refreshing data grid. Fixes issue #1922. 2010-05-07 17:16:24 +00:00
646006715b Avoid access violation in EnsureFullRow when row cannot be found. Just return false in that case and block editing. Fixes issue #1910. 2010-05-07 15:43:08 +00:00
7ce555ff1a Straighten sort logic in lists and db tree:
* Let both header clicks and TDBObjectComparer consistently use the same compare callback function CompareAnyNode()
* When refreshing a list, VT.SortTree sorts nodes if toAutoSort is set. Then, selected nodes are mostly different ones than before refreshing. Also, what GetVTCaptions did was only looking after the first column caption which can exist besides duplicates. So, for now, do not restore selected nodes after refreshing a list, which is now more standard behavior.
Fixes issue #1911.
2010-05-06 22:46:35 +00:00
42899facff Update server version panel also on reconnect. Fixes issue #1891. 2010-05-06 18:41:17 +00:00
dc62492a34 Avoid exceeding range of FColumns within ColAttributes(). Fixes issue #1908. 2010-05-06 18:17:41 +00:00
05b07eb8f2 Implement editing capabilities into TMySQLQuery, and make query results editable by using all the same events as in DataGrid. Most probably some bugs to fix now.
* Fixes issue #723
* Fixes issue #873
2010-05-05 21:39:15 +00:00
8579ca2841 Avoid "No database selected" error when fetching trigger details in SQL export. Fixes issue #1883. 2010-04-27 19:47:20 +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
6bb8bb6875 Keep SQL errors quite but raise unnormal access violations, so the exception handler can catch them. 2010-04-23 20:51:36 +00:00