You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: