Browse Source

* Fix+test bug #10345

git-svn-id: trunk@10349 -
joost 17 years ago
parent
commit
af564e4da5
2 changed files with 5 additions and 1 deletions
  1. 1 1
      packages/fcl-db/src/base/dsparams.inc
  2. 4 0
      packages/fcl-db/tests/testbasics.pas

+ 1 - 1
packages/fcl-db/src/base/dsparams.inc

@@ -296,7 +296,7 @@ begin
             else
             begin
               ParamNameStart:=p;
-              while not (p^ in (SQLDelimiterCharacters+[#0,'=','+','-','*','\','/','[',']'])) do
+              while not (p^ in (SQLDelimiterCharacters+[#0,'=','+','-','*','\','/','[',']','|'])) do
                 Inc(p);
               ParamName:=Copy(ParamNameStart,1,p-ParamNameStart);
             end;

+ 4 - 0
packages/fcl-db/tests/testbasics.pas

@@ -74,6 +74,10 @@ begin
   AssertEquals(     'select * from table where id = ?',
     params.ParseSQL('select * from table where id = :id',true,true,true,psInterbase));
 
+// Test bug 10345
+  AssertEquals(     'select email from table where upper(email) like ''%''||?||''%''',
+    params.ParseSQL('select email from table where upper(email) like ''%''||:email||''%''',true,true,true,psInterbase));
+
 // Test escape-sequences:
   AssertEquals(     'select * from table where ''id '''' = :id''',
     params.ParseSQL('select * from table where ''id '''' = :id''',true,False,True,psPostgreSQL));