diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-02-27 22:42:50 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-02-27 22:42:50 +0100 |
commit | 7132c590ca2850816d2ed7d4861cc430de9b5c2b (patch) | |
tree | 4a6f088873264db260c5731f22948c72f1cdc1e6 /storage/connect/odbconn.cpp | |
parent | fa4aa616a1844f512817427a892a7e26f30b68e2 (diff) | |
download | mariadb-git-7132c590ca2850816d2ed7d4861cc430de9b5c2b.tar.gz |
- Fix a miscalculation of column length in ODBCTables
- Clean code in Value.h
modified:
storage/connect/odbconn.cpp
storage/connect/value.h
Diffstat (limited to 'storage/connect/odbconn.cpp')
-rw-r--r-- | storage/connect/odbconn.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 683d63cfbed..0eb8a9345ce 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -491,9 +491,11 @@ PQRYRES ODBCDrivers(PGLOBAL g, bool info) /***********************************************************************/ 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 buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, + static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR}; + static int buftyp[] = {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}; int n, ncol = 5; int maxres; @@ -517,9 +519,9 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) n = ocp->GetMaxValue(SQL_MAX_QUALIFIER_NAME_LEN); length[0] = (n) ? (n + 1) : 128; 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; + n = ocp->GetMaxValue(SQL_MAX_TABLE_NAME_LEN); + length[2] = (n) ? (n + 1) : 128; } else { maxres = 0; length[0] = 128; @@ -534,7 +536,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) /* Allocate the structures used to refer to the result set. */ /************************************************************************/ qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, dbtype, buftyp, - NULL, length, true, true); + fldtyp, length, true, true); if (info) return qrp; |