Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows sqlite3.exe:如何停止长时间运行的SQL语句_Windows_Sqlite - Fatal编程技术网

Windows sqlite3.exe:如何停止长时间运行的SQL语句

Windows sqlite3.exe:如何停止长时间运行的SQL语句,windows,sqlite,Windows,Sqlite,如何停止在Windows上运行的sqlite3.exe中长时间运行的SQL语句 文件载列如下: 您可以通过键入系统来终止sqlite3程序 文件结尾字符(通常为Control-D)。使用中断 字符(通常是Control-C)停止长时间运行的SQL语句 但是在Windows上,Control-D什么也不做,Control-C终止sqlite3程序 我还尝试了中断(即控制暂停),其作用与Control-C相同 有什么想法吗?这似乎只是Windows上的一个bug 从SQLite查看中的代码,我看到在

如何停止在Windows上运行的sqlite3.exe中长时间运行的SQL语句

文件载列如下:

您可以通过键入系统来终止sqlite3程序 文件结尾字符(通常为Control-D)。使用中断 字符(通常是Control-C)停止长时间运行的SQL语句

但是在Windows上,Control-D什么也不做,Control-C终止sqlite3程序

我还尝试了中断(即控制暂停),其作用与Control-C相同


有什么想法吗?

这似乎只是Windows上的一个bug

从SQLite查看中的代码,我看到在
shell.c
中,如果定义了
SIGINT
,则注册了
SIGINT
(对应于Windows上的Control-c)的处理程序:

#ifdef SIGINT
  signal(SIGINT, interrupt_handler);
#endif
SIGINT
signal.h
中定义,但在Windows上故意将其排除在外:

#if !defined(_WIN32) && !defined(WIN32)
# include <signal.h>
# if !defined(__RTP__) && !defined(_WRS_KERNEL)
#  include <pwd.h>
# endif
# include <unistd.h>
# include <sys/types.h>
#endif

shell可以通过将所有合并的源文件添加到VisualStudioC++控制台项目中而容易构建(除了构建所需的标准/系统头之外,不存在外部依赖)。


我已经向SQLite用户邮件列表发送了一条消息,通知他们该错误。

从技术上讲,Ctrl+C确实停止了查询。谢谢,我还没有时间查看您的补丁,但是您的分析看起来很可靠,我肯定它会解决我的问题。如果您将它作为一个bug向SQLite维护人员提出,那将是非常好的。将您的答案标记为已接受并立即奖励:)谢谢,我已向SQLite邮件列表发送了一条消息,并使用我发送给他们的改进补丁更新了下面的答案。
757c757
< #ifdef SIGINT
---
> #if defined(SIGINT) || defined(_WIN32) || defined(WIN32)
766a767,782
> 
> #if defined(_WIN32) || defined(WIN32)
> /*
> ** Windows event handler
> */
> BOOL WINAPI CtrlHandler(DWORD dwType){ 
>   switch( dwType ){
>     case CTRL_C_EVENT: 
>       interrupt_handler(0);
>       return TRUE;
>  
>     default: 
>       return FALSE; 
>   } 
> }
> #endif
4207a4224,4225
> #elif defined(WIN32) || defined(_WIN32)
>   SetConsoleCtrlHandler(CtrlHandler, TRUE);