Commit bc9bab03 authored by Byron Nikolaidis's avatar Byron Nikolaidis

Mini update to fix SQLGetInfo to work properly (truncation, NULL)

parent 5df20d44
...@@ -63,6 +63,7 @@ typedef enum { ...@@ -63,6 +63,7 @@ typedef enum {
#define CONN_UNABLE_TO_LOAD_DLL 212 #define CONN_UNABLE_TO_LOAD_DLL 212
#define CONN_OPTION_VALUE_CHANGED 213 #define CONN_OPTION_VALUE_CHANGED 213
#define CONN_VALUE_OUT_OF_RANGE 214
/* Conn_status defines */ /* Conn_status defines */
#define CONN_IN_AUTOCOMMIT 0x01 #define CONN_IN_AUTOCOMMIT 0x01
......
...@@ -187,6 +187,9 @@ int status; ...@@ -187,6 +187,9 @@ int status;
strcpy(szSqlState, "S1109"); strcpy(szSqlState, "S1109");
break; break;
case STMT_VALUE_OUT_OF_RANGE:
strcpy(szSqlState, "22003");
break;
default: default:
strcpy(szSqlState, "S1000"); strcpy(szSqlState, "S1000");
// also a general error // also a general error
...@@ -238,6 +241,10 @@ int status; ...@@ -238,6 +241,10 @@ int status;
case CONN_OPTION_VALUE_CHANGED: case CONN_OPTION_VALUE_CHANGED:
strcpy(szSqlState, "01S02"); strcpy(szSqlState, "01S02");
break; break;
case STMT_TRUNCATED:
strcpy(szSqlState, "01004");
// data truncated
break;
case CONN_INIREAD_ERROR: case CONN_INIREAD_ERROR:
strcpy(szSqlState, "IM002"); strcpy(szSqlState, "IM002");
// data source not found // data source not found
...@@ -277,6 +284,12 @@ int status; ...@@ -277,6 +284,12 @@ int status;
case STMT_NOT_IMPLEMENTED_ERROR: case STMT_NOT_IMPLEMENTED_ERROR:
strcpy(szSqlState, "S1C00"); strcpy(szSqlState, "S1C00");
break; break;
case CONN_VALUE_OUT_OF_RANGE:
case STMT_VALUE_OUT_OF_RANGE:
strcpy(szSqlState, "22003");
break;
default: default:
strcpy(szSqlState, "S1000"); strcpy(szSqlState, "S1000");
// general error // general error
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
portion of the registry. You may have to manually add this key. portion of the registry. You may have to manually add this key.
This logfile is intended for development use, not for an end user! This logfile is intended for development use, not for an end user!
*/ */
#define MY_LOG // #define MY_LOG
/* Uncomment Q_LOG to compile in the qlog() statements (Communications log, i.e. CommLog). /* Uncomment Q_LOG to compile in the qlog() statements (Communications log, i.e. CommLog).
......
...@@ -33,7 +33,20 @@ typedef double SDOUBLE; ...@@ -33,7 +33,20 @@ typedef double SDOUBLE;
typedef UInt4 Oid; typedef UInt4 Oid;
# define ODBCVER 0x0200 /* Driver stuff */
#define ODBCVER 0x0200
#define DRIVER_ODBC_VER "02.00"
#define DRIVERNAME "PostgreSQL ODBC"
#define DBMS_NAME "PostgreSQL"
#define DBMS_VERSION "06.40.0002 PostgreSQL 6.4"
#define POSTGRESDRIVERVERSION "06.40.0002"
#ifdef WIN32
#define DRIVER_FILE_NAME "PSQLODBC.DLL"
#else
#define DRIVER_FILE_NAME "libpsqlodbc.so"
#endif
/* Limits */ /* Limits */
#define MAX_MESSAGE_LEN 8192 #define MAX_MESSAGE_LEN 8192
...@@ -67,17 +80,6 @@ typedef UInt4 Oid; ...@@ -67,17 +80,6 @@ typedef UInt4 Oid;
#define MAX_KEYLEN 512 // max key of the form "date+outlet+invoice" #define MAX_KEYLEN 512 // max key of the form "date+outlet+invoice"
#define MAX_STATEMENT_LEN MAX_MESSAGE_LEN #define MAX_STATEMENT_LEN MAX_MESSAGE_LEN
/* Driver stuff */
#define DRIVERNAME "PostgreSQL ODBC"
#define DBMS_NAME "PostgreSQL"
#define DBMS_VERSION "06.40.0002 PostgreSQL 6.4"
#define POSTGRESDRIVERVERSION "06.40.0002"
#ifdef WIN32
#define DRIVER_FILE_NAME "PSQLODBC.DLL"
#else
#define DRIVER_FILE_NAME "libpsqlodbc.so"
#endif
#define PG62 "6.2" /* "Protocol" key setting to force Postgres 6.2 */ #define PG62 "6.2" /* "Protocol" key setting to force Postgres 6.2 */
#define PG63 "6.3" /* "Protocol" key setting to force postgres 6.3 */ #define PG63 "6.3" /* "Protocol" key setting to force postgres 6.3 */
......
...@@ -70,6 +70,7 @@ typedef enum { ...@@ -70,6 +70,7 @@ typedef enum {
#define STMT_ROW_OUT_OF_RANGE 21 #define STMT_ROW_OUT_OF_RANGE 21
#define STMT_OPERATION_CANCELLED 22 #define STMT_OPERATION_CANCELLED 22
#define STMT_INVALID_CURSOR_POSITION 23 #define STMT_INVALID_CURSOR_POSITION 23
#define STMT_VALUE_OUT_OF_RANGE 24
/* statement types */ /* statement types */
enum { enum {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment