Re: Control/C stops a query
Posted in 1996
Perhaps Johnathen can correct me if I am wrong .... Your application is one process and the engine is another. When you are executing an SQL statement, you are doing the following: 1) Establishing a connection to the engine. What I mean is you are passing a message to the engine about an SQL request you want to execute. 2) You are then waiting for a response from the Engine 3) You are posting an response from the engine. While this is occuring, the tty or ptty is being serviced. This process handles and buffers keystrokes. So when you press Control-C you are generating an interrupt. If you don't DEFER INTERRUPTS, then you front end process dies from a SIGINT event. If you do defer the interrupts, then your application will recieve the SIGINT and if it is waiting for a response to the query, it will send an SIGINT message (or equivlent) to the engine. Depending on what the engine is doing, it will process the event differently. It may recognize it, or it may ignore it. So, I guess its a matter of timing. Sort of like hitting control-c to stop the autoexec.bat in dos. I guess another example would be in real time embedded systems. Some code may disable or ignore the Watchdog/Timeout switch. -Mikey