Beispiel #1
0
void PAR_warning(const Arg::StatusVector& v)
{
/**************************************
 *
 *	P A R _ w a r n i n g
 *
 **************************************
 *
 * Functional description
 *      This is for GBAK so that we can pass warning messages
 *      back to the client.  DO NOT USE this function until we
 *      fully implement warning at the engine level.
 *
 *	We will use the status vector like a warning vector.  What
 *	we are going to do is leave the [1] position of the vector
 *	as 0 so that this will not be treated as an error, and we
 *	will place our warning message in the consecutive positions.
 *	It will be up to the caller to check these positions for
 *	the message.
 *
 **************************************/
	fb_assert(v.value()[0] == isc_arg_warning);

	thread_db* tdbb = JRD_get_thread_data();

	// Make sure that the [1] position is 0 indicating that no error has occurred
	Arg::Gds p(FB_SUCCESS);

	// Now place your warning messages
	p.append(v);

	// Save into tdbb
	p.copyTo(tdbb->tdbb_status_vector);
}
Beispiel #2
0
bool ERR_post_warning(const Arg::StatusVector& v)
{
    /**************************************
     *
     *      E R R _ p o s t _ w a r n i n g
     *
     **************************************
     *
     * Functional description
     *	Post a warning to the current status vector.
     *
     **************************************/
    fb_assert(v.value()[0] == isc_arg_warning);

    size_t indx = 0, warning_indx = 0;
    ISC_STATUS* const status_vector = JRD_get_thread_data()->tdbb_status_vector;

    if (status_vector[0] != isc_arg_gds ||
            (status_vector[0] == isc_arg_gds && status_vector[1] == 0 &&
             status_vector[2] != isc_arg_warning))
    {
        // this is a blank status vector
        fb_utils::init_status(status_vector);
        indx = 2;
    }
    else
    {
        // find end of a status vector
        PARSE_STATUS(status_vector, indx, warning_indx);
        if (indx)
            --indx;
    }

    // stuff the warning
    if (indx + v.length() + 1 < ISC_STATUS_LENGTH)
    {
        memcpy(&status_vector[indx], v.value(), sizeof(ISC_STATUS) * (v.length() + 1));
        ERR_make_permanent(&status_vector[indx]);
        return true;
    }

    // not enough free space
    return false;
}
Beispiel #3
0
void ERR_make_permanent(Arg::StatusVector& v)
/**************************************
 *
 *	E R R _ m a k e _ p e r m a n e n t
 *
 **************************************
 *
 * Functional description
 *	Make strings in vector permanent
 *
 **************************************/
{
    ERR_make_permanent(const_cast<ISC_STATUS*>(v.value()));
}
Beispiel #4
0
void ERR_post_nothrow(const Arg::StatusVector& v)
/**************************************
 *
 *	E R R _ p o s t _ n o t h r o w
 *
 **************************************
 *
 * Functional description
 *	Create a status vector.
 *
 **************************************/
{
    fb_assert(v.value()[0] == isc_arg_gds);
    ISC_STATUS_ARRAY vector;
    v.copyTo(vector);
    ERR_make_permanent(vector);
    internal_post(vector);
}
Beispiel #5
0
// We've got a blr error other than a syntax error. Handle it.
static void par_error(BlrReader& blrReader, const Arg::StatusVector& v, bool isSyntaxError)
{
	fb_assert(v.value()[0] == isc_arg_gds);

	// Don't bother to pass tdbb for error handling
	thread_db* tdbb = JRD_get_thread_data();

	if (isSyntaxError)
	{
		blrReader.seekBackward(1);
		Arg::Gds p(isc_invalid_blr);
		p << Arg::Num(blrReader.getOffset());
		p.append(v);
		p.copyTo(tdbb->tdbb_status_vector);
	}
	else
		v.copyTo(tdbb->tdbb_status_vector);

	// Give up whatever we were doing and return to the user.
	ERR_punt();
}