Commits

Anonymous committed 8d84714 Merge

Automated merge with ssh://hg.services.openoffice.org/cws/dba34d

Comments (0)

Files changed (4)

connectivity/source/drivers/file/fcomp.cxx

 	OSQLParseNode* pAtom		= pPart2->getChild(pPart2->count()-2);
 	OSQLParseNode* pOptEscape	= pPart2->getChild(pPart2->count()-1);
 
-	if (!(pAtom->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(pAtom,parameter)))
+	if (!(pAtom->getNodeType() == SQL_NODE_STRING 	||
+		  SQL_ISRULE(pAtom,parameter)				||
+		  // odbc date
+		  SQL_ISRULE(pAtom,set_fct_spec)			||
+		  SQL_ISRULE(pAtom,position_exp)			||
+		  SQL_ISRULE(pAtom,char_substring_fct)		||
+		  // upper, lower etc.
+		  SQL_ISRULE(pAtom,fold)) )
 	{
-        m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,NULL);
+        m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,NULL);
+		return NULL;
 	}
+
 	if (pOptEscape->count() != 0)
 	{
 		if (pOptEscape->count() != 2)

connectivity/source/drivers/flat/ETable.cxx

 			// name and extension have to coincide
 			if ( m_pConnection->matchesExtension( sExt ) )
 			{
-				sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
+				if ( sExt.getLength() )
+					sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
 				if ( sName == m_Name )
 				{
 					Reference< XContentAccess > xContentAccess( xDir, UNO_QUERY );

connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx

 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
 
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
 
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
+	if ( catalog.hasValue() )
 	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
 
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN,aCOL;
 
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN;
 
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,
 	m_bFreeHandle = sal_True;
 	::rtl::OString aPKQ,aPKO,aPKN;
 
-	aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+	if ( catalog.hasValue() )
+		aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
 	aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
 
 	const char	*pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr()	: NULL,

dbaccess/source/core/misc/DatabaseDataProvider.cxx

     }
 
     ::std::vector< ::rtl::OUString > aRowLabels;
-	::std::vector< double > aDateRowLabels;
     ::std::vector< ::std::vector< double > > aDataValues;
     sal_Int32 nRowCount = 0;
     ::connectivity::ORowSetValue aValue;
         ++nRowCount;
         
         aValue.fill( aColumns[0].nResultSetPosition, aColumns[0].nDataType, xRow );
-		switch(aColumns[0].nDataType)
-		{
-			case sdbc::DataType::DATE:
-			case sdbc::DataType::TIMESTAMP:
-				aDateRowLabels.push_back( aValue.getDouble() );
-				break;
-			default:
-				aRowLabels.push_back( aValue.getString() );
-				break;
-		}
+		aRowLabels.push_back( aValue.getString() );
 
         ::std::vector< double > aRow;
         for (   ColumnDescriptions::const_iterator col = aColumns.begin();
     } // if ( !nRowCount )
         
 	uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY);
-	if ( aDateRowLabels.empty() )
-	{		
-		xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size()));
-	}
-	else
-	{
-		uno::Reference< chart::XDateCategories> xDate(m_xInternal,uno::UNO_QUERY);
-		xDate->setDateCategories(uno::Sequence< double >(&(*aDateRowLabels.begin()),aDateRowLabels.size()));
-	}
-    
+	xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size()));
 
     const size_t nOffset = bFirstColumnIsCategory ? 1 : 0;
     uno::Sequence< ::rtl::OUString > aColumnDescriptions( aColumns.size() - nOffset );