mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
Replace old SQLDA/SQLVAR by XSQLDA/XSQLVAR. (#6820)
This commit is contained in:
parent
5ddf2bfca7
commit
4ab967b73f
@ -195,7 +195,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\PackageNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\Parser.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\StmtNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sym.h" />
|
||||
|
@ -569,9 +569,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -196,7 +196,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\PackageNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\Parser.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\StmtNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sym.h" />
|
||||
|
@ -572,9 +572,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -196,7 +196,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\PackageNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\Parser.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\StmtNodes.h" />
|
||||
<ClInclude Include="..\..\..\src\dsql\sym.h" />
|
||||
|
@ -572,9 +572,6 @@
|
||||
<ClInclude Include="..\..\..\src\dsql\pass1_proto.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\dsql\sqlda_pub.h">
|
||||
<Filter>Header files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "../dsql/dsql.h"
|
||||
#include "../dsql/sqlda.h"
|
||||
#include "gen/iberror.h"
|
||||
#include "../jrd/jrd.h"
|
||||
#include "../dsql/errd_proto.h"
|
||||
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* PROGRAM: C preprocessor
|
||||
* MODULE: sqlda.h
|
||||
* DESCRIPTION: DSQL definitions for non-DSQL modules
|
||||
*
|
||||
* 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): ______________________________________.
|
||||
*/
|
||||
|
||||
#ifndef DSQL_SQLDA_H
|
||||
#define DSQL_SQLDA_H
|
||||
|
||||
#include "../common/classes/array.h"
|
||||
|
||||
// SQLDA dialects
|
||||
|
||||
const USHORT DIALECT_sqlda = 0;
|
||||
const USHORT DIALECT_xsqlda = 1;
|
||||
|
||||
struct SQLVAR
|
||||
{
|
||||
SSHORT sqltype;
|
||||
SSHORT sqllen;
|
||||
SCHAR* sqldata;
|
||||
SSHORT* sqlind;
|
||||
SSHORT sqlname_length;
|
||||
SCHAR sqlname[30];
|
||||
};
|
||||
|
||||
struct SQLDA
|
||||
{
|
||||
SCHAR sqldaid[8];
|
||||
SLONG sqldabc;
|
||||
SSHORT sqln;
|
||||
SSHORT sqld;
|
||||
SQLVAR sqlvar[1];
|
||||
};
|
||||
|
||||
#define SQLDA_LENGTH(n) (sizeof (SQLDA) + (n - 1) * sizeof (SQLVAR))
|
||||
|
||||
#include "firebird/impl/sqlda_pub.h"
|
||||
|
||||
#endif // DSQL_SQLDA_H
|
@ -34,7 +34,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "../dsql/dsql.h"
|
||||
#include "../dsql/sqlda.h"
|
||||
#include "firebird/impl/sqlda_pub.h"
|
||||
#include "ibase.h"
|
||||
#include "../jrd/align.h"
|
||||
#include "../jrd/constants.h"
|
||||
|
@ -95,7 +95,7 @@ typedef struct
|
||||
/* SQL Dialects */
|
||||
/***************************/
|
||||
|
||||
#define SQL_DIALECT_V5 1 /* meaning is same as DIALECT_xsqlda */
|
||||
#define SQL_DIALECT_V5 1
|
||||
#define SQL_DIALECT_V6_TRANSITION 2 /* flagging anything that is delimited
|
||||
by double quotes as an error and
|
||||
flagging keyword DATE as an error */
|
||||
|
@ -30,23 +30,23 @@ extern "C" {
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__close(ISC_STATUS*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE gds__declare(ISC_STATUS*, const SCHAR*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE gds__describe(ISC_STATUS*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__describe_bind(ISC_STATUS*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__describe(ISC_STATUS*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__describe_bind(ISC_STATUS*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__dsql_finish(FB_API_HANDLE*);
|
||||
ISC_STATUS API_ROUTINE gds__execute(ISC_STATUS*, FB_API_HANDLE*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__execute(ISC_STATUS*, FB_API_HANDLE*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__execute_immediate(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*,
|
||||
SSHORT*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE gds__fetch(ISC_STATUS*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__fetch_a(ISC_STATUS*, int*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__open(ISC_STATUS*, FB_API_HANDLE*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__fetch(ISC_STATUS*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__fetch_a(ISC_STATUS*, int*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__open(ISC_STATUS*, FB_API_HANDLE*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__prepare(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*, const SCHAR*,
|
||||
const SSHORT*, const SCHAR*, SQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__to_sqlda(SQLDA*, int, SCHAR*, int, SCHAR*);
|
||||
const SSHORT*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE gds__to_sqlda(XSQLDA*, int, SCHAR*, int, SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_close(ISC_STATUS*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_declare(ISC_STATUS*, const SCHAR*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_dsql_finish(FB_API_HANDLE*);
|
||||
ISC_STATUS API_ROUTINE isc_dsql_release(ISC_STATUS*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_dsql_fetch_a(ISC_STATUS*, int*, int*, USHORT, int*);
|
||||
ISC_STATUS API_ROUTINE isc_dsql_fetch_a(ISC_STATUS*, int*, int*, USHORT, XSQLDA*);
|
||||
|
||||
ISC_STATUS API_ROUTINE isc_embed_dsql_close(ISC_STATUS*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_embed_dsql_declare(ISC_STATUS*, const SCHAR*, const SCHAR*);
|
||||
@ -76,8 +76,8 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_prepare(ISC_STATUS*, FB_API_HANDLE*, FB_AP
|
||||
ISC_STATUS API_ROUTINE isc_embed_dsql_release(ISC_STATUS*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_execute_immediate(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*,
|
||||
SSHORT*, const SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_fetch_a(ISC_STATUS*, int*, const SCHAR*, SQLDA*);
|
||||
int API_ROUTINE isc_to_sqlda(SQLDA*, int, SCHAR*, int, SCHAR*);
|
||||
ISC_STATUS API_ROUTINE isc_fetch_a(ISC_STATUS*, int*, const SCHAR*, XSQLDA*);
|
||||
int API_ROUTINE isc_to_sqlda(XSQLDA*, int, SCHAR*, int, SCHAR*);
|
||||
|
||||
ISC_STATUS API_ROUTINE isc_describe(ISC_STATUS*, const SCHAR*, XSQLDA*);
|
||||
ISC_STATUS API_ROUTINE isc_describe_bind(ISC_STATUS*, const SCHAR*, XSQLDA*);
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include "firebird.h"
|
||||
#include "../dsql/chars.h"
|
||||
#include "../dsql/sqlda.h"
|
||||
#include "firebird/impl/sqlda_pub.h"
|
||||
#include "../yvalve/gds_proto.h"
|
||||
#include "../yvalve/why_proto.h"
|
||||
#include "../yvalve/user__proto.h"
|
||||
@ -51,6 +51,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// SQLDA dialects
|
||||
const USHORT DIALECT_sqlda = 0;
|
||||
//const USHORT DIALECT_xsqlda = 1; // meaning is same as SQL_DIALECT_V5
|
||||
|
||||
using namespace Firebird;
|
||||
|
||||
enum name_type {
|
||||
@ -686,7 +690,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_release(ISC_STATUS* user_status, const SCH
|
||||
ISC_STATUS API_ROUTINE isc_dsql_fetch_a(ISC_STATUS* user_status,
|
||||
int* sqlcode,
|
||||
int* stmt_handle,
|
||||
USHORT dialect, int* sqlda)
|
||||
USHORT dialect, XSQLDA* sqlda)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -701,7 +705,7 @@ ISC_STATUS API_ROUTINE isc_dsql_fetch_a(ISC_STATUS* user_status,
|
||||
*sqlcode = 0;
|
||||
|
||||
const ISC_STATUS s = isc_dsql_fetch(user_status, reinterpret_cast<FB_API_HANDLE*>(stmt_handle),
|
||||
dialect, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
dialect, sqlda);
|
||||
if (s == 100)
|
||||
*sqlcode = 100;
|
||||
|
||||
@ -778,10 +782,10 @@ ISC_STATUS API_ROUTINE isc_fetch(ISC_STATUS* status_vector,
|
||||
|
||||
ISC_STATUS API_ROUTINE isc_fetch_a(ISC_STATUS* status_vector,
|
||||
int *sqlcode,
|
||||
const SCHAR* cursor_name, SQLDA* sqlda)
|
||||
const SCHAR* cursor_name, XSQLDA* sqlda)
|
||||
{
|
||||
return isc_embed_dsql_fetch_a(status_vector, sqlcode, cursor_name, DIALECT_sqlda,
|
||||
reinterpret_cast<XSQLDA*>(sqlda));
|
||||
sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE isc_open(ISC_STATUS* status_vector,
|
||||
@ -809,7 +813,7 @@ ISC_STATUS API_ROUTINE isc_dsql_release(ISC_STATUS* status_vector, const SCHAR*
|
||||
return isc_embed_dsql_release(status_vector, statement_name);
|
||||
}
|
||||
|
||||
int API_ROUTINE isc_to_sqlda(SQLDA* , // sqlda
|
||||
int API_ROUTINE isc_to_sqlda(XSQLDA* , // sqlda
|
||||
int , // number
|
||||
SCHAR* , // host_var
|
||||
int , // host_var_size
|
||||
@ -844,16 +848,16 @@ ISC_STATUS API_ROUTINE gds__declare(ISC_STATUS* status_vector,
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__describe(ISC_STATUS* status_vector,
|
||||
const SCHAR* statement_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_describe(status_vector, statement_name, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
return isc_describe(status_vector, statement_name, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__describe_bind(ISC_STATUS* status_vector,
|
||||
const SCHAR* statement_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_describe_bind(status_vector, statement_name, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
return isc_describe_bind(status_vector, statement_name, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__dsql_finish(FB_API_HANDLE* db_handle)
|
||||
@ -864,9 +868,9 @@ ISC_STATUS API_ROUTINE gds__dsql_finish(FB_API_HANDLE* db_handle)
|
||||
ISC_STATUS API_ROUTINE gds__execute(ISC_STATUS* status_vector,
|
||||
FB_API_HANDLE* tra_handle,
|
||||
const SCHAR* statement_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_execute(status_vector, tra_handle, statement_name, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
return isc_execute(status_vector, tra_handle, statement_name, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__execute_immediate(ISC_STATUS* status_vector,
|
||||
@ -880,15 +884,15 @@ ISC_STATUS API_ROUTINE gds__execute_immediate(ISC_STATUS* status_vector,
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__fetch(ISC_STATUS* status_vector,
|
||||
const SCHAR* statement_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_fetch(status_vector, statement_name, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
return isc_fetch(status_vector, statement_name, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__fetch_a(ISC_STATUS* status_vector,
|
||||
int* sqlcode,
|
||||
const SCHAR* statement_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_fetch_a(status_vector, sqlcode, statement_name, sqlda);
|
||||
}
|
||||
@ -896,9 +900,9 @@ ISC_STATUS API_ROUTINE gds__fetch_a(ISC_STATUS* status_vector,
|
||||
ISC_STATUS API_ROUTINE gds__open(ISC_STATUS* status_vector,
|
||||
FB_API_HANDLE* tra_handle,
|
||||
const SCHAR* cursor_name,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_open(status_vector, tra_handle, cursor_name, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
return isc_open(status_vector, tra_handle, cursor_name, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__prepare(ISC_STATUS* status_vector,
|
||||
@ -907,13 +911,13 @@ ISC_STATUS API_ROUTINE gds__prepare(ISC_STATUS* status_vector,
|
||||
const SCHAR* statement_name,
|
||||
const SSHORT* sql_length,
|
||||
const SCHAR* sql,
|
||||
SQLDA* sqlda)
|
||||
XSQLDA* sqlda)
|
||||
{
|
||||
return isc_prepare(status_vector, db_handle, tra_handle, statement_name,
|
||||
sql_length, sql, reinterpret_cast<XSQLDA*>(sqlda));
|
||||
sql_length, sql, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__to_sqlda(SQLDA* sqlda, int number,
|
||||
ISC_STATUS API_ROUTINE gds__to_sqlda(XSQLDA* sqlda, int number,
|
||||
SCHAR* host_variable, int host_variable_size,
|
||||
SCHAR* host_variable_name)
|
||||
{
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "gen/iberror.h"
|
||||
#include "gen/msg_facs.h"
|
||||
#include "../yvalve/YObjects.h"
|
||||
#include "../dsql/sqlda.h"
|
||||
#include "firebird/impl/sqlda_pub.h"
|
||||
#include "../common/gdsassert.h"
|
||||
#include "../common/db_alias.h"
|
||||
|
Loading…
Reference in New Issue
Block a user