diff --git a/packages/delphi11/heidisql.dpr b/packages/delphi11/heidisql.dpr index 9fff450f..55ac51f9 100644 --- a/packages/delphi11/heidisql.dpr +++ b/packages/delphi11/heidisql.dpr @@ -35,7 +35,8 @@ uses routine_editor in '..\..\source\routine_editor.pas' {frmRoutineEditor}, table_editor in '..\..\source\table_editor.pas' {frmTableEditor}, mysql_api in '..\..\source\mysql_api.pas', - mysql_connection in '..\..\source\mysql_connection.pas'; + mysql_connection in '..\..\source\mysql_connection.pas', + cUnicodeCodecs in '..\..\source\cUnicodeCodecs.pas'; {$R ..\..\res\icon.RES} {$R ..\..\res\version.RES} diff --git a/packages/delphi11/heidisql.dproj b/packages/delphi11/heidisql.dproj index c12f8ec1..16a48cf5 100644 --- a/packages/delphi11/heidisql.dproj +++ b/packages/delphi11/heidisql.dproj @@ -129,6 +129,7 @@
CreateDatabaseForm
+
FrmDataViewSave
diff --git a/source/cUnicodeCodecs.pas b/source/cUnicodeCodecs.pas index b2e49b28..650cd6b9 100644 --- a/source/cUnicodeCodecs.pas +++ b/source/cUnicodeCodecs.pas @@ -2051,7 +2051,7 @@ begin if Size > 0 then begin P := Pointer(Result); - Q := @Buf; + //Q := @Buf; For I := 0 to Size - 1 do begin P^ := Q^; @@ -2166,7 +2166,7 @@ var I : AnsiChar; begin if Ch = #$FFFF then raise EConvertError.CreateFmt(SCannotConvert, [Ord(Ch), Encoding]); - P := @Map; + //P := @Map; for I := #$00 to #$FF do if P^ <> Ch then Inc(P) @@ -2193,7 +2193,7 @@ begin end; if Ch = #$FFFF then raise EConvertError.CreateFmt(SCannotConvert, [Ord(Ch), Encoding]); - P := @Map; + //P := @Map; for I := #$80 to #$FF do if P^ <> Ch then Inc(P) @@ -2220,7 +2220,7 @@ begin end; if Ch = #$FFFF then raise EConvertError.CreateFmt(SCannotConvert, [Ord(Ch), Encoding]); - P := @Map; + //P := @Map; for I := #$A0 to #$FF do if P^ <> Ch then Inc(P) diff --git a/source/mysql_connection.pas b/source/mysql_connection.pas index e07b2e24..baec308b 100644 --- a/source/mysql_connection.pas +++ b/source/mysql_connection.pas @@ -5,7 +5,7 @@ unit mysql_connection; interface uses - Classes, SysUtils, windows, mysql_api, mysql_structures, WideStrings, WideStrUtils; + Classes, SysUtils, windows, mysql_api, mysql_structures, WideStrings, WideStrUtils, cUnicodeCodecs; type @@ -673,7 +673,7 @@ end; function TMySQLQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): WideString; begin if (Column > -1) and (Column < ColumnCount) then - Result := Utf8Decode(FCurrentRow[Column]) + Result := UTF8StringToWideString(FCurrentRow[Column]) else if not IgnoreErrors then Raise Exception.CreateFmt('Column #%d not available. Query returned %d columns and %d rows.', [Column, ColumnCount, RecordCount]); end; diff --git a/source/table_editor.pas b/source/table_editor.pas index 4aac2bb2..572b9bce 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -334,7 +334,6 @@ begin editName.Text := FAlterTableName; Mainform.SetEditorTabCaption(Self, FAlterTableName); Results := Mainform.Connection.GetResults('SHOW TABLE STATUS LIKE '+esc(FAlterTableName)); - memoComment.Text := Results.Col(DBO_COMMENT); if Results.ColExists(DBO_ENGINE) then engine := Results.Col(DBO_ENGINE) else @@ -355,6 +354,11 @@ begin memoUnionTables.Text := rx.Match[1] else memoUnionTables.Clear; + rx.Expression := '\bCOMMENT=''((.+)[^''])'''; + if rx.Exec(CreateTable) then + memoComment.Text := WideStringReplace(rx.Match[1], '''''', '''', [rfReplaceAll]) + else + memoComment.Clear; rx.ModifierS := False; rx.ModifierM := True;