diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-18 19:25:50 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-18 19:25:50 +0100 |
commit | 6b63c5b2479084d5b7ead016d4d0f5cf7d28e47c (patch) | |
tree | cad7294d5982ebe2185cdce766901a7043e33e1e /storage/connect/myconn.cpp | |
parent | e5729127b8a50a0e553fd8b87b2683e4a684dfcc (diff) | |
download | mariadb-git-6b63c5b2479084d5b7ead016d4d0f5cf7d28e47c.tar.gz |
- FIX PIVOT bug MDEV-5869 caused by using fop (field option ptr) when NULL.
modified:
storage/connect/ha_connect.cc
- Suppress the use of connect.in by adding the connect_xtrace system variable.
modified:
storage/connect/ha_connect.cc
- Make column length, varchar, and temporal column types recognized in discovery
when using SRCDEF,or PIVOT.
modified:
storage/connect/ha_connect.cc
storage/connect/myconn.cpp
storage/connect/myutil.cpp
storage/connect/plgdbsem.h
- Avoid (rare) crash when using DECIMAL type. (buf was too small)
modified:
storage/connect/tabfmt.cpp
storage/connect/tabmysql.cpp
storage/connect/tabodbc.cpp
storage/connect/tabpivot.cpp
storage/connect/valblk.cpp
storage/connect/value.cpp
- General cleaning of unused code, standardize tracing, and update version number
modified:
storage/connect/block.h
storage/connect/colblk.cpp
storage/connect/connect.cc
storage/connect/csort.h
storage/connect/filamap.cpp
storage/connect/filamdbf.cpp
storage/connect/filamfix.cpp
storage/connect/filamzip.cpp
storage/connect/ha_connect.cc
storage/connect/mycat.cc
storage/connect/myconn.cpp
storage/connect/mysql-test/connect/r/alter.result
storage/connect/mysql-test/connect/r/xml.result
storage/connect/myutil.cpp
storage/connect/osutil.c
storage/connect/plgdbsem.h
storage/connect/plgdbutl.cpp
storage/connect/plugutil.c
storage/connect/reldef.cpp
storage/connect/tabcol.cpp
storage/connect/tabfmt.cpp
storage/connect/tabmysql.cpp
storage/connect/tabodbc.cpp
storage/connect/tabpivot.cpp
storage/connect/tabvct.cpp
storage/connect/user_connect.cc
storage/connect/valblk.cpp
storage/connect/value.cpp
storage/connect/xindex.cpp
Diffstat (limited to 'storage/connect/myconn.cpp')
-rw-r--r-- | storage/connect/myconn.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 1776a8f9168..13a6f996605 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -295,7 +295,7 @@ PQRYRES SrcColumns(PGLOBAL g, const char *host, const char *db, // Send the source command to MySQL if (myc.ExecSQL(g, query, &w) == RC_OK) - qrp = myc.GetResult(g); + qrp = myc.GetResult(g, true); myc.Close(); return qrp; @@ -676,7 +676,7 @@ MYSQL_FIELD *MYSQLC::GetNextField(void) /***********************************************************************/ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb) { - char *fmt; + char *fmt, v; int n; bool uns; PCOLRES *pcrp, crp; @@ -705,7 +705,6 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb) qrp->Nblin = 0; qrp->Cursor = 0; - //for (fld = mysql_fetch_field(m_Res); fld; // fld = mysql_fetch_field(m_Res)) { for (fld = GetNextField(); fld; fld = GetNextField()) { @@ -718,17 +717,19 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb) crp->Name = (char*)PlugSubAlloc(g, NULL, fld->name_length + 1); strcpy(crp->Name, fld->name); - if ((crp->Type = MYSQLtoPLG(fld->type)) == TYPE_ERROR) { + if ((crp->Type = MYSQLtoPLG(fld->type, &v)) == TYPE_ERROR) { sprintf(g->Message, "Type %d not supported for column %s", fld->type, crp->Name); return NULL; } else if (crp->Type == TYPE_DATE && !pdb) // For direct MySQL connection, display the MySQL date string crp->Type = TYPE_STRING; + else + crp->Var = v; crp->Prec = (crp->Type == TYPE_DOUBLE || crp->Type == TYPE_DECIM) ? fld->decimals : 0; - crp->Length = fld->max_length; + crp->Length = max(fld->length, fld->max_length); crp->Clen = GetTypeSize(crp->Type, crp->Length); uns = (fld->flags & (UNSIGNED_FLAG | ZEROFILL_FLAG)) ? true : false; |