summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/mysql/YTable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/mysql/YTable.cxx')
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index 72383be76c58..06be64f83313 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -220,12 +220,16 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bOldAutoIncrement;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
bool bColumnNameChanged = false;
+ ::rtl::OUString sOldDesc,sNewDesc;
+ xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sOldDesc;
+ descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sNewDesc;
if ( nOldType != nNewType
|| nOldPrec != nNewPrec
|| nOldScale != nNewScale
|| nNewNullable != nOldNullable
- || bOldAutoIncrement != bAutoIncrement )
+ || bOldAutoIncrement != bAutoIncrement
+ || sOldDesc != sNewDesc )
{
// special handling because they change dthe type names to distinguish
// if a column should be an auto_incmrement one
@@ -281,7 +285,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
sSql += ::dbtools::quoteName(sQuote,colName);
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()));
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@@ -310,7 +314,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo
::comphelper::copyProperties(_xDescriptor,xProp);
xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()));
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
// -----------------------------------------------------------------------------