------------------------------------------------------------------------------
| 135 | |
| 136 | //------------------------------------------------------------------------------ |
| 137 | int vtkSQLDatabaseSchema::AddColumnToIndex(int tblHandle, int idxHandle, int colHandle) |
| 138 | { |
| 139 | if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables()) |
| 140 | { |
| 141 | vtkErrorMacro("Cannot add column to index of non-existent table " << tblHandle); |
| 142 | return -1; |
| 143 | } |
| 144 | |
| 145 | vtkSQLDatabaseSchemaInternals::Table* table = &this->Internals->Tables[tblHandle]; |
| 146 | if (colHandle < 0 || colHandle >= static_cast<int>(table->Columns.size())) |
| 147 | { |
| 148 | vtkErrorMacro("Cannot add non-existent column " << colHandle << " in table " << tblHandle); |
| 149 | return -1; |
| 150 | } |
| 151 | |
| 152 | if (idxHandle < 0 || idxHandle >= static_cast<int>(table->Indices.size())) |
| 153 | { |
| 154 | vtkErrorMacro( |
| 155 | "Cannot add column to non-existent index " << idxHandle << " of table " << tblHandle); |
| 156 | return -1; |
| 157 | } |
| 158 | |
| 159 | table->Indices[idxHandle].ColumnNames.push_back(table->Columns[colHandle].Name); |
| 160 | return static_cast<int>(table->Indices[idxHandle].ColumnNames.size() - 1); |
| 161 | } |
| 162 | |
| 163 | //------------------------------------------------------------------------------ |
| 164 | int vtkSQLDatabaseSchema::AddColumnToTable( |
no test coverage detected