mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Fix bugs
#1814411 "Incorrect SQL when changing structure on a field" #1814293 "Incorrect SQL when changing structure on a FLOAT field"
This commit is contained in:
@ -192,9 +192,7 @@ begin
|
|||||||
EditComment.Text := NodeData.Captions[5];
|
EditComment.Text := NodeData.Captions[5];
|
||||||
|
|
||||||
// extract field type
|
// extract field type
|
||||||
strtype := UpperCase( NodeData.Captions[1] );
|
strtype := UpperCase( getFirstWord( NodeData.Captions[1] ) );
|
||||||
if Pos ('(',strtype) > 0 then
|
|
||||||
strtype := Trim(copy (strtype,0,Pos ('(',strtype)-1));
|
|
||||||
|
|
||||||
// field field type structure
|
// field field type structure
|
||||||
for i := Low(MySqlDataTypeArray) to High(MySqlDataTypeArray) do
|
for i := Low(MySqlDataTypeArray) to High(MySqlDataTypeArray) do
|
||||||
|
@ -288,9 +288,14 @@ var
|
|||||||
p1,p2 : Integer;
|
p1,p2 : Integer;
|
||||||
begin
|
begin
|
||||||
p1 := pos('(', str);
|
p1 := pos('(', str);
|
||||||
if p1 = 0 then p2 := Length(str) + 1
|
Result := '';
|
||||||
else for p2:=strlen(pchar(str)) downto 0 do if str[p2] = ')' then break;
|
// Only return something if opening bracket was found, otherwise empty string
|
||||||
result := copy (str, p1+1, p2-p1-1);
|
if p1 > 0 then
|
||||||
|
begin
|
||||||
|
for p2:=strlen(pchar(str)) downto 0 do
|
||||||
|
if str[p2] = ')' then break;
|
||||||
|
result := copy (str, p1+1, p2-p1-1);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user