summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/mysql
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/mysql')
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx10
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx14
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk2
-rw-r--r--connectivity/source/drivers/mysql/mysql.map8
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xcu25
5 files changed, 45 insertions, 14 deletions
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index 8b91207002..a6d9484a49 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);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index d147a66793..ffb94553ee 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -204,7 +204,7 @@ void OTables::createTable( const Reference< XPropertySet >& descriptor )
{
const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern));
+ const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern));
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
{
@@ -230,4 +230,14 @@ void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false );
}
// -----------------------------------------------------------------------------
-
+void OTables::addComment(const Reference< XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut)
+{
+ ::rtl::OUString sDesc;
+ descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sDesc;
+ if ( sDesc.getLength() )
+ {
+ _rOut.appendAscii(" COMMENT '");
+ _rOut.append(sDesc);
+ _rOut.appendAscii("'");
+ }
+}
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index af486c2938..fbb68321cb 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
$(SLO)$/YUsers.obj \
$(SLO)$/Yservices.obj
-SHL1VERSIONMAP=$(MYSQL_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/mysql/mysql.map b/connectivity/source/drivers/mysql/mysql.map
deleted file mode 100644
index 834658431a..0000000000
--- a/connectivity/source/drivers/mysql/mysql.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MYSQL_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mysql/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
index 21c5795db0..16e3c82031 100755
--- a/connectivity/source/drivers/mysql/mysql.xcu
+++ b/connectivity/source/drivers/mysql/mysql.xcu
@@ -45,6 +45,11 @@
<value>com.mysql.jdbc.Driver</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -94,6 +99,11 @@
<value>UserPassword</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
<node oor:name="sdbc:mysql:odbc:*" oor:op="replace">
@@ -109,6 +119,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -183,6 +198,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -227,6 +247,11 @@
<value>UserPassword</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
</node>