2001-05-23 15:26:42 +02:00
|
|
|
/*
|
2002-04-04 07:35:21 +02:00
|
|
|
* PROGRAM: Dynamic SQL runtime support
|
2003-11-05 10:02:33 +01:00
|
|
|
* MODULE: movd.cpp
|
2001-05-23 15:26:42 +02:00
|
|
|
* DESCRIPTION: Data mover and converter and comparator, etc.
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
2001-07-30 01:43:24 +02:00
|
|
|
#include "firebird.h"
|
2001-05-23 15:26:42 +02:00
|
|
|
#include "../jrd/common.h"
|
2004-04-29 00:00:03 +02:00
|
|
|
#include <stdio.h>
|
2001-05-23 15:26:42 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "../dsql/dsql.h"
|
2003-11-11 13:19:20 +01:00
|
|
|
#include "gen/iberror.h"
|
2001-05-23 15:26:42 +02:00
|
|
|
#include "../jrd/iberr.h"
|
|
|
|
#include "../dsql/errd_proto.h"
|
|
|
|
#include "../dsql/movd_proto.h"
|
|
|
|
#include "../jrd/cvt_proto.h"
|
|
|
|
|
2003-04-10 08:32:58 +02:00
|
|
|
static void post_error(ISC_STATUS, ...);
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
|
2003-02-15 04:01:51 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
MOVD_move
|
|
|
|
|
|
|
|
@brief Move (and possible convert) something to something else.
|
|
|
|
|
|
|
|
|
|
|
|
@param from
|
|
|
|
@param to
|
|
|
|
|
|
|
|
**/
|
2003-10-05 08:27:16 +02:00
|
|
|
void MOVD_move(const dsc* from, dsc* to)
|
2001-05-23 15:26:42 +02:00
|
|
|
{
|
|
|
|
|
2003-11-03 18:14:45 +01:00
|
|
|
CVT_move(from, to, post_error);
|
2001-05-23 15:26:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-02-15 04:01:51 +01:00
|
|
|
/**
|
|
|
|
|
|
|
|
post_error
|
|
|
|
|
|
|
|
@brief A conversion error occurred. Complain.
|
|
|
|
|
|
|
|
|
|
|
|
@param status
|
|
|
|
@param
|
|
|
|
|
|
|
|
**/
|
2003-04-10 08:32:58 +02:00
|
|
|
static void post_error( ISC_STATUS status, ...)
|
2001-05-23 15:26:42 +02:00
|
|
|
{
|
2004-11-08 04:15:07 +01:00
|
|
|
ISC_STATUS *v;
|
|
|
|
const ISC_STATUS* temp, *v_end;
|
2003-04-16 12:18:51 +02:00
|
|
|
ISC_STATUS_ARRAY temp_status;
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-05-22 16:23:10 +02:00
|
|
|
tsql* tdsql = DSQL_get_thread_data();
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* copy into a temporary array any other arguments which may
|
|
|
|
* have been handed to us, then post the error.
|
|
|
|
* N.B., the last supplied error should be a 0.
|
|
|
|
*/
|
|
|
|
|
|
|
|
STUFF_STATUS(temp_status, status);
|
|
|
|
|
|
|
|
v = tdsql->tsql_status;
|
2004-11-08 04:15:07 +01:00
|
|
|
v_end = v + ISC_STATUS_LENGTH;
|
2003-11-11 13:19:20 +01:00
|
|
|
*v++ = isc_arg_gds;
|
|
|
|
*v++ = isc_dsql_error;
|
|
|
|
*v++ = isc_arg_gds;
|
|
|
|
*v++ = isc_sqlerr;
|
|
|
|
*v++ = isc_arg_number;
|
2001-05-23 15:26:42 +02:00
|
|
|
*v++ = -303;
|
|
|
|
|
2003-11-11 13:19:20 +01:00
|
|
|
for (temp = temp_status; v < v_end && (*v = *temp) != isc_arg_end;
|
2001-05-23 15:26:42 +02:00
|
|
|
v++, temp++)
|
2004-11-08 04:15:07 +01:00
|
|
|
{
|
2001-05-23 15:26:42 +02:00
|
|
|
switch (*v) {
|
2003-11-11 13:19:20 +01:00
|
|
|
case isc_arg_cstring:
|
2001-05-23 15:26:42 +02:00
|
|
|
*++v = *++temp;
|
|
|
|
*++v = *++temp;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
*++v = *++temp;
|
|
|
|
break;
|
2004-11-08 04:15:07 +01:00
|
|
|
}
|
|
|
|
}
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
ERRD_punt();
|
|
|
|
}
|
2003-10-05 08:27:16 +02:00
|
|
|
|