isql-fb does not create persistent history file
-----------------------------------------------
Key: CORE-5711
URL: http://tracker.firebirdsql.org/browse/CORE-5711
Project: Firebird Core
Issue Type: Bug
Components: ISQL
Affects Versions: 2.5.7
Environment: FreeBSD 11.1-RELEASE - various platforms
Reporter: Greg Cunningham
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel