mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Allowing views and queries as parameters for PROXY base tables
NOTE: Checking for looping references cannot be done when using views as parameters. This should not be allowed on production servers and should be dependant on a system variable and/or on speciel grant. modified: storage/connect/CMakeLists.txt storage/connect/connect.cc storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/myconn.h storage/connect/mysql-test/connect/r/fmt.result storage/connect/mysql-test/connect/r/pivot.result storage/connect/mysql-test/connect/t/fmt.test storage/connect/mysql-test/connect/t/pivot.test storage/connect/plgdbsem.h storage/connect/plugutil.c storage/connect/tabcol.cpp storage/connect/tabcol.h storage/connect/tabfmt.cpp storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/taboccur.cpp storage/connect/taboccur.h storage/connect/tabpivot.cpp storage/connect/tabpivot.h storage/connect/tabtbl.cpp storage/connect/tabutil.cpp storage/connect/tabutil.h storage/connect/xtable.h
This commit is contained in:
@@ -1088,7 +1088,12 @@ bool TDBFMT::OpenDB(PGLOBAL g)
|
||||
{
|
||||
Linenum = 0;
|
||||
|
||||
if (Use != USE_OPEN && (Columns || Mode == MODE_UPDATE)) {
|
||||
if (Mode == MODE_INSERT || Mode == MODE_UPDATE) {
|
||||
sprintf(g->Message, MSG(FMT_WRITE_NIY), "FMT");
|
||||
return true; // NIY
|
||||
} // endif Mode
|
||||
|
||||
if (Use != USE_OPEN && Columns) {
|
||||
// Make the formats used to read records
|
||||
PSZ pfm;
|
||||
int i, n;
|
||||
@@ -1096,17 +1101,12 @@ bool TDBFMT::OpenDB(PGLOBAL g)
|
||||
PCOLDEF cdp;
|
||||
PDOSDEF tdp = (PDOSDEF)To_Def;
|
||||
|
||||
// if (Mode != MODE_UPDATE) {
|
||||
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
|
||||
if (!colp->IsSpecial()) // Not a pseudo column
|
||||
Fields = max(Fields, (int)colp->Fldnum);
|
||||
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
|
||||
if (!colp->IsSpecial()) // Not a pseudo column
|
||||
Fields = max(Fields, (int)colp->Fldnum);
|
||||
|
||||
if (Columns)
|
||||
Fields++; // Fldnum was 0 based
|
||||
|
||||
// } else
|
||||
// for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
|
||||
// Fields++;
|
||||
if (Columns)
|
||||
Fields++; // Fldnum was 0 based
|
||||
|
||||
To_Fld = PlugSubAlloc(g, NULL, Lrecl + 1);
|
||||
FldFormat = (PSZ*)PlugSubAlloc(g, NULL, sizeof(PSZ) * Fields);
|
||||
|
Reference in New Issue
Block a user