FAQ
Hello,

This is a report on my attempts to install unixODBC (1.8.9) and postgres
odbc driver on IRIX 6.5.7 64bit using the native compiler. There are a
number of changes that were necessary to be made on both the
configuration files and source to get it to compile. patches are
attached. some of these were derived from 1.8.8, but they all apply
successfully on 1.8.9.

UnixODBC
--------

1- you can ignore the changes to acinclude.m4. they are a hack to
augment the qt libraries for my platform. a more thoughtful allowance
for this possibility though might be needed.

2- I had to propagate USER_LDFLAGS into DataManager/Makefile.in,
ODBCConfig/Makefile.in and odbctest/Makefile.am adding it to LDADD
flags. There is no reason not to and they were needed in my case to find
all qt related libraries.

3- The IRIX native compiler does not like having new lines in strings. I
had to delete spurious new lines from a few strings in
DataManager/classLogin.cpp and DataManager/classISQL.cpp

4- default values for function arguments were defined twice in a number
of files. in the headers as well as in cpp files. IRIX compiler does not
like that besides it is a maintenance burden. I kept the default
arguments in the header files only (see patch).

5- Needed to insert explicit type casts in some places as well as
leading function prototypes (see patch).

Postgres ODBC driver
--------------------

6- One bug that was hard to track was related to the postgres driver.
The driver defines #define Int4 long int; in psqlodbc.h. unfortunately,
when compiling 64bit a long int is 8 bytes. for my setup I hacked it by
changing that to #define Int4 int; which I think is probably appropriate
on most platforms. But this type should really be determined at
configure time.

Regards


--
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884 Fax: 212-305-6926

Search Discussions

  • Nick Gorham at Jun 14, 2000 at 11:14 pm

    Murad Nayal wrote:

    Hello,

    This is a report on my attempts to install unixODBC (1.8.9) and postgres
    odbc driver on IRIX 6.5.7 64bit using the native compiler. There are a
    number of changes that were necessary to be made on both the
    configuration files and source to get it to compile. patches are
    attached. some of these were derived from 1.8.8, but they all apply
    successfully on 1.8.9.
    Thanks for that, I will apply the changes, I had checked unixODBC on a 64 bit alpha platform, but its not a suprise that some have escaped.

    --
    To me vi is Zen. To use vi is to practice zen. Every command is
    a koan. Profound to the user, unintelligible to the uninitiated.
    You discover truth everytime you use it.
    -- reddy@lion.austin.ibm.com
  • Bruce Momjian at Jun 15, 2000 at 2:18 pm
    Is this patch based on the current snapshot? I have applied several
    unixODBC patches in the past several days that may already fix these
    problems.


    Hello,

    This is a report on my attempts to install unixODBC (1.8.9) and postgres
    odbc driver on IRIX 6.5.7 64bit using the native compiler. There are a
    number of changes that were necessary to be made on both the
    configuration files and source to get it to compile. patches are
    attached. some of these were derived from 1.8.8, but they all apply
    successfully on 1.8.9.

    UnixODBC
    --------

    1- you can ignore the changes to acinclude.m4. they are a hack to
    augment the qt libraries for my platform. a more thoughtful allowance
    for this possibility though might be needed.

    2- I had to propagate USER_LDFLAGS into DataManager/Makefile.in,
    ODBCConfig/Makefile.in and odbctest/Makefile.am adding it to LDADD
    flags. There is no reason not to and they were needed in my case to find
    all qt related libraries.

    3- The IRIX native compiler does not like having new lines in strings. I
    had to delete spurious new lines from a few strings in
    DataManager/classLogin.cpp and DataManager/classISQL.cpp

    4- default values for function arguments were defined twice in a number
    of files. in the headers as well as in cpp files. IRIX compiler does not
    like that besides it is a maintenance burden. I kept the default
    arguments in the header files only (see patch).

    5- Needed to insert explicit type casts in some places as well as
    leading function prototypes (see patch).

    Postgres ODBC driver
    --------------------

    6- One bug that was hard to track was related to the postgres driver.
    The driver defines #define Int4 long int; in psqlodbc.h. unfortunately,
    when compiling 64bit a long int is 8 bytes. for my setup I hacked it by
    changing that to #define Int4 int; which I think is probably appropriate
    on most platforms. But this type should really be determined at
    configure time.

    Regards


    --
    Murad Nayal M.D. Ph.D.
    Department of Biochemistry and Molecular Biophysics
    College of Physicians and Surgeons of Columbia University
    630 West 168th Street. New York, NY 10032
    Tel: 212-305-6884 Fax: 212-305-6926
    *** ./acinclude.m4.bk1 Wed Jun 14 13:30:52 2000
    --- ./acinclude.m4 Wed Jun 14 00:47:35 2000
    ***************
    *** 562,568 ****
    fi
    AC_MSG_CHECKING([for Qt])

    ! LIBQT="$LIBQT -lXext -lX11 $LIBSOCKET"
    ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
    qt_libraries=""
    qt_includes=""
    --- 562,568 ----
    fi
    AC_MSG_CHECKING([for Qt])

    ! LIBQT="$LIBQT -ljpeg -lSM -lICE -lXext -lX11 $LIBSOCKET"
    ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
    qt_libraries=""
    qt_includes=""
    ***************
    *** 693,699 ****
    AC_SUBST(QT_LDFLAGS)
    AC_PATH_QT_MOC

    ! LIB_QT='-lqt $(LIBPNG) -lXext $(LIB_X11)'
    AC_SUBST(LIB_QT)

    ])
    --- 693,699 ----
    AC_SUBST(QT_LDFLAGS)
    AC_PATH_QT_MOC

    ! LIB_QT='-lqt $(LIBPNG) -ljpeg -lSM -lICE -lXext $(LIB_X11)'
    AC_SUBST(LIB_QT)

    ])
    *** ./DataManager/Makefile.in.bk1 Wed Jun 14 13:28:47 2000
    --- ./DataManager/Makefile.in Tue Jun 13 13:25:30 2000
    ***************
    *** 176,182 ****

    @QT_TRUE@INCLUDES = -I../include @QT_INCLUDES@

    ! @QT_TRUE@DataManager_LDADD = @X_LDFLAGS@ @QT_LDFLAGS@ @LIB_QT@ ../odbcinst/libodbcinst.la ../DriverManager/libodbc.la

    @QT_TRUE@DataManager_DEPENDANCIES = ../odbcinst/libodbcinst.la ../DriverManager/libodbc.la

    --- 176,182 ----

    @QT_TRUE@INCLUDES = -I../include @QT_INCLUDES@

    ! @QT_TRUE@DataManager_LDADD = @X_LDFLAGS@ @QT_LDFLAGS@ @USER_LDFLAGS@ @LIB_QT@ ../odbcinst/libodbcinst.la ../DriverManager/libodbc.la

    @QT_TRUE@DataManager_DEPENDANCIES = ../odbcinst/libodbcinst.la ../DriverManager/libodbc.la

    *** ./ODBCConfig/Makefile.in.bk1 Tue Jun 13 13:18:55 2000
    --- ./ODBCConfig/Makefile.in Tue Jun 13 13:25:00 2000
    ***************
    *** 176,182 ****

    @QT_TRUE@INCLUDES = -I../include @QT_INCLUDES@ -DSYSTEM_FILE_PATH=\"@sysconfdir@\" -DDEFLIB_PATH=\"@libdir@\" $(INCLTDL)

    ! @QT_TRUE@ODBCConfig_LDADD = @X_LDFLAGS@ @QT_LDFLAGS@ @LIB_QT@ ../odbcinst/libodbcinst.la ../extras/libodbcextraslc.la

    @QT_TRUE@ODBCConfig_DEPENDANCIES = ../odbcinst/libodbcinst.la ../extras/libodbcextraslc.la

    --- 176,182 ----

    @QT_TRUE@INCLUDES = -I../include @QT_INCLUDES@ -DSYSTEM_FILE_PATH=\"@sysconfdir@\" -DDEFLIB_PATH=\"@libdir@\" $(INCLTDL)

    ! @QT_TRUE@ODBCConfig_LDADD = @X_LDFLAGS@ @QT_LDFLAGS@ @USER_LDFLAGS@ @LIB_QT@ ../odbcinst/libodbcinst.la ../extras/libodbcextraslc.la

    @QT_TRUE@ODBCConfig_DEPENDANCIES = ../odbcinst/libodbcinst.la ../extras/libodbcextraslc.la

    *** odbctest/Makefile.am.bk1 Wed Jun 14 15:16:22 2000
    --- odbctest/Makefile.am Wed Jun 14 15:16:37 2000
    ***************
    *** 6,11 ****
    --- 6,12 ----

    odbctest_LDADD = @X_LDFLAGS@ \
    @QT_LDFLAGS@ \
    + @USER_LDFLAGS@ \
    @LIB_QT@ \
    ../odbcinst/libodbcinst.la \
    ../DriverManager/libodbc.la
    *** ./DataManager/classLogin.cpp.bk1 Tue Jun 13 14:20:07 2000
    --- ./DataManager/classLogin.cpp Tue Jun 13 14:20:57 2000
    ***************
    *** 85,93 ****
    QMessageBox::warning( this, "Data Manager", szBuf);
    else
    /* END TIM */
    ! QMessageBox::warning( this, "Data Manager", "Login failed\n\nThis may
    ! be for one of these reasons;\n1. invalid ID and Password\n2. invalid Data
    ! Source config\n3. improper installation" );
    return;
    }

    --- 85,91 ----
    QMessageBox::warning( this, "Data Manager", szBuf);
    else
    /* END TIM */
    ! QMessageBox::warning( this, "Data Manager", "Login failed\n\nThis may be for one of these reasons;\n1. invalid ID and Password\n2. invalid Data Source config\n3. improper installation" );
    return;
    }

    *** ./DataManager/classISQL.cpp.bk1 Tue Jun 13 13:49:38 2000
    --- ./DataManager/classISQL.cpp Tue Jun 13 13:50:56 2000
    ***************
    *** 140,147 ****
    // CREATE A STATEMENT
    iRC = SQLAllocStmt( hDbc, &hStmt );
    if( SQL_SUCCESS != iRC )
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed:
    ! SQLAllocStmt " );

    if( SQL_SUCCESS != (iRC=SQLPrepare(hStmt,
    (SQLCHAR*)(txtSQL->text().data()), SQL_NTS)) )
    --- 140,146 ----
    // CREATE A STATEMENT
    iRC = SQLAllocStmt( hDbc, &hStmt );
    if( SQL_SUCCESS != iRC )
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed: SQLAllocStmt " );

    if( SQL_SUCCESS != (iRC=SQLPrepare(hStmt,
    (SQLCHAR*)(txtSQL->text().data()), SQL_NTS)) )
    ***************
    *** 151,158 ****
    if (retcode == SQL_SUCCESS)
    QMessageBox::critical( (QWidget *)this, "Data Manager", szBuf);
    else
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed:
    ! SQLPrepare " );
    }

    // EXECUTE
    --- 150,156 ----
    if (retcode == SQL_SUCCESS)
    QMessageBox::critical( (QWidget *)this, "Data Manager", szBuf);
    else
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed: SQLPrepare " );
    }

    // EXECUTE
    ***************
    *** 163,170 ****
    if (retcode == SQL_SUCCESS)
    QMessageBox::critical( (QWidget *)this, "Data Manager", szBuf);
    else
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed:
    ! SQLExecute " );
    }

    // GET NUMBER OF ROWS AFFECTED
    --- 161,167 ----
    if (retcode == SQL_SUCCESS)
    QMessageBox::critical( (QWidget *)this, "Data Manager", szBuf);
    else
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed: SQLExecute " );
    }

    // GET NUMBER OF ROWS AFFECTED
    ***************
    *** 186,193 ****
    // FREE STATEMENT
    iRC = SQLFreeStmt( hStmt, SQL_DROP );
    if( SQL_SUCCESS != iRC )
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed:
    ! SQLFreeStmt " );

    pTabBar->setCurrentTab( 1 );
    txtResults->show();
    --- 183,189 ----
    // FREE STATEMENT
    iRC = SQLFreeStmt( hStmt, SQL_DROP );
    if( SQL_SUCCESS != iRC )
    ! QMessageBox::critical( (QWidget *)this, "Data Manager", "Failed: SQLFreeStmt " );

    pTabBar->setCurrentTab( 1 );
    txtResults->show();
    *** ./odbctest/odbctest.cpp.bk1 Tue Jun 13 14:33:54 2000
    --- ./odbctest/odbctest.cpp Tue Jun 13 14:34:23 2000
    ***************
    *** 687,693 ****
    return a.exec();
    }

    ! Handle::Handle( int t, SQLHANDLE h, QString desc = NULL, SQLHANDLE stmt = SQL_NULL_HANDLE )
    {
    type = t;
    handle = h;
    --- 687,693 ----
    return a.exec();
    }

    ! Handle::Handle( int t, SQLHANDLE h, QString desc, SQLHANDLE stmt)
    {
    type = t;
    handle = h;
    *** ./libltdl/ltdl.c.bk1 Sun Jun 11 23:35:11 2000
    --- ./libltdl/ltdl.c Sun Jun 11 23:35:34 2000
    ***************
    *** 210,218 ****

    /* dynamic linking with dlopen/dlsym */

    - #if HAVE_DLFCN_H
    # include <dlfcn.h>
    - #endif

    /*
    * GLOBAL is not a good thing for us, it breaks perl amonst others
    --- 210,216 ----
    *** ./Drivers/txt/SQLStatistics.c.bk1 Fri May 26 16:55:21 2000
    --- ./Drivers/txt/SQLStatistics.c Fri May 26 16:55:43 2000
    ***************
    *** 58,64 ****
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols( hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    --- 58,64 ----
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols((SQLHSTMT) hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    *** ./Drivers/txt/SQLColumns.c.bk1 Fri May 26 16:52:03 2000
    --- ./Drivers/txt/SQLColumns.c Fri May 26 16:51:41 2000
    ***************
    *** 61,67 ****
    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg );
    return SQL_ERROR;
    }
    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols( hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    --- 61,67 ----
    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg );
    return SQL_ERROR;
    }
    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols((SQLHSTMT) hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    *** ./Drivers/txt/SQLSpecialColumns.c.bk1 Fri May 26 16:54:45 2000
    --- ./Drivers/txt/SQLSpecialColumns.c Fri May 26 16:55:03 2000
    ***************
    *** 76,82 ****
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols( hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    --- 76,82 ----
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols((SQLHSTMT) hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    *** ./Drivers/txt/SQLTables.c.bk1 Fri May 26 16:56:02 2000
    --- ./Drivers/txt/SQLTables.c Fri May 26 16:56:42 2000
    ***************
    *** 55,61 ****
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols( hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    --- 55,61 ----
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols((SQLHSTMT) hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    *** ./Drivers/txt/SQLPrimaryKeys.c.bk1 Fri May 26 16:53:27 2000
    --- ./Drivers/txt/SQLPrimaryKeys.c Fri May 26 16:53:41 2000
    ***************
    *** 55,61 ****
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols( hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    --- 55,61 ----
    return SQL_ERROR;
    }

    ! hStmt->hStmtExtras->hBoundCols = _CreateBoundCols((SQLHSTMT) hStmt );

    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" );
    return SQL_SUCCESS;
    *** ./Drivers/template/SQLAllocStmt.c.bk1 Fri May 26 17:16:55 2000
    --- ./Drivers/template/SQLAllocStmt.c Fri May 26 17:18:17 2000
    ***************
    *** 62,68 ****
    (*phStmt)->pNext = NULL;
    (*phStmt)->pPrev = NULL;
    (*phStmt)->pszQuery = NULL;
    ! sprintf( (*phStmt)->szCursorName, "CUR_%08lX", *phStmt );

    /* ADD TO DBCs STATEMENT LIST */

    --- 65,71 ----
    (*phStmt)->pNext = NULL;
    (*phStmt)->pPrev = NULL;
    (*phStmt)->pszQuery = NULL;
    ! sprintf((char*) (*phStmt)->szCursorName, "CUR_%08lX", *phStmt );

    /* ADD TO DBCs STATEMENT LIST */

    *** ./Drivers/template/SQLFreeEnv.c.bk1 Fri May 26 17:19:48 2000
    --- ./Drivers/template/SQLFreeEnv.c Fri May 26 17:20:08 2000
    ***************
    *** 14,19 ****
    --- 14,22 ----
    **********************************************************************/

    #include "driver.h"
    +
    + SQLRETURN _FreeEnv(SQLHENV);
    +
    SQLRETURN SQLFreeEnv( SQLHENV hDrvEnv )
    {
    return _FreeEnv( hDrvEnv );
    *** ./Drivers/template/SQLFreeHandle.c.bk1 Fri May 26 17:21:17 2000
    --- ./Drivers/template/SQLFreeHandle.c Fri May 26 17:21:27 2000
    ***************
    *** 25,31 ****
    return _FreeConnect( (SQLHDBC)nHandle );

    case SQL_HANDLE_STMT:
    ! // return _FreeStmt( (SQLHSTMT)nHandle, 0 );
    return _FreeStmt( (SQLHSTMT)nHandle );

    case SQL_HANDLE_DESC:
    --- 25,31 ----
    return _FreeConnect( (SQLHDBC)nHandle );

    case SQL_HANDLE_STMT:
    ! /* return _FreeStmt( (SQLHSTMT)nHandle, 0 ); */
    return _FreeStmt( (SQLHSTMT)nHandle );

    case SQL_HANDLE_DESC:
    *** ./Drivers/PostgreSQL/environ.c.bk1 Fri May 26 15:14:24 2000
    --- ./Drivers/PostgreSQL/environ.c Fri May 26 15:35:46 2000
    ***************
    *** 425,431 ****

    /* Free any connections belonging to this environment */
    for (lf = 0; lf < MAX_CONNECTIONS; lf++) {
    ! if (conns[lf] && conns[lf]->henv == self)
    rv = rv && CC_Destructor(conns[lf]);
    }

    --- 425,431 ----

    /* Free any connections belonging to this environment */
    for (lf = 0; lf < MAX_CONNECTIONS; lf++) {
    ! if (conns[lf] && conns[lf]->henv == (HENV) self)
    rv = rv && CC_Destructor(conns[lf]);
    }

    ***************
    *** 459,465 ****

    for (i = 0; i < MAX_CONNECTIONS; i++) {
    if ( ! conns[i]) {
    ! conn->henv = self;
    conns[i] = conn;

    mylog(" added at i =%d, conn->henv = %u, conns[i]->henv = %u\n", i, conn->henv, conns[i]->henv);
    --- 459,465 ----

    for (i = 0; i < MAX_CONNECTIONS; i++) {
    if ( ! conns[i]) {
    ! conn->henv = (HENV) self;
    conns[i] = conn;

    mylog(" added at i =%d, conn->henv = %u, conns[i]->henv = %u\n", i, conn->henv, conns[i]->henv);
    *** ./Drivers/PostgreSQL/execute.c.bk1 Fri May 26 15:36:14 2000
    --- ./Drivers/PostgreSQL/execute.c Sun Jun 11 21:42:40 2000
    ***************
    *** 445,451 ****

    mylog("SQLCancel: SQLFreeStmt returned %d\n", result);

    ! SC_clear_error(hstmt);
    return SQL_SUCCESS;
    }

    --- 445,451 ----

    mylog("SQLCancel: SQLFreeStmt returned %d\n", result);

    ! SC_clear_error( (StatementClass *) hstmt);
    return SQL_SUCCESS;
    }

    ***************
    *** 728,734 ****
    }
    }
    else {
    ! current_param->EXEC_buffer = malloc(cbValue + 1);
    if ( ! current_param->EXEC_buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (2)";
    --- 728,734 ----
    }
    }
    else {
    ! current_param->EXEC_buffer = (char*) malloc(cbValue + 1);
    if ( ! current_param->EXEC_buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (2)";
    ***************
    *** 758,764 ****
    buffer = current_param->EXEC_buffer;

    if (cbValue == SQL_NTS) {
    ! buffer = realloc(buffer, strlen(buffer) + strlen(rgbValue) + 1);
    if ( ! buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (3)";
    --- 758,764 ----
    buffer = current_param->EXEC_buffer;

    if (cbValue == SQL_NTS) {
    ! buffer = (char*) realloc(buffer, strlen(buffer) + strlen(rgbValue) + 1);
    if ( ! buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (3)";
    ***************
    *** 784,790 ****
    mylog(" cbValue = %d, old_pos = %d, *used = %d\n", cbValue, old_pos, *current_param->EXEC_used);

    /* dont lose the old pointer in case out of memory */
    ! buffer = realloc(current_param->EXEC_buffer, *current_param->EXEC_used + 1);
    if ( ! buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (3)";
    --- 784,790 ----
    mylog(" cbValue = %d, old_pos = %d, *used = %d\n", cbValue, old_pos, *current_param->EXEC_used);

    /* dont lose the old pointer in case out of memory */
    ! buffer = (char*) realloc(current_param->EXEC_buffer, *current_param->EXEC_used + 1);
    if ( ! buffer) {
    stmt->errornumber = STMT_NO_MEMORY_ERROR;
    stmt->errormsg = "Out of memory in SQLPutData (3)";
    *** ./Drivers/PostgreSQL/info.c.bk1 Fri May 26 15:39:45 2000
    --- ./Drivers/PostgreSQL/info.c Fri May 26 15:44:56 2000
    ***************
    *** 1028,1034 ****

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 1028,1034 ----

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 1149,1155 ****
    result = PG__SQLFetch(htbl_stmt);
    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 1149,1155 ----
    result = PG__SQLFetch(htbl_stmt);
    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 1240,1246 ****
    result = PG__SQLExecDirect(hcol_stmt, columns_query,
    strlen(columns_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(hcol_stmt);
    stmt->errornumber = col_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    --- 1240,1246 ----
    result = PG__SQLExecDirect(hcol_stmt, columns_query,
    strlen(columns_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) hcol_stmt);
    stmt->errornumber = col_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    ***************
    *** 1470,1476 ****

    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg(hcol_stmt);
    stmt->errornumber = col_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    --- 1470,1476 ----

    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) hcol_stmt);
    stmt->errornumber = col_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    ***************
    *** 1760,1766 ****
    result = PG__SQLFetch(hcol_stmt);
    }
    if(result != SQL_NO_DATA_FOUND || total_columns == 0) {
    ! stmt->errormsg = SC_create_errormsg(hcol_stmt); /*// "Couldn't get column names in SQLStatistics."; */
    stmt->errornumber = col_stmt->errornumber;
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    goto SEEYA;
    --- 1760,1766 ----
    result = PG__SQLFetch(hcol_stmt);
    }
    if(result != SQL_NO_DATA_FOUND || total_columns == 0) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) hcol_stmt); /*// "Couldn't get column names in SQLStatistics."; */
    stmt->errornumber = col_stmt->errornumber;
    PG__SQLFreeStmt(hcol_stmt, SQL_DROP);
    goto SEEYA;
    ***************
    *** 1784,1790 ****

    result = PG__SQLExecDirect(hindx_stmt, index_query, strlen(index_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(hindx_stmt); /*// "Couldn't execute index query (w/SQLExecDirect) in SQLStatistics."; */
    stmt->errornumber = indx_stmt->errornumber;
    PG__SQLFreeStmt(hindx_stmt, SQL_DROP);
    goto SEEYA;
    --- 1784,1790 ----

    result = PG__SQLExecDirect(hindx_stmt, index_query, strlen(index_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) hindx_stmt); /*// "Couldn't execute index query (w/SQLExecDirect) in SQLStatistics."; */
    stmt->errornumber = indx_stmt->errornumber;
    PG__SQLFreeStmt(hindx_stmt, SQL_DROP);
    goto SEEYA;
    ***************
    *** 1924,1930 ****
    result = PG__SQLFetch(hindx_stmt);
    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg(hindx_stmt); /*// "SQLFetch failed in SQLStatistics."; */
    stmt->errornumber = indx_stmt->errornumber;
    PG__SQLFreeStmt(hindx_stmt, SQL_DROP);
    goto SEEYA;
    --- 1924,1930 ----
    result = PG__SQLFetch(hindx_stmt);
    }
    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) hindx_stmt); /*// "SQLFetch failed in SQLStatistics."; */
    stmt->errornumber = indx_stmt->errornumber;
    PG__SQLFreeStmt(hindx_stmt, SQL_DROP);
    goto SEEYA;
    ***************
    *** 2076,2082 ****

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2076,2082 ----

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 2120,2126 ****
    }

    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2120,2126 ----
    }

    if(result != SQL_NO_DATA_FOUND) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 2272,2278 ****

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2272,2278 ----

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 2314,2320 ****
    return SQL_SUCCESS;

    if(result != SQL_SUCCESS) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2314,2320 ----
    return SQL_SUCCESS;

    if(result != SQL_SUCCESS) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 2447,2453 ****

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2447,2453 ----

    result = PG__SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query));
    if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    ***************
    *** 2499,2505 ****
    return SQL_SUCCESS;

    if(result != SQL_SUCCESS) {
    ! stmt->errormsg = SC_create_errormsg(htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    --- 2499,2505 ----
    return SQL_SUCCESS;

    if(result != SQL_SUCCESS) {
    ! stmt->errormsg = SC_create_errormsg((StatementClass *) htbl_stmt);
    stmt->errornumber = tbl_stmt->errornumber;
    SC_log_error(func, "", stmt);
    PG__SQLFreeStmt(htbl_stmt, SQL_DROP);
    *** ./Drivers/PostgreSQL/psqlodbc.h.bk1 Mon Jun 12 01:45:27 2000
    --- ./Drivers/PostgreSQL/psqlodbc.h Mon Jun 12 01:45:39 2000
    ***************
    *** 18,24 ****
    #include <stdio.h> /* for FILE* pointers: see GLOBAL_VALUES */

    #ifndef WIN32
    ! #define Int4 long int
    #define UInt4 unsigned int
    #define Int2 short
    #define UInt2 unsigned short
    --- 18,24 ----
    #include <stdio.h> /* for FILE* pointers: see GLOBAL_VALUES */

    #ifndef WIN32
    ! #define Int4 int
    #define UInt4 unsigned int
    #define Int2 short
    #define UInt2 unsigned short

    --
    Bruce Momjian | http://www.op.net/~candle
    pgman@candle.pha.pa.us | (610) 853-3000
    + If your life is a hard drive, | 830 Blythe Avenue
    + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
  • Thomas Lockhart at Jun 15, 2000 at 2:29 pm

    Is this patch based on the current snapshot? I have applied several
    unixODBC patches in the past several days that may already fix these
    problems.
    This is a report on my attempts to install unixODBC (1.8.9)
    afaik, unixODBC != psqlODBC, though they have common roots. Is that
    actually the case? Is unixODBC sufficiently mature to consider merging
    the efforts?

    - Thomas
  • Peter Harvey at Jun 15, 2000 at 3:49 pm
    The PostgreSQL driver, in unixODBC, is a direct descendent of Byrons
    driver. I took the driver, made it compile on UNIX again, then added a few
    fixs to make it work in unixODBC and with StarOffice 5.0. I think other
    enhancements were made to it since then (about a year ago).

    The intention was to merge the changes back into Byrons stuff but that has not
    happened (that I am aware of).

    It would be great if this driver could be common and even better if any common
    driver was to be based upon unixODBC (i.e. its odbcinst etc).

    Peter

    NOTE: There is no reason, that I am aware of, why a common driver would not be
    able to work on unix with unixODBC and on MS'isms without change to the code
    (providing some care was taken).
    On Thu, 15 Jun 2000, Thomas Lockhart wrote:
    Is this patch based on the current snapshot? I have applied several
    unixODBC patches in the past several days that may already fix these
    problems.
    This is a report on my attempts to install unixODBC (1.8.9)
    afaik, unixODBC != psqlODBC, though they have common roots. Is that
    actually the case? Is unixODBC sufficiently mature to consider merging
    the efforts?

    - Thomas
  • Peter Harvey at Jun 15, 2000 at 4:41 pm
    Well the driver is derived from the MS Windows driver (Byrons) so it has to
    adhere to whatever licensing that is there but unixODBC is, in general, LGPL.

    Peter

    On Thu, 15 Jun 2000, Lamar Owen wrote:
    Peter Harvey wrote:
    The PostgreSQL driver, in unixODBC, is a direct descendent of Byrons
    driver. I took the driver, made it compile on UNIX again, then added a few
    fixs to make it work in unixODBC and with StarOffice 5.0. I think other
    enhancements were made to it since then (about a year ago).

    The intention was to merge the changes back into Byrons stuff but that has not
    happened (that I am aware of).
    Is the unixODBC driver GPL? If so, that's why it hasn't been pulled
    back into the BSD-licensed PostgreSQL distribution.

    --
    Lamar Owen
    WGCR Internet Radio
    1 Peter 4:11

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-ports @
categoriespostgresql
postedJun 14, '00 at 8:27p
activeJun 15, '00 at 4:41p
posts6
users5
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase