108 Commits

Author SHA1 Message Date
4efb511b95 * Bugfix: after an edit, a new row which did not match the filter was included in the grid.
* Bugfix: the entire width of all fields of edited columns were loaded, instead of a limited view.
* Bugfix: (follow-up to above) one too many rows were included in RootNodeCount after less rows were matched than expected from the data source.
* Bugfix: some memory was not released as early as it could've been when less rows were matched than expected from the data source.

Hopefully fixes issue #730.
2008-09-08 16:09:20 +00:00
efbadf5b58 Fulfill rfe #692 "Add color-coding settings to data-appearance tab in preferences". Including new default color for ENUM fields and settings to enable/disable the grid editors. 2008-09-07 15:13:24 +00:00
1a3031414a * DPI fix: The node height of editable Virtual Trees was still not optimal as an editing node didn't have enough height to show the editing cursor. Steal some code from StdCtrls.TCustomEdit.AdjustHeight which does basically what we need here.
* Detected the VirtualTree.Header.ParentFont property and activated that instead of fixing the header font in FixVT
2008-09-06 18:38:51 +00:00
ff25e466d6 * Bugfix: fix issue #717.
* Rely on IsFloat instead of a more obscure check to determine float values.
2008-09-05 12:28:00 +00:00
ca726ca567 Normalize node heights in dbtree and all other virtual trees, make them slightly less high. Keeping 120 DPI compatibility for editing boxes.
Cosmetic todo: Fix Vista selection colors and tree collapse/expand buttons
2008-09-04 19:22:35 +00:00
86d034b7d0 * Exclude "0x" from XML and CSV files, making the hex strings easier to parse on import.
* Handle NULLs explicitly in HTML export.
* Switch CSV import defaults to match those used by export.  Helps with issue #709.
2008-09-04 13:07:48 +00:00
1defb9eaa6 * Bugfix: default enclose/separate for CSV should be " and ;. Takes care of export part of issue #709.
* Indicate in CSV files which rows need to be UNHEX()ed with LOAD DATA INFILE during import.  Takes care of export part of issue #709.
* Optimization: stop copying records and arrays to stack where appropriate.  See also note in helpers.pas.
* Factor out code to extract a cell in it's full width into EnsureFullWidth().
* Create method DiscardData() to release memory for a row.
* Bugfix: GridTo{Xml,Csv,Html} did not export cells in their full widths; they do now.  Fixes remainder of issue #685.
* Bugfix: remove superfluous field separator at end of each CSV record.
* Bugfix: CSV field enclose characters within field data must be escaped by printing the enclose character twice, as per de-facto (is it a standard when there are hundreds of applications supporting it, but *all* the major ones all come from the same company?..) CSV.
* Indicate in CSV files which cells are NULL by removing field enclosing (non-standard MySQL CSV extension).
* Indicate in XML files which cells are null and which cells are in hexadecimal format.
* Bugfix: always escape <, &, > in HTML and XML files.
2008-09-03 21:53:45 +00:00
c1e48c3bf5 Bugfix: buffer length is the input buffer, not the output buffer.
Bugfix: HexToBin() will simply stop when hitting invalid characters, make sure the buffers are valid in that case (should add code to raise an exception).
2008-09-02 20:09:55 +00:00
2efb248325 Virtual Tree needs a further fix for usage with custom DPI settings: its default node height is hardcoded and only works for 96 DPI. Make that dynamically by checking the grid's font height. Fixes issue #705: Unreadable text on Vista 2008-09-02 18:34:39 +00:00
881da41fa0 * Export binary data to SQL without corruption.
* Add todo notes in GridTo[Xml,Csv,Html}.
* Whitespace adjustments.

Partly fixes issue #659.
2008-09-02 15:05:02 +00:00
cc2f93b24e * Add a binary editor to allow editing (var)binary and (tiny|medium|long)blob fields without messing up NULs etc.
* Add a few notes about where AVs seem to randomly occur when GridPost{Insert,Update,Delete} and EnsureDataLoaded invokes the query logic from outside the main thread.

Fixes issue #659 as far as the grids go,  but not for export functions.
2008-09-01 21:46:28 +00:00
d60b1b6f93 Rename 'memoeditor' to 'texteditor', in preparation for inclusion of a binary editor. 2008-09-01 19:47:05 +00:00
084914b077 Sanitize GridToCSV/HTML/XML routines from redundant stream writing code. Introduce new StreamWrite() method, also used by wfs() which does slightly more than StreamWrite(). 2008-08-29 17:49:52 +00:00
76f2952a84 Try to fix issue #693 : Import CSV file: LOAD DATA fails with UTF-16 encoded file.
Pros:
- CSV/HTML/XML exports are now encoded as UTF-8, not UTF-16. Importing such CSV files should now work magically when using the Import CSV dialog.
- Exported files should now be significanty smaller when most content is latin1 encoded.
2008-08-28 16:05:56 +00:00
776fa891a8 Use WideDequotedStr as a replacement for the helpers:TrimC . Fixes Unicode in autocompletion logic. 2008-08-27 18:09:53 +00:00
d8f5674b3d Implement ENUM grid field editor, basically a combobox 2008-08-26 05:14:05 +00:00
3517253af7 Fix unicode table names and comments in alter table dialog 2008-08-19 23:01:31 +00:00
79d8db08b3 Support Unicode in list of wanted database names. 2008-08-19 21:35:04 +00:00
9ae9a3a768 Refactor dataset2html/csv/xml routines:
- Use TMemoryStreams for copy actions, TFileStreams for export actions. Should save some memory when saving to files and improves performance by factor ~100 on larger grid results.
- Fetch text from the Grid.Text, not from the underlying TGridResult.Rows array. Fixes issue #685 .
- Removes non functionial export of image files from BLOBs
- Sanitize helpers function from GUI code (mousecursor, opening result file, ...)

Todo:
- Limit export to a user defined number of rows. Important for large tables.
- Fetch entire TEXT field content, currently limited to 256 chars
2008-08-18 21:55:59 +00:00
3ddc5a849f Fix remaining ANSI escaping bug in esc(), related to bug #683 . 2008-08-16 06:14:44 +00:00
87a804275a Fix bug #683, cli version exports escaped and quoted like ANSI exports. 2008-08-15 20:42:21 +00:00
538cfde530 Fasten string replace by avoiding lots of SetLength(..., Length(...)+1) calls. Maybe. Haven't actually tested it ;-). 2008-08-14 20:23:53 +00:00
e0d847ed8a Fix bug #682 2008-08-14 18:59:28 +00:00
6e4cb43813 * Experimental: adjust row limit by dragging the data grid scrollbar instead of manually entering numbers in the toolbar.
* Experimental: fetch only first 256 bytes of large fields when loading rows into the data grid.
* Fixes rfe #362, rfe #459, rfe #475 and rfe #621.
2008-08-12 02:06:22 +00:00
c25f3ff8c7 Terminology: a column can be part of a primary key. 2008-08-11 21:24:47 +00:00
3b0f5be4bb Implement handling of maximum input length for the memo editor 2008-08-10 15:34:47 +00:00
aabd4bbf57 Add some more support for databases and tables with unicode characters. 2008-08-08 19:32:24 +00:00
bf24403596 * Crashed tables were mistaken for views. Fixes issue #650.
* Add separate node type for crashed tables, so that some sort of a graphic can be associated with those.
2008-08-07 23:17:28 +00:00
ad9ebc4161 Treat varchars in grids like text fields are treated: green color + memo editor 2008-08-07 23:07:03 +00:00
70370dca8c Always export files in UTF-8. 2008-08-07 19:44:40 +00:00
bfbf1ee2f1 Terminology update: a table consists of columns vs rows, and the intersection of a row and a column is called a field.
(Except for Delphi's TField and MySql's FIELD, obviously, which are harder to fix.)
2008-08-07 18:56:06 +00:00
b98c532c9e Fix bug #655: Export function failure with datatype double. Also applies for floats in WHERE clauses in grid editing. 2008-08-05 21:22:55 +00:00
732fadd17a Try to fix bug #620 "Export utf-8 table content broken" by using WideStrings in all relevant places. Couldn't find a way to fix TZConnection.GetEscapeString, so this replaces that call by WideStringReplace which should do the job as well (although I remember that was a performance problem on large memos).
Todo: TField.AsWideString seems to be broken for ftMemo fields with utf8 collation.
2008-08-04 20:39:33 +00:00
aa0bd953c6 Replace TNTDBGrids with VirtualTrees to enhance grid viewing and editing.
Affected issues: rfe #618, rfe #464, bug #324, bug #635 (maybe more)
Breaks: Unicode grid editing (due to yet unsolved bug #620), enum pulldowns, MEMO editing
Major changes:
  - editor tab at bottom completely removed, SQL log is always visible now.
  - memo, blob and enum editors don't have a replacement yet. This is left for later commits.
  - grid cells are colorized to signalize their datatypes
  - UPDATEs, DELETEs and INSERTs are composed by own code, no longer by Zeos internal mechanisms. Should make debugging easier.
  - UPDATEs + DELETEs on tables without unique key are blocked now.
  - editing in the query grid is always blocked. Would need some extensive parser to allow that.
2008-08-03 19:30:07 +00:00
68b4619b4c Code page 950 is Microsoft's implementation of the Big5 character set. Fixes issue #647. 2008-07-30 07:36:01 +00:00
db1dae81de Merge old code from IsValidDelimiter into Mainform.SetDelimiter so it creates the same validation error messages as before, also in parsesql() now. Formal adjustment: SetDelimiter raises an exception now for invalid values which has to be caught by parsesql() instead of just displaying a returned message string. 2008-07-08 22:16:04 +00:00
815aaaf3e7 Fix remembering delimiter string after detecting one with parsesql() 2008-07-07 05:38:37 +00:00
1d3bfe6219 Fix and simplify delimiter customizing, now that the dropdown was moved to the mainform and didn't fire the OnExit event any longer for some reason. The new mechanism just uses a button (surely including a new icon, sigh...) which asks via InputQuery for the new value. Delimmiter "validation" is only done when setting the value per button, not in parseSql() any longer - avoids being bug-per-bug compatible with MySQL's SQL parser at least in the non interactive mode.
(Hope that code is ok with Franciscos original implementation. At least the old validation IF's are adapted)
2008-07-06 20:22:16 +00:00
ab291881e1 Slightly enhance open SQL file mechanism:
- Open the file in "read and leave" mode, don't lock it for write operations. This fixes opening a file which is opened and write locked in another application
- Handle exceptions for ReadTextfile in QueryLoad which was malfunctioning yet, lead to an AV.
- Enhance inline documentation
2008-07-05 10:00:55 +00:00
84c3e0d260 Make various clipboard actions Unicode compliant:
- Copy (+ export to file) data as html, xml or csv
- Copy + paste actions in the grids
- Copy memo content
2008-06-26 12:37:34 +00:00
5c7631796f Add specific modes supposed to include various brokenness in mysqldump. Hopefully we won't have to discuss whether to account for a specific brokenness in mysqldump ever again. I almost couldn't be happier if MySQL actually fixed their bugs ;-). Fixes issue #537. 2008-06-25 05:46:19 +00:00
d137917930 Add code page 936 <-> gbk. 2008-06-25 04:23:00 +00:00
173aca5009 Make sstr() unicode compliant to fix bug #313 "Run SQL file dialog fails for German umlauts in file" 2008-06-24 20:22:00 +00:00
faf1c73da9 Fix compiler error, caused by accidently left testing line in last commit. 2008-06-22 17:48:55 +00:00
3a1d54da86 Fix bug #574 "UTF-8 textfiles without BOM are read as ANSI files". Split out character set detection to GetFileCharset and leave TStream creating in OpenTextFile(). 2008-06-22 17:45:11 +00:00
0dc750c1a7 Fix ReadTextfileChunk:
- Extend ChunkSize parameter to fit with Stream.Size
- Avoid exceeding file end if the passed ChunkSize is higher than the length of the left data
2008-06-19 19:38:39 +00:00
58230fea56 Rename ReadUnicodeFile to ReadTextfile and split it into 3 different procedures:
- OpenTextfile
- ReadTextfileChunk
- ReadTextfile
Enables us to use the unicode detection in places where we need to read a file chunkwise. (e.g. the runsqlfile unit)
TODO: Fix UTF-8 detection, misdetected as ANSI currently.
2008-06-19 19:08:54 +00:00
b2bf8a4828 Add helper "ReadUnicodeFile" 2008-06-17 22:27:13 +00:00
f7ad90cd40 Add helper "SaveUnicodeFile" 2008-06-17 19:16:11 +00:00
dced2df45e Make query execution unicode safe, mainly for a bunch of procedures and functions in Heidi itself plus various neighbours in Zeos. 2008-06-17 17:06:01 +00:00