Search in sources :

Example 6 with CatalogRowFactory

use of org.apache.derby.iapi.sql.dictionary.CatalogRowFactory in project derby by apache.

the class DD_Version method modifySysTableNullability.

/**
 * Modifies the nullability of the system table corresponding
 * to the received catalog number.
 *
 * @param tc			TransactionController.
 * @param catalogNum	The catalog number corresponding
 *  to the table for which we will modify the nullability.
 *
 *  OLD Cloudscape 5.1 upgrade code
 *  If this corresponds to SYSALIASES, then the nullability of
 *  the SYSALIASES.ALIASINFO column will be changed to true
 *  (Beetle 4430).  If this corresponds to SYSSTATEMENTS,
 *  the nullability of the SYSSTATEMENTS.LASTCOMPILED
 *  column will be changed to true.
 *
 *  Derby upgrade code
 *  If this corresponds to SYSSTATEMENTS, then the nullability of
 *  the SYSSTATEMENTS.COMPILATION_SCHEMAID column will
 *  be changed to true.  If this corresponds to SYSVIEWS, the nullability
 *  of the SYSVIEWS.COMPILATION_SCHEMAID column will be changed to true.
 *
 * @exception StandardException   Thrown on error
 */
private void modifySysTableNullability(TransactionController tc, int catalogNum) throws StandardException {
    TabInfoImpl ti = bootingDictionary.getNonCoreTIByNumber(catalogNum);
    CatalogRowFactory rowFactory = ti.getCatalogRowFactory();
    if (catalogNum == DataDictionaryImpl.SYSSTATEMENTS_CATALOG_NUM) {
        // SYSSTATEMENTS table ==> SYSSTATEMENTS_COMPILATION_SCHEMAID needs
        // to be modified.
        bootingDictionary.upgradeFixSystemColumnDefinition(rowFactory, SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COMPILATION_SCHEMAID, tc);
    } else if (catalogNum == DataDictionaryImpl.SYSVIEWS_CATALOG_NUM) {
        // SYSVIEWS table ==> SYSVIEWS_COMPILATION_SCHEMAID needs
        // to be modified.
        bootingDictionary.upgradeFixSystemColumnDefinition(rowFactory, SYSVIEWSRowFactory.SYSVIEWS_COMPILATION_SCHEMAID, tc);
    }
/* OLD Cloudscape 5.1 upgrade code. See applySafeChanges(). 
		if (catalogNum == DataDictionaryImpl.SYSALIASES_CATALOG_NUM) {
		// SYSALIASES table ==> ALIASINFO needs to be modified.
			bootingDictionary.upgrade_setNullability(rowFactory,
				SYSALIASESRowFactory.SYSALIASES_ALIASINFO, true, tc);
		}
		else if (catalogNum == DataDictionaryImpl.SYSSTATEMENTS_CATALOG_NUM) {
		// SYSSTATEMENTS table ==> LASTCOMPILED needs to be modified.
			bootingDictionary.upgrade_setNullability(rowFactory,
				SYSSTATEMENTSRowFactory.SYSSTATEMENTS_LASTCOMPILED, true, tc);
		}
		*/
}
Also used : CatalogRowFactory(org.apache.derby.iapi.sql.dictionary.CatalogRowFactory)

Aggregations

CatalogRowFactory (org.apache.derby.iapi.sql.dictionary.CatalogRowFactory)6 ExecRow (org.apache.derby.iapi.sql.execute.ExecRow)4 SQLLongint (org.apache.derby.iapi.types.SQLLongint)3 ConglomerateDescriptor (org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)2 ExecIndexRow (org.apache.derby.iapi.sql.execute.ExecIndexRow)2 ConglomerateController (org.apache.derby.iapi.store.access.ConglomerateController)2 ScanController (org.apache.derby.iapi.store.access.ScanController)2 RowLocation (org.apache.derby.iapi.types.RowLocation)2 Properties (java.util.Properties)1 UUID (org.apache.derby.catalog.UUID)1 FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)1 ColumnDescriptor (org.apache.derby.iapi.sql.dictionary.ColumnDescriptor)1 ColumnDescriptorList (org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList)1 IndexRowGenerator (org.apache.derby.iapi.sql.dictionary.IndexRowGenerator)1 SystemColumn (org.apache.derby.iapi.sql.dictionary.SystemColumn)1 TableDescriptor (org.apache.derby.iapi.sql.dictionary.TableDescriptor)1 TransactionController (org.apache.derby.iapi.store.access.TransactionController)1 StandardException (org.apache.derby.shared.common.error.StandardException)1 AssertFailure (org.apache.derby.shared.common.sanity.AssertFailure)1