PSARC 2016/644 unixODBC version 2.3.4
authorRich Burridge <rich.burridge@oracle.com>
Thu, 16 Feb 2017 08:04:08 -0800
changeset 7671 a092c6b08fcc
parent 7670 4e60db2d9462
child 7674 e5be4a3b0c32
PSARC 2016/644 unixODBC version 2.3.4 23210080 Upgrade unixodbc to 2.3.4
components/unixodbc/Makefile
components/unixodbc/TESTING
components/unixodbc/patches/000-configure.patch
components/unixodbc/patches/001-Makefile.in.patch
components/unixodbc/unixodbc.p5m
--- a/components/unixodbc/Makefile	Tue Jan 31 02:09:04 2017 -0800
+++ b/components/unixodbc/Makefile	Thu Feb 16 08:04:08 2017 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 # 32-bit is preferred until sufficient testing can be done.
 BUILD_BITS= 32_and_64
@@ -29,14 +29,14 @@
 PATH=$(dir $(CC)):$(USRBINDIR):$(GNUBIN)
 
 COMPONENT_NAME=		unixODBC
-COMPONENT_VERSION=	2.3.1
-COMPONENT_PROJECT_URL=	http://unixodbc.org/
+COMPONENT_VERSION=	2.3.4
+COMPONENT_PROJECT_URL=	http://www.unixodbc.org/
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:1f5be3edecff9e31072ef738ea1d8019594c4f0c2e3ab427e6eef153491db6a2
-COMPONENT_ARCHIVE_URL=	http://ftp.unixodbc.org/pub/unixODBC/$(COMPONENT_ARCHIVE)
+    sha256:2e1509a96bb18d248bf08ead0d74804957304ff7c6f8b2e5965309c632421e39
+COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)/$(COMPONENT_NAME)-$(COMPONENT_VERSION).tar.gz
 COMPONENT_BUGDB=	library/unixodbc
 
-TPNO=			9099
+TPNO=			33101
 
 TEST_TARGET= $(NO_TESTS)
 include $(WS_MAKE_RULES)/common.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unixodbc/TESTING	Thu Feb 16 08:04:08 2017 -0800
@@ -0,0 +1,482 @@
+There isn't a self-test suite provided for this component.
+
+Useful resources for how to test this can be found at:
+
+  https://compscinotes.wordpress.com/2010/04/18/unixodbc-mysql-sample-program/
+  http://www.unixodbc.org/unixODBCsetup.html
+  http://www.easysoft.com/developer/languages/c/odbc_tutorial.html
+
+From the later, a couple of simple commands to run are:
+
+$ odbcinst --version
+
+and
+
+$ odbcinst -q -s
+
+just to make sure you have the correct new version of the package installed.
+
+The Oracle Instant Client is the only package in Solaris known to use
+unixODBC, and this can be used to provide some more testing.
+
+Install all the Instant Client Solaris packages with:
+
+$ sudo pkg install \*instantclient\*
+
+Create a file called .odbc.ini in your home directory containing the
+following:
+
+$ cat ~/.odbc.ini
+
+[plus1]
+Application Attributes = T
+Attributes = W
+BatchAutocommitMode = IfAllSuccessful
+BindAsFLOAT = F
+CloseCursor = F
+DisableDPM = F
+DisableMTS = T
+Driver = /usr/oracle/instantclient/12.1/lib/64/libsqora.so.12.1
+DSN = TestDBDSN
+EXECSchemaOpt =
+EXECSyntax = T
+Failover = T
+FailoverDelay = 10
+FailoverRetryCount = 10
+FetchBufferSize = 64000
+ForceWCHAR = F
+Lobs = T
+Longs = T
+MaxLargeData = 0
+MetadataIdDefault = F
+QueryTimeout = T
+ResultSets = T
+ServerName =
+SQLGetData extensions = F
+Translation DLL =
+Translation Option = 0
+DisableRULEHint = T
+UserID =
+StatementCache=F
+CacheBufferSize=20
+UseOCIDescribeAny=F
+SQLTranslateErrors=F
+MaxTokenSize=8192
+AggregateSQLType=FLOAT
+
+Create a file called tnsnames.ora containing the following:
+
+$ cat tnsnames.ora
+plus1 =
+  (DESCRIPTION =
+    (ADDRESS_LIST =
+        (ADDRESS =
+          (PROTOCOL = TCP)
+          (HOST = adc2171609.us.oracle.com)
+          (PORT = 1521)
+        )
+    )
+    (CONNECT_DATA =
+      (SID = plus1)
+    )
+  )
+
+Create a file called odbcconnect.c containing the following:
+
+$ cat odbcconnect.c
+/*  Copyright (c) 2004, 2012, Oracle and/or its affiliates.
+ *  All rights reserved.
+ */
+
+/*
+   NAME
+     odbcconnect.c - Simple ODBC Connect demo
+
+   DESCRIPTION
+     Basic ODBC Connect demo
+*/
+
+#include <stdio.h>
+#include <sql.h>
+#include <sqlext.h>
+
+#define STR_LEN 50
+
+int main (int argc, char *argv[])
+{
+  HENV          henv;               /* environment handle */
+  HDBC          hdbc;               /* connection handle */
+  HSTMT         hstmt;              /* statement handle */
+  SDWORD        retcode;            /* return code */
+  UCHAR         info[STR_LEN];      /* info string for SQLGetInfo */
+  SQLSMALLINT   cbInfoValue;
+  SQLCHAR       SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
+  SQLINTEGER    NativeError;
+  SQLSMALLINT   MsgLen;
+
+  retcode = SQLAllocEnv (&henv);
+  retcode = SQLSetEnvAttr (henv, SQL_ATTR_ODBC_VERSION, (void *)
+SQL_OV_ODBC3,
+              SQL_IS_INTEGER);
+  retcode = SQLAllocConnect (henv, &hdbc);
+  retcode = SQLConnect (hdbc, "plus1", SQL_NTS, "scott", SQL_NTS, "tiger",
+              SQL_NTS);
+
+  if (retcode != SQL_SUCCESS)
+  {
+    if ((retcode = SQLGetDiagRec (SQL_HANDLE_DBC, hdbc, 1, SqlState,
+                   &NativeError, Msg, sizeof(Msg), &MsgLen)) != SQL_NO_DATA)
+      printf ("SqlState = %s\n Message = %s\n", SqlState, Msg);
+    goto EXIT;
+  }
+
+  retcode = SQLGetInfo (hdbc, SQL_DBMS_VER, &info, STR_LEN, &cbInfoValue);
+
+  if (retcode != SQL_SUCCESS)
+  {
+    if ((retcode = SQLGetDiagRec (SQL_HANDLE_DBC, hdbc, 1, SqlState,
+                   &NativeError, Msg, sizeof(Msg), &MsgLen)) != SQL_NO_DATA)
+      printf ("SqlState = %s\n Message = %s\n", SqlState, Msg);
+    goto EXIT;
+  }
+
+  printf ("Current DBMS version is %s\n", info);
+
+EXIT:
+  SQLDisconnect (hdbc);
+  SQLFreeConnect (hdbc);
+  SQLFreeEnv (henv);
+  return 0;
+}
+
+Compile this with:
+
+$ gcc -I/usr/include/odbc -m64 -o odbcconnect odbcconnect.c -lodbc
+
+In order to run this, you will need to:
+
+  1/ set LD_LIBRARY_PATH to the directory containing the Instant Client
+driver.
+  2/ Set TNS_ADMIN to the directory containing the tnsnames.ora file.
+  3/ Set TWO_TASK to the name of the database (plus1 in the above example).
+
+Running the odbcconnect program should give you something like:
+
+$ ./do_run.sh
++ ./odbcconnect
++ TNS_ADMIN=/export/home/richb/userland/bugs/23210080/tianfang
++ TWO_TASK=plus1
++ LD_LIBRARY_PATH_32=/usr/oracle/instantclient/12.1/lib
++ LD_LIBRARY_PATH_64=/usr/oracle/instantclient/12.1/lib/64
+Current DBMS version is 12.02.0020
+
+----
+
+Another test using the previous database and setup...
+
+Create a file called odbcselect.c containing the following:
+
+$ cat odbcselect.c
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates.
+All rights reserved. */
+
+#include <stdio.h>
+#include <sql.h>
+#include <sqlext.h>
+#define  STR_LEN 50
+
+int main (int argc, char *argv[])
+{
+  HENV          henv;          /* environment handle */
+  HDBC          hdbc;          /* connection handle  */
+  SQLHSTMT      hstmt;         /* statement handle   */
+  SDWORD        retcode;       /* return code        */
+  SQLCHAR *     stmt = "select ename, empno from emp where empno orderby
+empno";
+  SQLCHAR       empname[STR_LEN] = "", job[STR_LEN];
+  SQLLEN        enind, jind;
+  SQLUINTEGER   eno = 0;
+  SQLCHAR       SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
+  SQLINTEGER    NativeError;
+  SQLSMALLINT   MsgLen;
+
+  retcode = SQLAllocEnv (&henv);
+  retcode = SQLSetEnvAttr (henv, SQL_ATTR_ODBC_VERSION, (void *)
+SQL_OV_ODBC3,
+              SQL_IS_INTEGER);
+  retcode = SQLAllocConnect (henv, &hdbc);
+  retcode = SQLConnect (hdbc, "plus1", SQL_NTS, "scott", SQL_NTS, "tiger",
+              SQL_NTS);
+  if (retcode != SQL_SUCCESS)
+    {
+      if ((retcode = SQLGetDiagRec (SQL_HANDLE_DBC, hdbc, 1, SqlState,
+                       &NativeError, Msg, sizeof (Msg),
+                       &MsgLen)) != SQL_NO_DATA)
+      printf ("SqlState = %s\n Message = %s\n", SqlState, Msg);
+      goto EXIT;
+    }
+  retcode = SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmt);
+  SQLBindCol (hstmt, 1, SQL_C_CHAR, empname, sizeof (empname), &enind);
+  SQLBindCol (hstmt, 2, SQL_C_ULONG, &eno, 0, &jind);
+
+  SQLExecDirect (hstmt, "select ename, empno from emp", SQL_NTS);
+
+  while ((retcode = SQLFetch (hstmt)) != SQL_NO_DATA)
+    {
+      if (enind == SQL_NULL_DATA)
+        printf ("NULL  \n");
+      else
+        printf ("EMPNAME=%s ", empname);
+
+      if (jind == SQL_NULL_DATA)
+        printf ("NULL  \n");
+      else
+        printf ("EMPNO=%d\n", eno);
+    }
+
+EXIT:
+  SQLFreeStmt (hstmt, SQL_CLOSE);
+  SQLDisconnect (hdbc);
+  SQLFreeConnect (hdbc);
+  SQLFreeEnv (henv);
+  return 0;
+}
+
+Compile this with:
+
+$ gcc -I/usr/include/odbc -m64 -o odbcselect odbcselect.c -lodbc
+
+Set the same environment variables.
+
+Running the odbcselect program should give you something like:
+
+$ ./do_run.sh
++ ./odbcselect
++ TNS_ADMIN=/export/home/richb/userland/bugs/23210080/tianfang
++ TWO_TASK=plus1
++ LD_LIBRARY_PATH_32=/usr/oracle/instantclient/12.1/lib
++ LD_LIBRARY_PATH_64=/usr/oracle/instantclient/12.1/lib/64
+EMPNAME=SMITH EMPNO=7369
+EMPNAME=ALLEN EMPNO=7499
+EMPNAME=WARD EMPNO=7521
+EMPNAME=JONES EMPNO=7566
+EMPNAME=MARTIN EMPNO=7654
+EMPNAME=BLAKE EMPNO=7698
+EMPNAME=CLARK EMPNO=7782
+EMPNAME=SCOTT EMPNO=7788
+EMPNAME=KING EMPNO=7839
+EMPNAME=TURNER EMPNO=7844
+EMPNAME=ADAMS EMPNO=7876
+EMPNAME=JAMES EMPNO=7900
+EMPNAME=FORD EMPNO=7902
+EMPNAME=MILLER EMPNO=7934
+
+----
+
+One more test using the same database and setup...
+
+Create a file called stmt_cache.c containing the following:
+
+$ cat stmt_cache.c
+
+/* Copyright (c) 2005, 2006, Oracle. All rights reserved.  */
+
+/*
+   NAME
+     stmt_cache.c - Statement caching demo
+
+   DESCRIPTION
+     Run this demo in following modes and compare the result
+     1. Statement caching enabled
+        Make sure following options are added in odbc.ini file
+            StatementCache=T
+            CacheBufferSize=20
+     2. Statement caching disabled
+        To disable statement caching adjust 'StatementCache' to false
+              StatementCache=F
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sql.h>
+#include <sqlext.h>
+
+#define QUERYLEN  500
+#define NUM_STMTS 500
+
+SQLHSTMT hstmt[NUM_STMTS];
+char *sqlquery[NUM_STMTS];
+SQLHENV m_henv;               /* environment handle */
+SQLHDBC m_hdbc = NULL;        /* connection handle */
+int retCode;
+SQLCHAR SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
+SQLINTEGER NativeError;
+SQLSMALLINT MsgLen;
+
+static void call_perf_test();
+static void execute_query();
+static void printSQLError (long , SQLHANDLE );
+
+int
+main()
+{
+    struct timeval tim;
+    double tot_time = 0.0, start_time = 0.0, end_time = 0.0;
+
+    if (!gettimeofday (&tim, NULL)) {
+        start_time = (double)((tim.tv_sec * 1000000 ) + tim.tv_usec);
+    } else {
+        return -1;
+    }
+    call_perf_test();
+    if (!gettimeofday (&tim, NULL)) {
+        end_time = (double) ((tim.tv_sec * 1000000 ) + tim.tv_usec);
+    } else {
+        return -1;
+    }
+  tot_time = (double) (end_time - start_time) / 100000;
+  (void) printf ("\nTotal time taken is = %lf\n", tot_time);
+
+  return 0;
+}
+
+void
+call_perf_test()
+{
+    int count = 0;
+    char *buf1 = (char *) malloc(sizeof(char) * QUERYLEN);
+    char *buf2 = (char *) malloc(sizeof(char) * QUERYLEN);
+    sqlquery[0] =(char *) malloc(sizeof(char) * NUM_STMTS);
+
+    for (count=0; count < NUM_STMTS; count++) {
+        sqlquery[count]=(char *)malloc(sizeof(char)*QUERYLEN);
+    }
+
+    retCode = SQLAllocEnv (&m_henv);
+    retCode = SQLSetEnvAttr (m_henv, SQL_ATTR_ODBC_VERSION,
+                             (void *) SQL_OV_ODBC3, SQL_IS_INTEGER);
+    retCode = SQLAllocConnect (m_henv, &m_hdbc);
+    retCode = SQLConnect (m_hdbc, "plus1", SQL_NTS,
+                          "scott", SQL_NTS, "tiger", SQL_NTS);
+
+    for (count = 0; count < NUM_STMTS-5; count++) {
+        sprintf(buf1, "SELECT empno, ename, job, mgr, hiredate, sal, comm,
+deptno ");
+        sprintf(buf2, " FROM emp");
+        (void) strcat(buf1, buf2);
+        sprintf(sqlquery[count], "%s", buf1);
+    }
+
+    execute_query();
+
+    retCode = SQLDisconnect (m_hdbc);
+    retCode = SQLFreeConnect (m_hdbc);
+    retCode = SQLFreeEnv (m_henv);
+}
+
+void
+execute_query()
+{
+    int count = 0;
+    for (count=0; count < NUM_STMTS - 5; count++) {
+        retCode = SQLAllocHandle (SQL_HANDLE_STMT, m_hdbc,
+                                  (SQLHANDLE) &hstmt[count]);
+        if (retCode != SQL_SUCCESS) {
+            printSQLError(3, hstmt[count]);
+        }
+        retCode = SQLPrepare(hstmt[count], (SQLCHAR *) sqlquery[count],
+SQL_NTS);
+        if (retCode != SQL_SUCCESS) {
+            printSQLError(3, hstmt[count]);
+        }
+        retCode=SQLExecute(hstmt[count]);
+        if (retCode != SQL_SUCCESS) {
+            printSQLError(3, hstmt[count]);
+        }
+        /*
+         * 1. Driver keeps the statement handle back to cache if statement
+         *    caching is enabled
+         * 2. Driver frees the statement handle if statement caching is
+disabled
+         */
+        retCode = SQLFreeStmt (hstmt[count], SQL_DROP);
+        if (retCode != SQL_SUCCESS) {
+            printSQLError(3,hstmt[count]);
+        }
+    }
+}
+
+void printSQLError (long handletype, SQLHANDLE handle)
+{
+    SQLSMALLINT errRecNo = 1;
+    SQLSMALLINT arg_handleType;
+    SQLCHAR errSQLStateBuf[256];
+    SQLINTEGER errCode = 0;
+    SQLCHAR errMsgBuf[256];
+    SQLSMALLINT errMsgBufLen = 256;
+    SQLSMALLINT errInfoSize;
+    long retcode;
+
+    (void) memset (errSQLStateBuf, 0x00, sizeof (errSQLStateBuf));
+    (void) memset (errMsgBuf, 0x00, sizeof (errMsgBuf));
+
+    if (handletype == 1) {
+        arg_handleType = SQL_HANDLE_ENV;
+    } else if (handletype == 2) {
+        arg_handleType = SQL_HANDLE_DBC;
+    } else {
+        arg_handleType = SQL_HANDLE_STMT;
+    }
+    retcode = SQLGetDiagRec (arg_handleType, handle, errRecNo,
+                             errSQLStateBuf, &errCode, errMsgBuf,
+errMsgBufLen,
+                             &errInfoSize);
+
+    if (SQL_NO_DATA_FOUND != retcode)
+        (void) printf ("errCode:%d errSQLStateBuf:%s\n errMsg:%s\n", errCode,
+                        errSQLStateBuf, errMsgBuf);
+    errRecNo++;
+}
+
+
+Compile this with:
+
+$ gcc -I/usr/include/odbc -m64 -o stmt_cache stmt_cache.c -lodbc
+
+There are two test runs.
+
+The first one is with the following line in your ~/.odbc.ini file:
+
+StatementCache=F
+
+Running this gives:
+
+$ ./do_run.sh
++ ./stmt_cache
++ TNS_ADMIN=/export/home/richb/userland/bugs/23210080/tianfang
++ TWO_TASK=plus1
++ LD_LIBRARY_PATH_32=/usr/oracle/instantclient/12.1/lib
++ LD_LIBRARY_PATH_64=/usr/oracle/instantclient/12.1/lib/64
+
+Total time taken is = 390.039130
+
+
+Now change that line in the ~/.odbc.ini file to:
+
+StatementCache=T
+
+
+This test run gives:
+
+$ ./do_run.sh
++ ./stmt_cache
++ TNS_ADMIN=/export/home/richb/userland/bugs/23210080/tianfang
++ TWO_TASK=plus1
++ LD_LIBRARY_PATH_32=/usr/oracle/instantclient/12.1/lib
++ LD_LIBRARY_PATH_64=/usr/oracle/instantclient/12.1/lib/64
+
+Total time taken is = 383.461800
+
+----
--- a/components/unixodbc/patches/000-configure.patch	Tue Jan 31 02:09:04 2017 -0800
+++ b/components/unixodbc/patches/000-configure.patch	Thu Feb 16 08:04:08 2017 -0800
@@ -1,48 +1,12 @@
---- configure	2011-11-25 08:14:47.000000000 -0800
-+++ configure	2012-10-18 12:03:36.047791375 -0700
-@@ -1,4 +1,4 @@
--#! /bin/sh
-+#! /bin/bash
- # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.65 for unixODBC 2.3.1.
- #
-@@ -240,7 +240,7 @@
- fi
- fi
- fi
--SHELL=${CONFIG_SHELL-/bin/sh}
-+SHELL=${CONFIG_SHELL-/bin/bash}
- export SHELL
- # Unset more variables known to interfere with behavior of common tools.
- CLICOLOR_FORCE= GREP_OPTIONS=
-@@ -533,7 +533,7 @@
- 
- 
- # Check that we are running under the correct shell.
--SHELL=${CONFIG_SHELL-/bin/sh}
-+SHELL=${CONFIG_SHELL-/bin/bash}
- 
- case X$lt_ECHO in
- X*--fallback-echo)
-@@ -617,7 +617,7 @@
-       elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
- 	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-         # If we have ksh, try running configure again with it.
--        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/bash}
-         export ORIGINAL_CONFIG_SHELL
-         CONFIG_SHELL=/bin/ksh
-         export CONFIG_SHELL
-@@ -659,7 +659,7 @@
- 	  if test "$prev" != 'sed 50q "$0"'; then
- 	    echo_test_string=`eval $prev`
- 	    export echo_test_string
--	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/bash}} "$0" ${1+"$@"}
- 	  else
- 	    # Oops.  We lost completely, so just stick with echo.
- 	    ECHO=echo
-@@ -1002,7 +1002,7 @@
+Changes to the configure program from a previous engineer.
+
+Further work (including patching against configure.ac instead of configure)
+needs to be done to determine if they are really essential and if they need
+to be sent upstream.
+
+--- configure.orig	2016-12-19 13:45:11.806909920 +0000
++++ configure	2016-12-19 13:51:48.756972474 +0000
+@@ -874,7 +874,7 @@
  datadir='${datarootdir}'
  sysconfdir='${prefix}/etc'
  sharedstatedir='${prefix}/com'
@@ -51,70 +15,7 @@
  includedir='${prefix}/include'
  oldincludedir='/usr/include'
  docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-@@ -2689,7 +2689,7 @@
- ac_cpp='$CPP $CPPFLAGS'
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+ac_compiler_gnu="no"
- 
- 
- 
-@@ -3100,7 +3100,7 @@
-   $as_echo_n "(cached) " >&6
- else
-   cat >conftest.make <<\_ACEOF
--SHELL = /bin/sh
-+SHELL = /bin/bash
- all:
- 	@echo '@@@%%%=$(MAKE)=@@@%%%'
- _ACEOF
-@@ -3346,7 +3346,7 @@
- ac_cpp='$CPP $CPPFLAGS'
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+ac_compiler_gnu="no"
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
-@@ -4180,7 +4180,7 @@
-     for i in 1 2 3 4 5 6; do
-       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
--      # Solaris 8's {/usr,}/bin/sh.
-+      # Solaris 8's {/usr,}/bin/bash.
-       touch sub/conftst$i.h
-     done
-     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-@@ -4984,7 +4984,7 @@
-     for i in 1 2 3 4 5 6; do
-       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
--      # Solaris 8's {/usr,}/bin/sh.
-+      # Solaris 8's {/usr,}/bin/bash.
-       touch sub/conftst$i.h
-     done
-     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-@@ -5245,7 +5245,7 @@
-   $as_echo_n "(cached) " >&6
- else
-   cat >conftest.make <<\_ACEOF
--SHELL = /bin/sh
-+SHELL = /bin/bash
- all:
- 	@echo '@@@%%%=$(MAKE)=@@@%%%'
- _ACEOF
-@@ -6705,7 +6705,7 @@
-       for i in 1 2 3 4 5 6 7 8 ; do
-         teststring=$teststring$teststring
-       done
--      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-+      SHELL=${SHELL-${CONFIG_SHELL-/bin/bash}}
-       # If test is not a shell built-in, we'll probably end up computing a
-       # maximum length that is only half of the actual maximum length, but
-       # we can't tell.
-@@ -14678,6 +14678,7 @@
+@@ -15598,6 +15598,7 @@
  int
  main ()
  {
@@ -122,7 +23,25 @@
  mutex_lock()
    ;
    return 0;
-@@ -14767,7 +14768,7 @@
+@@ -15687,7 +15688,7 @@
+ if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-  CFLAGS="$CFLAGS -pthread"
++  CFLAGS="$CFLAGS"
+ else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+@@ -15760,7 +15761,7 @@
+ if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-  CFLAGS="$CFLAGS -pthread"
++  CFLAGS="$CFLAGS"
+ else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+@@ -15798,7 +15799,7 @@
  if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  $as_echo "yes" >&6; }
@@ -131,25 +50,7 @@
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  $as_echo "no" >&6; }
-@@ -14840,7 +14841,7 @@
- if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
--  CFLAGS="$CFLAGS -pthread"
-+  CFLAGS="$CFLAGS"
- else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-@@ -14878,7 +14879,7 @@
- if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
--  CFLAGS="$CFLAGS -pthread"
-+  CFLAGS="$CFLAGS"
- else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-@@ -14918,7 +14919,7 @@
+@@ -15838,7 +15839,7 @@
  
            $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h
  
@@ -158,7 +59,7 @@
            gotthread="yes";
  
  else
-@@ -14931,7 +14932,7 @@
+@@ -15851,7 +15852,7 @@
  
          if test "x$gotthread" = "xno"; then
        SAVECFLAGS="$CFLAGS"
@@ -167,16 +68,7 @@
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5
  $as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; }
  ac_save_LIBS="$LIBS"
-@@ -15080,7 +15081,7 @@
- ac_cpp='$CPP $CPPFLAGS'
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+ac_compiler_gnu="no"
- 
- 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for semundo union" >&5
-@@ -15129,6 +15130,8 @@
+@@ -16048,6 +16049,8 @@
  
  fi
  
@@ -185,7 +77,7 @@
  
  # Check whether --with-msql-lib was given.
  if test "${with_msql_lib+set}" = set; then :
-@@ -15348,6 +15351,8 @@
+@@ -16265,6 +16268,8 @@
    QNX_FALSE=
  fi
  
@@ -194,7 +86,7 @@
   if test "x$use_builtin_libtool" = "xyes" ; then
    WITHLT_TRUE=
    WITHLT_FALSE='#'
-@@ -15900,6 +15905,8 @@
+@@ -16815,6 +16820,8 @@
  fi
  done
  
--- a/components/unixodbc/patches/001-Makefile.in.patch	Tue Jan 31 02:09:04 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- Drivers/Postgre7.1/Makefile.in	2010-02-24 11:52:22.000000000 -0500
-+++ Drivers/Postgre7.1/Makefile.in	2010-09-15 12:35:33.089913000 -0400
-@@ -652,8 +652,6 @@
- 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- 	tags uninstall uninstall-am uninstall-libLTLIBRARIES
- 
--	-module
--
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
--- a/components/unixodbc/unixodbc.p5m	Tue Jan 31 02:09:04 2017 -0800
+++ b/components/unixodbc/unixodbc.p5m	Thu Feb 16 08:04:08 2017 -0800
@@ -18,9 +18,10 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
+<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
 set name=pkg.fmri \
     value=pkg:/library/unixodbc@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value="The UnixODBC Subsystem and SDK"
@@ -32,11 +33,9 @@
     value=org.opensolaris.category.2008:Development/Databases
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
-set name=org.opensolaris.arc-caseid value=LSARC/2007/684
+set name=org.opensolaris.arc-caseid value=LSARC/2007/684 value=PSARC/2016/644
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-#
 dir  path=etc/odbc/ODBCDataSources
-#
 file path=etc/odbc/odbc.ini
 file path=etc/odbc/odbcinst.ini
 file path=usr/bin/$(MACH64)/odbc_config
@@ -45,10 +44,13 @@
 file usr/bin/$(MACH64)/iusql path=usr/bin/iusql
 file path=usr/bin/odbc_config
 file usr/bin/$(MACH64)/odbcinst path=usr/bin/odbcinst
+file usr/bin/$(MACH64)/slencheck path=usr/bin/slencheck
+file path=usr/include/odbc/autotest.h
 file path=usr/include/odbc/odbcinst.h
 file path=usr/include/odbc/odbcinstext.h
 file path=usr/include/odbc/sql.h
 file path=usr/include/odbc/sqlext.h
+file path=usr/include/odbc/sqlspi.h
 file path=usr/include/odbc/sqltypes.h
 file path=usr/include/odbc/sqlucode.h
 file path=usr/include/odbc/unixodbc_conf.h
@@ -116,7 +118,6 @@
 file path=usr/lib/$(MACH64)/libtemplate.so.1.0.0
 file path=usr/lib/$(MACH64)/pkgconfig/unixODBC.pc
 link path=usr/lib/libesoobS.so target=libesoobS.so.1.0.0
-#
 link path=usr/lib/libesoobS.so.1 target=libesoobS.so.1.0.0
 file path=usr/lib/libesoobS.so.1.0.0
 link path=usr/lib/libmimerS.so target=libmimerS.so.1.0.0
@@ -177,5 +178,12 @@
 link path=usr/lib/libtemplate.so.1 target=libtemplate.so.1.0.0
 file path=usr/lib/libtemplate.so.1.0.0
 file path=usr/lib/pkgconfig/unixODBC.pc
-#
+file path=usr/share/man/man1/dltest.1
+file path=usr/share/man/man1/isql.1
+file path=usr/share/man/man1/iusql.1
+file path=usr/share/man/man1/odbc_config.1
+file path=usr/share/man/man1/odbcinst.1
+file path=usr/share/man/man5/odbc.ini.5
+file path=usr/share/man/man5/odbcinst.ini.5
+file path=usr/share/man/man7/unixODBC.7
 license unixodbc.license license="LGPLv2.1, GPLv2"