summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-01-03 13:56:33 +0100
committerOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-01-03 13:56:33 +0100
commit3ff6379e53a0f47f56417a41937fe92996980cb8 (patch)
treee937fd742aa4867a3a0648548b8ad5a6a85a0fbc
parent00d0b523b7913b534a6f7fef4f2a86e9472d0208 (diff)
dba34c: fix for cast and char compare
-rw-r--r--connectivity/inc/connectivity/sqlnode.hxx1
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx5
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx5
-rwxr-xr-xconnectivity/source/drivers/macab/MacabRecord.cxx2
-rw-r--r--connectivity/source/parse/sqlnode.cxx11
5 files changed, 21 insertions, 3 deletions
diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx
index fa283cb5cf04..04ec8dc153df 100644
--- a/connectivity/inc/connectivity/sqlnode.hxx
+++ b/connectivity/inc/connectivity/sqlnode.hxx
@@ -231,6 +231,7 @@ namespace connectivity
character_string_type,
other_like_predicate_part_2,
between_predicate_part_2,
+ cast_spec,
rule_count, // letzter_wert
UNKNOWN_RULE // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID)
};
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index aa287c185b26..510c2790e777 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -165,7 +165,8 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
{
sal_Int32 nVal=0;
rValue >>= nVal;
- m_aColumn.put_NumericScale((sal_Int8)nVal);
+ if ( !m_IsCurrency )
+ m_aColumn.put_NumericScale((sal_Int8)nVal);
}
break;
case PROPERTY_ID_ISNULLABLE:
@@ -212,6 +213,8 @@ void OAdoColumn::fillPropertyValues()
DataTypeEnum eType = m_aColumn.get_Type();
m_IsCurrency = (eType == adCurrency);
+ if ( m_IsCurrency && !m_Scale)
+ m_Scale = 4;
m_Type = ADOS::MapADOType2Jdbc(eType);
sal_Bool bForceTo = sal_True;
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index a7e2ec4df490..6596b9b8d946 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -466,6 +466,11 @@ void OConnection::buildTypeInfo() throw( SQLException)
aInfo->aSimpleType.aLocalTypeName = ADOS::getField(pRecordset,nPos++).get_Value();
aInfo->aSimpleType.nMinimumScale = ADOS::getField(pRecordset,nPos++).get_Value();
aInfo->aSimpleType.nMaximumScale = ADOS::getField(pRecordset,nPos++).get_Value();
+ if ( adCurrency == aInfo->eType && !aInfo->aSimpleType.nMaximumScale)
+ {
+ aInfo->aSimpleType.nMinimumScale = 4;
+ aInfo->aSimpleType.nMaximumScale = 4;
+ }
aInfo->aSimpleType.nNumPrecRadix = ADOS::getField(pRecordset,nPos++).get_Value();
// Now that we have the type info, save it
// in the Hashtable if we don't already have an
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
index 35817526ff17..e161ece74522 100755
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ b/connectivity/source/drivers/macab/MacabRecord.cxx
@@ -202,7 +202,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield
result = CFStringCompare(
(CFStringRef) _field1->value,
(CFStringRef) _field2->value,
- 0); // 0 = no options (like ignore case)
+ kCFCompareLocalized); // Specifies that the comparison should take into account differences related to locale, such as the thousands separator character.
break;
case kABDateProperty:
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index f9f348592a6f..77c7118a1d38 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1425,7 +1425,8 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
{ OSQLParseNode::parenthesized_boolean_value_expression, "parenthesized_boolean_value_expression" },
{ OSQLParseNode::character_string_type, "character_string_type" },
{ OSQLParseNode::other_like_predicate_part_2, "other_like_predicate_part_2" },
- { OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" }
+ { OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" },
+ { OSQLParseNode::cast_spec, "cast_spec" }
};
size_t nRuleMapCount = sizeof( aRuleDescriptions ) / sizeof( aRuleDescriptions[0] );
OSL_ENSURE( nRuleMapCount == size_t( OSQLParseNode::rule_count ), "OSQLParser::OSQLParser: added a new rule? Adjust this map!" );
@@ -2511,6 +2512,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
rString.append(m_aNodeValue);
rString.appendAscii("#");
break;
+
case SQL_NODE_INTNUM:
case SQL_NODE_APPROXNUM:
{
@@ -2523,6 +2525,13 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
rString.append(aTmp);
} break;
+
+ case SQL_NODE_PUNCTUATION:
+ if ( getParent() && SQL_ISRULE(getParent(),cast_spec) && m_aNodeValue.toChar() == '(' ) // no spaces in front of '(' or after ')'
+ {
+ rString.append(m_aNodeValue);
+ break;
+ }
// fall through
default:
if (rString.getLength() && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' )