0

The time specified in the waitfor delay is not honored in SQL Server Linux on Docker Desktop for Windows.

Script:

declare @tsstart varchar(100) = CONVERT (VARCHAR(100) , SYSDATETIME() ,121);
raiserror(@tsstart,0,0) with nowait;
WAITFOR DELAY '00:00:15';
declare @tend varchar(100)  = CONVERT (VARCHAR(100) ,SYSDATETIME(),121 );
raiserror(@tend,0,0) with nowait;

Output:

2021-03-25 23:05:23.4457947
2021-03-25 23:05:33.0387152

I would expect the @tend would be 2021-03-25 23:05:38.4457947 (because i specified 15 seconds in my waitfor.

The same code executes fine on a SQL Server installed on Windows 10 Pro (laptop). Anything I am missing?

Environment : SQL Server Linux (2019)

Microsoft SQL Server 2019 (RTM-CU9) (KB5000642) - 15.0.4102.2 (X64) 
    Jan 25 2021 20:16:12 
    Copyright (C) 2019 Microsoft Corporation
    Developer Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS) <X64>

Docker for Desktop Windows (Linux Container) (Docker engine: v20.10.5) Docker Version

praskutti
  • 21
  • 4
  • Is this repeatable in your instance? I tested on mine - SQL on Linux in Docker container and I only had millisecond differences. I have the same Docker version and SQL version as you. I have tested about 10 times and cannot repeat your results – Martin Cairney Mar 25 '21 at 23:29
  • @MartinCairney , yes it is repeatable, even after a restart (of both Docker Desktop and my laptop, the host) – praskutti Mar 25 '21 at 23:42
  • The difference becomes bigger with bigger WAITFOR values. For 10 seconds delay, it goes to next step in 7 (delta = 3); for a 15 second delay, it goes to next statement in 10 seconds (delta=5) – praskutti Mar 25 '21 at 23:44
  • Seeing as how it's SQL Server 2019, does `select * from sys.sql_feature_restrictions where feature='WaitFor'` return anything? I would expect no delay if that were active, though. – AlwaysLearning Mar 26 '21 at 14:13
  • @AlwaysLearning , Invalid object name 'sys.sql_feature_restrictions'. is what i get – praskutti Mar 27 '21 at 06:52

0 Answers0