Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5ab642f

Browse files
committed
Provide a hack to let initialization happen on platforms for which
psqlodbc.c's constructor-making techniques do not work.
1 parent eb9033c commit 5ab642f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/interfaces/odbc/environ.c

+15-3
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,31 @@
1515

1616
#include "environ.h"
1717
#include "connection.h"
18+
#include "dlg_specific.h"
1819
#include "statement.h"
1920
#include <stdlib.h>
2021
#include <string.h>
2122

23+
extern GLOBAL_VALUES globals;
24+
2225
/* The one instance of the handles */
2326
ConnectionClass *conns[MAX_CONNECTIONS];
2427

2528

2629
RETCODE SQL_API SQLAllocEnv(HENV FAR *phenv)
2730
{
28-
static char *func = "SQLAllocEnv";
29-
30-
mylog("**** in SQLAllocEnv ** \n");
31+
static char *func = "SQLAllocEnv";
32+
33+
mylog("**** in SQLAllocEnv ** \n");
34+
35+
/*
36+
* Hack for systems on which none of the constructor-making techniques
37+
* in psqlodbc.c work: if globals appears not to have been initialized,
38+
* then cause it to be initialized. Since this should be the first
39+
* function called in this shared library, doing it here should work.
40+
*/
41+
if (globals.socket_buffersize <= 0)
42+
getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE);
3143

3244
*phenv = (HENV) EN_Constructor();
3345
if ( ! *phenv) {

0 commit comments

Comments
 (0)