/ Called by Parent table to make the columns of a View. */ /
| 983 | /* Called by Parent table to make the columns of a View. */ |
| 984 | /***********************************************************************/ |
| 985 | PCOL TDBMYSQL::MakeFieldColumn(PGLOBAL g, char *name) |
| 986 | { |
| 987 | int n; |
| 988 | MYSQL_FIELD *fld; |
| 989 | PCOL cp, colp = NULL; |
| 990 | |
| 991 | for (n = 0; n < Myc.m_Fields; n++) { |
| 992 | fld = &Myc.m_Res->fields[n]; |
| 993 | |
| 994 | if (!stricmp(name, fld->name)) { |
| 995 | colp = new(g) MYSQLCOL(fld, this, n); |
| 996 | |
| 997 | if (colp->InitValue(g)) |
| 998 | return NULL; |
| 999 | |
| 1000 | if (!Columns) |
| 1001 | Columns = colp; |
| 1002 | else for (cp = Columns; cp; cp = cp->GetNext()) |
| 1003 | if (!cp->GetNext()) { |
| 1004 | cp->SetNext(colp); |
| 1005 | break; |
| 1006 | } // endif Next |
| 1007 | |
| 1008 | break; |
| 1009 | } // endif name |
| 1010 | |
| 1011 | } // endfor n |
| 1012 | |
| 1013 | if (!colp) |
| 1014 | snprintf(g->Message, sizeof(g->Message), "Column %s is not in view", name); |
| 1015 | |
| 1016 | return colp; |
| 1017 | } // end of MakeFieldColumn |
| 1018 | |
| 1019 | /***********************************************************************/ |
| 1020 | /* Called by Pivot tables to find default column names in a View */ |
no test coverage detected