summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
commita5c79e695f9dfd332d88e56ddbcea285201e6dcc (patch)
treec48935add10efe98ed234ec5d99df82d8228502a /connectivity/source/drivers
parenta001605a190749900d3e09aa864ce56925ff848e (diff)
parent2fa1d80dfd4ee347d4df32ca49fa8e9ad46ada10 (diff)
dba33f: merge with m76-branch
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/adabas/BColumns.cxx1
-rwxr-xr-xconnectivity/source/drivers/adabas/adabas.xcu5
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx7
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu10
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx1
-rwxr-xr-xconnectivity/source/drivers/dbase/dbase.xcu5
-rw-r--r--connectivity/source/drivers/evoab2/NColumns.cxx1
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx7
-rw-r--r--connectivity/source/drivers/file/FColumns.cxx1
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx1
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx37
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx2
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqldb.xcu5
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.xcu5
-rw-r--r--connectivity/source/drivers/kab/KColumns.cxx1
-rw-r--r--connectivity/source/drivers/kab/KStatement.cxx11
-rwxr-xr-xconnectivity/source/drivers/macab/MacabColumns.cxx1
-rwxr-xr-xconnectivity/source/drivers/macab/MacabStatement.cxx11
-rw-r--r--connectivity/source/drivers/mozab/MColumns.cxx1
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx1
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx21
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx10
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx14
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xcu25
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx1
28 files changed, 137 insertions, 54 deletions
diff --git a/connectivity/source/drivers/adabas/BColumns.cxx b/connectivity/source/drivers/adabas/BColumns.cxx
index 8fc009917fb2..bb0363792c12 100644
--- a/connectivity/source/drivers/adabas/BColumns.cxx
+++ b/connectivity/source/drivers/adabas/BColumns.cxx
@@ -96,6 +96,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
xRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),
diff --git a/connectivity/source/drivers/adabas/adabas.xcu b/connectivity/source/drivers/adabas/adabas.xcu
index 20c811bd2d5a..b92067235e15 100755
--- a/connectivity/source/drivers/adabas/adabas.xcu
+++ b/connectivity/source/drivers/adabas/adabas.xcu
@@ -65,6 +65,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="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index bb4b985e3bfc..aa287c185b26 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -65,7 +65,7 @@ void WpADOColumn::Create()
}
// -------------------------------------------------------------------------
OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn)
- : connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
+ : connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
,m_pConnection(_pConnection)
{
construct();
@@ -183,12 +183,13 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString::createFromAscii( "Autoincrement" ), getBOOL( rValue ) );
break;
+ case PROPERTY_ID_IM001:
case PROPERTY_ID_DESCRIPTION:
- pAdoPropertyName = "Default";
+ pAdoPropertyName = "Description";
break;
case PROPERTY_ID_DEFAULTVALUE:
- pAdoPropertyName = "Description";
+ pAdoPropertyName = "Default";
break;
}
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index 5859d5eecf3e..50c29cf7ba2e 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -134,6 +134,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:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">
@@ -228,6 +233,11 @@
<value>mdb</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:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 1d19c05a46c0..3d3e7db0b40e 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -525,7 +525,7 @@ void OCalcTable::fillColumns()
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE, nPrecision, nDecimals,
eType, sal_False, sal_False, bCurrency,
bStoresMixedCaseQuotedIdentifiers);
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index d19f419f17ae..ca5bedd17b4f 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -449,6 +449,7 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ);
Reference< XPropertySet> xCol = new sdbcx::OColumn(aColumnName,
aTypeName,
::rtl::OUString(),
+ ::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
aDBFColumn.db_dez,
diff --git a/connectivity/source/drivers/dbase/dbase.xcu b/connectivity/source/drivers/dbase/dbase.xcu
index 5e6e7596c3fe..f5de1d53ab0e 100755
--- a/connectivity/source/drivers/dbase/dbase.xcu
+++ b/connectivity/source/drivers/dbase/dbase.xcu
@@ -50,6 +50,11 @@
<value>false</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/evoab2/NColumns.cxx b/connectivity/source/drivers/evoab2/NColumns.cxx
index ddad36e52262..d1854e62181d 100644
--- a/connectivity/source/drivers/evoab2/NColumns.cxx
+++ b/connectivity/source/drivers/evoab2/NColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index 77598f97380c..feca8f55aeff 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -381,15 +381,16 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
// SQL like
else if( SQL_ISRULE( parseTree, like_predicate ) )
{
- ENSURE_OR_THROW( parseTree->count() >= 4, "unexpected like_predicate structure" );
+ ENSURE_OR_THROW( parseTree->count() == 2, "unexpected like_predicate structure" );
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
if( ! SQL_ISRULE( parseTree->getChild( 0 ), column_ref) )
m_pConnection->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this);
::rtl::OUString aColumnName( impl_getColumnRefColumnName_throw( *parseTree->getChild( 0 ) ) );
- OSQLParseNode *pAtom = parseTree->getChild( parseTree->count() - 2 ); // Match String
- bool bNotLike = parseTree->count() == 5;
+ OSQLParseNode *pAtom = pPart2->getChild( pPart2->count() - 2 ); // Match String
+ bool bNotLike = pPart2->getChild(0)->isToken();
if( !( pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||
diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx
index 7c70d4c4372d..3c3929a80c50 100644
--- a/connectivity/source/drivers/file/FColumns.cxx
+++ b/connectivity/source/drivers/file/FColumns.cxx
@@ -64,6 +64,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
sdbcx::OColumn* pRet = new sdbcx::OColumn(_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index 080b2a592aef..68e23360331b 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -511,6 +511,7 @@ UINT32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Refere
Reference<XPropertySet> xParaColumn = new connectivity::parse::OParseColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
+ ,::rtl::OUString()
,nNullable
,nPrecision
,nScale
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 9cf9874dbf10..b73fcf559cce 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -288,17 +288,14 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
- sal_Int32 ePredicateType;
sal_Unicode cEscape = L'\0';
- if (pPredicateNode->count() == 5)
- ePredicateType = SQLFilterOperator::NOT_LIKE;
- else
- ePredicateType = SQLFilterOperator::LIKE;
+ const bool bNotLike = pPart2->getChild(0)->isToken();
- OSQLParseNode* pAtom = pPredicateNode->getChild(pPredicateNode->count()-2);
- OSQLParseNode* pOptEscape = pPredicateNode->getChild(pPredicateNode->count()-1);
+ OSQLParseNode* pAtom = pPart2->getChild(pPredicateNode->count()-2);
+ OSQLParseNode* pOptEscape = pPart2->getChild(pPredicateNode->count()-1);
if (!(pAtom->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(pAtom,parameter)))
{
@@ -322,9 +319,9 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
execute(pPredicateNode->getChild(0));
execute(pAtom);
- OBoolOperator* pOperator = (ePredicateType == SQLFilterOperator::LIKE)
- ? new OOp_LIKE(cEscape)
- : new OOp_NOTLIKE(cEscape);
+ OBoolOperator* pOperator = bNotLike
+ ? new OOp_NOTLIKE(cEscape)
+ : new OOp_LIKE(cEscape);
m_aCodeList.push_back(pOperator);
return NULL;
@@ -332,11 +329,12 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() == 6,"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
OSQLParseNode* pColumn = pPredicateNode->getChild(0);
- OSQLParseNode* p1stValue = pPredicateNode->getChild(3);
- OSQLParseNode* p2ndtValue = pPredicateNode->getChild(5);
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
+ OSQLParseNode* p1stValue = pPart2->getChild(3);
+ OSQLParseNode* p2ndtValue = pPart2->getChild(5);
if (
!(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter))
@@ -346,7 +344,7 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_BETWEEN,NULL);
}
- sal_Bool bNot = SQL_ISTOKEN(pPredicateNode->getChild(1),NOT);
+ sal_Bool bNot = SQL_ISTOKEN(pPart2->getChild(0),NOT);
OOperand* pColumnOp = execute(pColumn);
OOperand* pOb1 = execute(p1stValue);
@@ -411,11 +409,12 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() >= 3,"OFILECursor: Fehler im Parse Tree");
- DBG_ASSERT(SQL_ISTOKEN(pPredicateNode->getChild(1),IS),"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
+ DBG_ASSERT(SQL_ISTOKEN(pPart2->getChild(0),IS),"OFILECursor: Fehler im Parse Tree");
sal_Int32 ePredicateType;
- if (SQL_ISTOKEN(pPredicateNode->getChild(2),NOT))
+ if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
ePredicateType = SQLFilterOperator::NOT_SQLNULL;
else
ePredicateType = SQLFilterOperator::SQLNULL;
@@ -635,7 +634,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch ( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
case SQL_TOKEN_ASCII:
@@ -677,7 +675,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
pOperator = new OOp_CharLength();
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 2d46c3be5bf3..eff2464ce533 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -304,7 +304,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
nScale,
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.xcu b/connectivity/source/drivers/hsqldb/hsqldb.xcu
index e5ab3cc4ba14..f97b5e357179 100755
--- a/connectivity/source/drivers/hsqldb/hsqldb.xcu
+++ b/connectivity/source/drivers/hsqldb/hsqldb.xcu
@@ -50,6 +50,11 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
index 59fb95460aa2..f4f599a701d9 100755
--- a/connectivity/source/drivers/jdbc/jdbc.xcu
+++ b/connectivity/source/drivers/jdbc/jdbc.xcu
@@ -189,6 +189,11 @@
<value>oracle.jdbc.driver.OracleDriver</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="IgnoreCurrency" oor:op="replace">
diff --git a/connectivity/source/drivers/kab/KColumns.cxx b/connectivity/source/drivers/kab/KColumns.cxx
index d75e782aed7b..4adcbe304c82 100644
--- a/connectivity/source/drivers/kab/KColumns.cxx
+++ b/connectivity/source/drivers/kab/KColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType KabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx
index 4164ffe0ee52..f0069fc6875e 100644
--- a/connectivity/source/drivers/kab/KStatement.cxx
+++ b/connectivity/source/drivers/kab/KStatement.cxx
@@ -185,12 +185,13 @@ KabCondition *KabCommonStatement::analyseWhereClause(const OSQLParseNode *pParse
}
}
}
- else if (pParseNode->count() == 4)
+ else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddleLeft = pParseNode->getChild(1),
- *pMiddleRight = pParseNode->getChild(2),
- *pRight = pParseNode->getChild(3);
+ const OSQLParseNode *pLeft = pParseNode->getChild(0);
+ const OSQLParseNode* pPart2 = pParseNode->getChild(1);
+ const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
+ *pMiddleRight = pPart2->getChild(1),
+ *pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{
diff --git a/connectivity/source/drivers/macab/MacabColumns.cxx b/connectivity/source/drivers/macab/MacabColumns.cxx
index 9eccf1a11b73..c1ba3f1fe6d0 100755
--- a/connectivity/source/drivers/macab/MacabColumns.cxx
+++ b/connectivity/source/drivers/macab/MacabColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType MacabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx
index 8ee24921667a..9960ea7a4d97 100755
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabStatement.cxx
@@ -188,12 +188,13 @@ MacabCondition *MacabCommonStatement::analyseWhereClause(const OSQLParseNode *pP
}
}
}
- else if (pParseNode->count() == 4)
+ else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddleLeft = pParseNode->getChild(1),
- *pMiddleRight = pParseNode->getChild(2),
- *pRight = pParseNode->getChild(3);
+ const OSQLParseNode *pLeft = pParseNode->getChild(0);
+ const OSQLParseNode* pPart2 = pParseNode->getChild(1);
+ const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
+ *pMiddleRight = pPart2->getChild(1),
+ *pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{
diff --git a/connectivity/source/drivers/mozab/MColumns.cxx b/connectivity/source/drivers/mozab/MColumns.cxx
index 17b418899f45..42a33bbc2a98 100644
--- a/connectivity/source/drivers/mozab/MColumns.cxx
+++ b/connectivity/source/drivers/mozab/MColumns.cxx
@@ -74,6 +74,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
OColumn* pRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
index 38caad53b551..5aad943b151a 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
@@ -450,6 +450,7 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re
Reference<XPropertySet> xParaColumn = new connectivity::sdbcx::OColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
+ ,::rtl::OUString()
,nNullable
,nPrecision
,nScale
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index 9602a35a8b29..c7c85770419e 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -882,7 +882,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,like_predicate))
{
- OSL_ENSURE(parseTree->count() >= 4, "Error parsing LIKE predicate");
+ OSL_ENSURE(parseTree->count() == 2, "Error parsing LIKE predicate");
OSL_TRACE("analyseSQL : Got LIKE rule\n");
@@ -895,9 +895,11 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
OSQLParseNode *pColumn;
OSQLParseNode *pAtom;
OSQLParseNode *pOptEscape;
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
pColumn = parseTree->getChild(0); // Match Item
- pAtom = parseTree->getChild(parseTree->count()-2); // Match String
- pOptEscape = parseTree->getChild(parseTree->count()-1); // Opt Escape Rule
+ pAtom = pPart2->getChild(parseTree->count()-2); // Match String
+ pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule
+ const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT);
if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||
@@ -945,7 +947,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString.indexOf ( MATCHCHAR ) == -1 )
{
// Simple string , eg. "to match"
- if ( parseTree->count() == 5 )
+ if ( bNot )
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
@@ -961,12 +963,12 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString = matchString.replaceAt( 0, 1, rtl::OUString() );
matchString = matchString.replaceAt( matchString.getLength() -1 , 1, rtl::OUString() );
- if ( parseTree->count() == 5 )
+ if (bNot)
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
}
- else if ( parseTree->count() == 5 )
+ else if ( bNot )
{
// We currently can't handle a 'NOT LIKE' when there are '%' or
// '_' dispersed throughout
@@ -1020,15 +1022,16 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,test_for_null))
{
- OSL_ENSURE(parseTree->count() >= 3,"Error in ParseTree");
- OSL_ENSURE(SQL_ISTOKEN(parseTree->getChild(1),IS),"Error in ParseTree");
+ OSL_ENSURE(parseTree->count() == 2,"Error in ParseTree");
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
+ OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"Error in ParseTree");
if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
{
m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_IS_NULL_COLUMN, *this );
}
- if (SQL_ISTOKEN(parseTree->getChild(2),NOT))
+ if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
{
op = MQueryOp::Exists;
}
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);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index b337ddc92390..80bb2baf58c0 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/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
index 2fc59be5bdc3..afc5c0d07f5d 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>
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 80aacacef576..751ab7cf2988 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -97,7 +97,7 @@ ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
osl_incrementInterlockedCount( &m_refCount );
dispose();
}
- delete m_pRowStatusArray;
+ delete [] m_pRowStatusArray;
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::disposing(void)
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index da29bcf08c17..7055bd273370 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -162,7 +162,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
// -------------------------------------------------------------------------
OResultSet::~OResultSet()
{
- delete m_pRowStatusArray;
+ delete [] m_pRowStatusArray;
delete m_pSkipDeletedSet;
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index b892e6336b19..43de55e3505c 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -391,6 +391,7 @@ void OTools::bindValue( OConnection* _pConnection,
case SQL_TIMESTAMP:
*pLen = sizeof(TIMESTAMP_STRUCT);
*((TIMESTAMP_STRUCT*)_pData) = *(TIMESTAMP_STRUCT*)_pValue;
+ break;
}
}
catch ( ... )