Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isql-fb does not create persistent history file [CORE5711] #5977

Open
firebird-automations opened this issue Jan 16, 2018 · 0 comments
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Greg Cunningham (gcunning)

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);
}
else
{
Command* command = new Command(statement, term);
commands.add(command);
}
}
}
...

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant