db-lib
for self-help.
More...Classes | |
struct | _dblib_error_message |
Defines | |
#define | DBSETLLABELED(x, y) dbsetlbool((x), (y), DBSETLABELED) |
Alternative way to set login packet fields. | |
#define | DBSETLVERSION(login, version) dbsetlversion((login), (version)) |
maps to the Microsoft (lower-case) function. | |
Typedefs | |
typedef _dblib_error_message | DBLIB_ERROR_MESSAGE |
Functions | |
int | _dblib_check_and_handle_interrupt (void *vdbproc) |
check interrupts for libtds. | |
RETCODE | dbcmdrow (DBPROCESS *dbproc) |
See if the current command can return rows. | |
DBINT | dbcount (DBPROCESS *dbproc) |
Get count of rows processed. | |
int | dbcurcmd (DBPROCESS *dbproc) |
Get number of the row just returned. | |
DBINT | dbcurrow (DBPROCESS *dbproc) |
Get number of the row currently being read. | |
DBBOOL | dbdead (DBPROCESS *dbproc) |
Check if dbproc is an ex-parrot. | |
DBINT | dbfirstrow (DBPROCESS *dbproc) |
Get number of the first row in the row buffer. | |
int | dbiordesc (DBPROCESS *dbproc) |
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server. (!). | |
int | dbiowdesc (DBPROCESS *dbproc) |
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server. (!). | |
DBINT | dblastrow (DBPROCESS *dbproc) |
Get number of the last row in the row buffer. | |
int | dbperror (DBPROCESS *dbproc, DBINT msgno, long errnum,...) |
Call client-installed error handler. | |
RETCODE | dbrows (DBPROCESS *dbproc) |
Indicate whether a query returned rows. | |
STATUS | dbrowtype (DBPROCESS *dbproc) |
Get returned row's type. | |
void | dbsetavail (DBPROCESS *dbproc) |
Mark a DBPROCESS as "available". | |
RETCODE | dbsetlbool (LOGINREC *login, int value, int which) |
Set a boolean value in a LOGINREC structure. | |
RETCODE | dbsetllong (LOGINREC *login, long value, int which) |
Set an integer value in a LOGINREC structure. | |
RETCODE | dbsetlname (LOGINREC *login, const char *value, int which) |
Set the value of a string in a LOGINREC structure. | |
RETCODE | dbsetlshort (LOGINREC *login, int value, int which) |
Set an integer value in a LOGINREC structure. | |
int | dbtds (DBPROCESS *dbproc) |
Get the TDS version in use for dbproc. | |
static int | default_err_handler (DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr) |
default error handler for db-lib (handles library-generated errors) | |
DBPROCESS * | tdsdbopen (LOGINREC *login, const char *server, int msdblib) |
Form a connection with the server. |
db-lib
for self-help.
These functions are of interest only to people hacking on the FreeTDS db-lib implementation.
|
Alternative way to set login packet fields.
|
|
maps to the Microsoft (lower-case) function.
|
|
For internal use only.
|
|
check interrupts for libtds.
|
|
See if the current command can return rows.
For internal use only.
|
|
Get count of rows processed.
For internal use only.
|
|
Get number of the row just returned.
For internal use only.
|
|
Get number of the row currently being read.
For internal use only.
|
|
Check if dbproc is an ex-parrot.
For internal use only.
|
|
Get number of the first row in the row buffer.
For internal use only.
|
|
Get file descriptor of the socket used by a
For internal use only.
|
|
Get file descriptor of the socket used by a
For internal use only.
|
|
Get number of the last row in the row buffer.
For internal use only.
|
|
Call client-installed error handler.
For internal use only.
Instead of sprinkling error text all over db-lib, we consolidate it here, where it can be translated (one day), and where it can be mapped to the TDS error number. The libraries don't use consistent error numbers or messages, so when libtds has to emit an error message, it can't include the text. It can pass its error number to a client-library function, which will interpret it, add the text, call the application's installed handler (if any) and return the handler's return code back to the caller. The call stack may look something like this:
The error handling in this case is unambiguous: the caller invokes this function, the client's handler returns its instruction, which the caller receives. Quite often the caller will get INT_CANCEL, in which case it should put its house in order and return FAIL. The call stack may otherwise look something like this:
Because different client libraries specify their handler semantics differently, and because libtds doesn't know which client library is in charge of any given connection, it cannot interpret the raw return code from a db-lib error handler. For these reasons, libtds calls _dblib_handle_err_message, which translates between libtds and db-lib semantics.
|
|
Indicate whether a query returned rows.
For internal use only.
|
|
Get returned row's type.
For internal use only.
|
|
Mark a
For internal use only.
|
|
Set a boolean value in a
For internal use only. Called by various macros to populate login.
|
|
Set an integer value in a
For internal use only. Called by various macros to populate login.
|
|
Set the value of a string in a
For internal use only. Called by various macros to populate login.
|
|
Set an integer value in a
For internal use only. Called by various macros to populate login.
|
|
Get the TDS version in use for dbproc.
For internal use only.
|
|
default error handler for db-lib (handles library-generated errors)
For internal use only. The default error handler doesn't print anything. If you want to see your messages printed, install an error handler. If you think that should be an optional compile- or run-time default, submit a patch. It could be done.
|
|
Form a connection with the server.
For internal use only.
Called by the
|