Issue Details (XML | Word | Printable)

Key: CORE-5711
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Greg Cunningham
Votes: 0
Watchers: 3

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

isql-fb does not create persistent history file

Created: 16/Jan/18 04:31 AM   Updated: 16/Jan/18 04:31 AM
Component/s: ISQL
Affects Version/s: 2.5.7
Fix Version/s: None

Environment: FreeBSD 11.1-RELEASE - various platforms

QA Status: No test

 Description  « Hide
By default, my isql-fb (FreeBSD) doesn't save a history file. I started using FB over a decade ago & have never seen persistent history in isql, so I assumed that it's not a feature.

 Today, I found that there is a function in isql.cpp viz:
 // Save SQL command (not isql's own commands) to a history file only if we
 // are in interactive mode.
 "void InputDevices::saveCommand(const char* statement, const char* term)"
        if (m_ifp.indev_fpointer == stdin)
                FILE* f = m_ofp.indev_fpointer;
                if (f)
                        fputs(statement, f);
                        fputs(term, f);
                        // Add newline to make the file more readable.
                        fputc('\n', f);
                        Command* command = new Command(statement, term);

I have not been able to determine how the file handle m_ofp.indev_fpointer gets initialized, Presumably it is meant to already have opened the history file. Maybe there is code missing for this.

FWIW, MS Windows users have ' IDS_DEF_HIST_FILE, "Unable to create default command history file %s"' (isql.rc) as a possible error.
Now, it looks suspiciously like there is intent in isql-fb to manage persistent command history that doesn't work.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.