Commit 7132c590 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix a miscalculation of column length in ODBCTables

- Clean code in Value.h

modified:
  storage/connect/odbconn.cpp
  storage/connect/value.h
parent fa4aa616
...@@ -494,6 +494,8 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) ...@@ -494,6 +494,8 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR}; static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING}; TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_QUALIF, FLD_OWNER, FLD_NAME,
FLD_TYPE, FLD_REM};
static unsigned int length[] = {0, 0, 0, 16, 128}; static unsigned int length[] = {0, 0, 0, 16, 128};
int n, ncol = 5; int n, ncol = 5;
int maxres; int maxres;
...@@ -517,9 +519,9 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) ...@@ -517,9 +519,9 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
n = ocp->GetMaxValue(SQL_MAX_QUALIFIER_NAME_LEN); n = ocp->GetMaxValue(SQL_MAX_QUALIFIER_NAME_LEN);
length[0] = (n) ? (n + 1) : 128; length[0] = (n) ? (n + 1) : 128;
n = ocp->GetMaxValue(SQL_MAX_USER_NAME_LEN); n = ocp->GetMaxValue(SQL_MAX_USER_NAME_LEN);
length[0] = (n) ? (n + 1) : 128;
n = ocp->GetMaxValue(SQL_MAX_TABLE_NAME_LEN);
length[1] = (n) ? (n + 1) : 128; length[1] = (n) ? (n + 1) : 128;
n = ocp->GetMaxValue(SQL_MAX_TABLE_NAME_LEN);
length[2] = (n) ? (n + 1) : 128;
} else { } else {
maxres = 0; maxres = 0;
length[0] = 128; length[0] = 128;
...@@ -534,7 +536,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) ...@@ -534,7 +536,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, dbtype, buftyp, qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, dbtype, buftyp,
NULL, length, true, true); fldtyp, length, true, true);
if (info) if (info)
return qrp; return qrp;
......
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