Date: Wednesday, January 4, 2006 @ 20:24:54
  Author: marc
    Path: /cvsroot/carob/odbsequoia/src

Modified: env.cpp (1.1 -> 1.2)

Stopped always lying with SQL_SUCCESS in SQLSetEnvAttr(): now returning 
SQL_ERROR except on SQL_ATTR_ODBC_VERSION.


---------+
 env.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)


Index: odbsequoia/src/env.cpp
diff -u odbsequoia/src/env.cpp:1.1 odbsequoia/src/env.cpp:1.2
--- odbsequoia/src/env.cpp:1.1  Thu Dec 22 19:55:20 2005
+++ odbsequoia/src/env.cpp      Wed Jan  4 20:24:54 2006
@@ -114,13 +114,23 @@
 }
 
 
-/* is there a SQLGetEnvAttrW()? */
+/* Is there a SQLGetEnvAttrW()? Does not look like. */
 SQLRETURN
 SQLSetEnvAttr(SQLHENV env_handle, SQLINTEGER attribute, SQLPOINTER value,
               SQLINTEGER str_len)
 {
-       SQLRETURN       ret = SQL_SUCCESS;
-        // FIXME: ignored
+       SQLRETURN       ret = SQL_ERROR;
+
+        switch (attribute)
+        {
+        case SQL_ATTR_ODBC_VERSION:
+            if (SQL_OV_ODBC2 == (int) value)
+                exit(200); // we have to be so violent else unixODBC DM will
+                           // happily go on if we just return an error
+            if (SQL_OV_ODBC3 == (int) value)
+                ret = SQL_SUCCESS;
+            break;
+        }
 
        return ret;
 }

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to