From f2a89f28b8e252e095eb2b4b74c68b0bd26c2dcd Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 14 Jun 2013 04:26:13 +0000 Subject: [PATCH] Various variables are int64 or float, for which we have no specific editor other than the string editor. Do not quote these to avoid "Incorrect argument type to variable.." Fixes issue #3153. --- source/editvar.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/editvar.pas b/source/editvar.pas index e54a39da..bf920d57 100644 --- a/source/editvar.pas +++ b/source/editvar.pas @@ -4,7 +4,7 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, - dbconnection, mysql_structures, ComCtrls, gnugettext; + dbconnection, mysql_structures, ComCtrls, gnugettext, SynRegExpr; type TVarType = (vtString, vtNumeric, vtBoolean, vtEnum); @@ -171,7 +171,15 @@ begin case FVarType of vtNumeric: val := IntToStr(UpDownNumber.Position); - vtString: val := MainForm.ActiveConnection.EscapeString(editString.Text); + vtString: begin + // Various variables are int64 or float, for which we have no specific + // editor other than the string editor. Do not quote these to avoid + // "Incorrect argument type to variable.." See issue #3153. + if ExecRegExpr('^\d+(\.\d*)?$', FVarValue) then + val := editString.Text + else + val := MainForm.ActiveConnection.EscapeString(editString.Text); + end; vtBoolean: val := IntToStr(Integer(radioBooleanOn.Checked)); vtEnum: val := MainForm.ActiveConnection.EscapeString(comboEnum.Text); end;