From 0ad436e7dc3ba3e90eea4c5326efafcd80c4907f Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 1 Mar 2010 22:05:43 +0000 Subject: [PATCH] Fix wrong maximum length restriction in popup text cell editor. Seems PMYSQL_FIELD._type returns wrong FIELD_TYPE_BLOB on a MEDIUMTEXT field - should be FIELD_TYPE_MEDIUM_BLOB. Also, other properties such as PMYSQL_FIELD.length and PMYSQL_FIELD.max_length return nonsense values here. --- source/main.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/main.pas b/source/main.pas index 31879bdd..460c3b05 100644 --- a/source/main.pas +++ b/source/main.pas @@ -3380,15 +3380,15 @@ var end; end; // Data type - DataGridResult.Columns[idx].DatatypeCat := Data.DataType(idx).Category; - DataGridResult.Columns[idx].Datatype := Data.DataType(idx).Index; + DataGridResult.Columns[idx].DatatypeCat := TblCol.DataType.Category; + DataGridResult.Columns[idx].Datatype := TblCol.DataType.Index; col.Alignment := taLeftJustify; case DataGridResult.Columns[idx].DatatypeCat of dtcInteger, dtcReal: col.Alignment := taRightJustify; dtcText: begin if TblCol.LengthSet <> '' then DataGridResult.Columns[idx].MaxLength := MakeInt(TblCol.LengthSet) - else case Data.DataType(idx).Index of + else case TblCol.DataType.Index of // 255 is the width in bytes. If characters that use multiple bytes are // contained, the width in characters is decreased below this number. dtTinyText: DataGridResult.Columns[idx].MaxLength := 255;