> -----Original Message-----
> From: Claudio Valderrama C. [mailto:[email protected]]
> Sent: Jueves, 20 de Marzo de 2014 16:51
>
> F:\fb3dev\fbbuild\firebird30\temp\Win32\Debug\firebird>isql
> localhost:x.fdb
> -user sysdba -pass masterkey
> Statement failed, SQLSTATE = 28000
> Your user name and password are not defined. Ask your
> database administrator
> to set up a Firebird login.
> -attempt to fetch past the last record in a record stream
> Use CONNECT or CREATE DATABASE to specify a database
Apart from my doubt why sysdba is not a default user, I think
"attempt to fetch past the last record in a record stream"
should not appear as error. It's meaningless. I found the place in
SrpServer.cpp,
SrpServer::authenticate(...), line 177
stmt->execute(status, tra, par.metadata, par.buffer, dat.metadata,
dat.buffer);
if (!status->isSuccess())
{
status_exception::raise(status->get());
}
Here we get isc_stream_eof in the status vector and raise it. Later in the
same function we raise it again
catch(const Exception&)
{
LocalStatus s;
if (stmt) stmt->free(&s);
if (tra) tra->rollback(&s);
if (att) att->detach(&s);
throw;
}
We go back to server.cpp's ServerAuth::authenticate()
int authResult = forceNext ? Auth::AUTH_CONTINUE :
authServer->authenticate(&st,
authPort->port_srv_auth_block,
&authPort->port_srv_auth_block->authBlockWriter);
I wonder why the exception is not caught and converted into
case Auth::AUTH_FAILED:
HANDSHAKE_DEBUG(fprintf(stderr, "Srv: authenticate: No luck today -
status:\n"));
HANDSHAKE_DEBUG(isc_print_status(st.get()));
authServer = NULL;
working = false;
break;
so that code like this can run
loginFail(userName, authPort->getRemoteId());
Instead, the exception is allowed to unwind the stack more and we reach
server.cpp:accept_connection() but again the exception is not caught, so
code like this doesn't have a chance to run
case Auth::AUTH_FAILED:
setErrorStatus(&status);
accepted = false;
loginFail(port->port_login, port->getRemoteId());
break;
until we reach the catch() in process_packet(), but I think here's it's too
late to discriminate if the raw internal exception should be sent to the
user. The exception is sent to the client, but I think an internal message
caused by the query of the authenticating plugin should never go up to this
level. We have loginFail() for this purpose. If the plugin got no record or
too many records from the db is an error that should be shut up. It took me
a while to figure out where was the
"attempt to fetch past the last record in a record stream"
msg coming from and I repeat: the user should not see it.
C.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel