Menu

#2 Colons and Interrogation signs accepted in querys

v1.0
open
nobody
5
2009-04-23
2009-04-23
John Villar
No

There was a bug in the SQL pre-processing procedure that didn't allow the usage of colons (:) and interrogation signs (?) in any SQL query. This prevented from creating stored procedures and triggers programatically.

The patch is for the file runtime\MDOSQL.pas in the method TMDOSQL.PreprocessSQL around the lines 2384 below the comment:
{ Now act based on the current state }

The modification where there is:

'?', ':':
begin
iCurState := ParamState;
AddToProcessedSQL('?');
end;

Change it with:

'?', ':':
begin
if (cNextChar = cCurChar) then
begin
inc(i);
end else begin
iCurState := ParamState;
AddToProcessedSQL('?');
end;
end;

So you can escape colons and interrogations signs with double colons or double interrogation signs. :-)

Discussion


Log in to post a comment.

MongoDB Logo MongoDB