Issue Details (XML | Word | Printable)

Key: CORE-704
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Ctrl+C to cancel queries

Created: 04/Apr/04 12:00 AM   Updated: 17/Jun/07 12:09 PM
Component/s: ISQL
Affects Version/s: None
Fix Version/s: 2.1 Alpha 1

Time Tracking:
Not Specified

File Attachments: 1. Text File firebird-2.1.0.13360-isqlint.patch (2 kB)
2. Text File firebird-2.1.0.13360-isqlint.patch (2 kB)

Issue Links:
Relate
 

SF_ID: 929233


 Description  « Hide
SFID: 929233#
Submitted By: asfernandes

At this moment, pressing Ctrl+C in ISQL causes the
program termination.
Is more useful if Ctrl+C cancel the running query (i.e.
abort the output display).

Adriano.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michal Kubeček added a comment - 25/Jun/06 10:40 AM
Patch against 2.1.0.13360: if isql is interactive, SIGINT interrupts a query (only select). For non-interactive isql, program is terminated.

Michal Kubeček added a comment - 25/Jun/06 10:47 AM
Fixed wrong initial value of Interrupt_flag.

Adriano dos Santos Fernandes added a comment - 25/Jun/06 11:54 AM
Thanks Michal!
I'll write Windows code and commit together.

Adriano dos Santos Fernandes added a comment - 25/Jun/06 12:52 PM
Michal, at first glance I've think your patch is posix specific, but it works in Windows too.
But testing in Windows, second Ctrl+C causes process termination without entering in query_abort.
So I've changed it to call SetConsoleCtrlHandler returning appropriate value at query_abort and everything works correctly.

I do have only one comment, why remove "#include <signal.h>"?
We use signal and SIGINT, should it really be removed?

Michal Kubeček added a comment - 25/Jun/06 06:30 PM
It is not removed, it was included twice: once unconditionally and once depending on HAVE_SIGNAL_H. So I removed first #include and left only the second (conditional).