mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Provide a hack to let initialization happen on platforms for which
psqlodbc.c's constructor-making techniques do not work.
This commit is contained in:
parent
eb9033ce95
commit
5ab642fdf1
@ -15,19 +15,31 @@
|
|||||||
|
|
||||||
#include "environ.h"
|
#include "environ.h"
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
#include "dlg_specific.h"
|
||||||
#include "statement.h"
|
#include "statement.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
extern GLOBAL_VALUES globals;
|
||||||
|
|
||||||
/* The one instance of the handles */
|
/* The one instance of the handles */
|
||||||
ConnectionClass *conns[MAX_CONNECTIONS];
|
ConnectionClass *conns[MAX_CONNECTIONS];
|
||||||
|
|
||||||
|
|
||||||
RETCODE SQL_API SQLAllocEnv(HENV FAR *phenv)
|
RETCODE SQL_API SQLAllocEnv(HENV FAR *phenv)
|
||||||
{
|
{
|
||||||
static char *func = "SQLAllocEnv";
|
static char *func = "SQLAllocEnv";
|
||||||
|
|
||||||
mylog("**** in SQLAllocEnv ** \n");
|
mylog("**** in SQLAllocEnv ** \n");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hack for systems on which none of the constructor-making techniques
|
||||||
|
* in psqlodbc.c work: if globals appears not to have been initialized,
|
||||||
|
* then cause it to be initialized. Since this should be the first
|
||||||
|
* function called in this shared library, doing it here should work.
|
||||||
|
*/
|
||||||
|
if (globals.socket_buffersize <= 0)
|
||||||
|
getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE);
|
||||||
|
|
||||||
*phenv = (HENV) EN_Constructor();
|
*phenv = (HENV) EN_Constructor();
|
||||||
if ( ! *phenv) {
|
if ( ! *phenv) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user