NOW never changes during PSQL lifetime
--------------------------------------

                 Key: CORE-5090
                 URL: http://tracker.firebirdsql.org/browse/CORE-5090
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.5
         Environment: Windows 10, 64 bit OS, but 32 bit FB engine
            Reporter: Paul Gardner
            Priority: Minor


My understanding is that CURRENT_TIMESTAMP is the transaction start time. NOW 
on the other hand should be the current time always. I was in a situation where 
I needed a 30 second delay in a procedure to test something. I added temporary 
code to force a 30 second delay as follows:

counter = 0;
tmpTime = timestamp 'Now';
tmpTime2 = dateadd(30 second to tmpTime);
while (tmpTime < tmpTime2) do begin
   counter = counter + 1;
   tmpTime = timestamp 'Now';
end

Procedure never returns. I then added exception handling (I have an exception 
named 'EX' in my database):

if (counter = 100000000) then exception ex cast(tmpTime as varchar(40)) || ' ' 
|| cast(tmpTime2 as varchar(40));

This takes > 30 seconds to hit. It outputs the original values of the two 
variables. So setting tmpTime in the loop never actually does anything.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to