[Libreoffice-commits] core.git: 5 commits - connectivity/source sal/inc unotools/inc
Lionel Elie Mamane
lionel at mamane.lu
Wed Apr 10 09:12:42 PDT 2013
connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx | 11 -----
connectivity/source/drivers/postgresql/pq_statement.cxx | 2
connectivity/source/drivers/postgresql/pq_tools.cxx | 14 +++++-
connectivity/source/parse/sqlbison.y | 21 +++++-----
connectivity/source/parse/sqlnode.cxx | 4 -
sal/inc/sal/log-areas.dox | 1
unotools/inc/unotools/sharedunocomponent.hxx | 2
7 files changed, 29 insertions(+), 26 deletions(-)
New commits:
commit 60e9d2dd5c0e1c085de7354b1ca5cd1cb8b0d082
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Apr 10 17:47:17 2013 +0200
janitorial: spelling in comment
Change-Id: I0c232a60d4ab55fae5b78712d9acc4bac93f90c3
diff --git a/unotools/inc/unotools/sharedunocomponent.hxx b/unotools/inc/unotools/sharedunocomponent.hxx
index 2558dfc..5fa399d 100644
--- a/unotools/inc/unotools/sharedunocomponent.hxx
+++ b/unotools/inc/unotools/sharedunocomponent.hxx
@@ -191,7 +191,7 @@ namespace utl
#endif
// SharedUNOComponent& operator=( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent );
- // this operator is not implemented by intention. There is no canonic ownership after this operatoer
+ // This operator is intentionally not implemented. There is no canonic ownership after this operator
// would have been applied: Should the SharedUNOComponent have the ownership of the component,
// or shouldn't it? Hard to guess, and probably wrong in 50 percent of all cases, anyway. So,
// instead of tempting clients of this class to use such a dangerous operator, we do
commit 86ef5f6f8cee5ada8c9cbd6ba73a93ced1dad6b5
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Apr 10 17:38:41 2013 +0200
remove impossible case
nCount == 5 is impossible; the grammar has changed since this code was written.
It used to refer to case '(' joined_table ')' range_variable op_column_commalist
which has become just '(' joined_table ')'
which thus has (by definition) no table range (alias).
Case changed in mega-(merge-)commit:
commit c41efc6d0b2740be4243fd696385f8dbcec0aefe
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Wed Nov 19 17:43:08 2008 +0000
CWS-TOOLING: integrate CWS dba301a_DEV300
which seems to have done the other necessary adaptations to this code
and elsewhere.
Change-Id: I96ddbefbf34d6c155435b78aa9e5037a760232ed
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index c23e9ae..e4ba3e9 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2695,7 +2695,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef)
OSL_ENSURE(_pTableRef && _pTableRef->count() > 1 && _pTableRef->getKnownRuleID() == OSQLParseNode::table_ref,"Invalid node give, only table ref is allowed!");
const sal_uInt32 nCount = _pTableRef->count();
OUString sTableRange;
- if ( nCount == 2 || (nCount == 3 && !_pTableRef->getChild(0)->isToken()) || nCount == 5 )
+ if ( nCount == 2 || (nCount == 3 && !_pTableRef->getChild(0)->isToken()) )
{
const OSQLParseNode* pNode = _pTableRef->getChild(nCount - (nCount == 2 ? 1 : 2));
OSL_ENSURE(pNode && (pNode->getKnownRuleID() == OSQLParseNode::table_primary_as_range_column
@@ -2703,7 +2703,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef)
,"SQL grammar changed!");
if ( !pNode->isLeaf() )
sTableRange = pNode->getChild(1)->getTokenValue();
- } // if ( nCount == 2 || nCount == 3 || nCount == 5)
+ } // if ( nCount == 2 || nCount == 3 )
return sTableRange;
}
commit d42b1afc4fd04f2c0c5cff0c56dd371fefe81018
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Apr 10 17:16:58 2013 +0200
janitorial: indentation
Change-Id: Icf3b500b9317cd45b3dc424da155ab6c48227ea5
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 14a89d5..f823595 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -982,19 +982,19 @@ table_exp:
from_clause:
SQL_TOKEN_FROM table_ref_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
+ { $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2); }
;
table_ref_commalist:
table_ref
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
+ { $$ = SQL_NEW_COMMALISTRULE;
+ $$->append($1); }
| table_ref_commalist ',' table_ref
- {$1->append($3);
- $$ = $1;}
+ { $1->append($3);
+ $$ = $1; }
;
opt_as:
@@ -1008,10 +1008,11 @@ opt_row:
table_primary_as_range_column:
{$$ = SQL_NEW_RULE;}
| opt_as SQL_TOKEN_NAME op_column_commalist
- {$$ = SQL_NEW_RULE;
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
$$->append($2);
- $$->append($3);
+ $$->append($3);
}
;
table_ref:
@@ -1026,7 +1027,7 @@ table_ref:
$$ = SQL_NEW_RULE;
$$->append($1);
$$->append($2);
- $$->append($3);
+ $$->append($3);
}
| joined_table
| '{' SQL_TOKEN_OJ joined_table '}'
commit fe294e9208cd022acb163aa2f8f27aa0a05d09ca
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Apr 10 17:16:27 2013 +0200
pgsql-sdbc: set tablename even if we do not know the schema
Change-Id: I74c04e1262cc413696a12aca9af603beded7b07f
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 6326da3..cfbbd9f 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -648,7 +648,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
}
}
- else if( sourceTable.getLength() && -1 != sourceTable.indexOf( '.' ) )
+ else if( sourceTable.getLength() > 0)
{
splitConcatenatedIdentifier( sourceTable, &schema, &table );
}
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 5ac5626..ccce76f 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -670,10 +670,20 @@ void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUSt
{
OStringVector vec;
tokenizeSQL( OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
- if( vec.size() == 3 )
+ switch (vec.size())
{
- *first = OStringToOUString( vec[0] , RTL_TEXTENCODING_UTF8 );
+ case 1:
+ *first = OUString();
+ *second = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 );
+ break;
+ case 3:
+ *first = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 );
*second = OStringToOUString( vec[2], RTL_TEXTENCODING_UTF8 );
+ break;
+ default:
+ SAL_WARN("connectivity.postgresql",
+ "pq_tools::splitConcatenatedIdentifier unexpected number of tokens in identifier: "
+ << vec.size());
}
}
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 98adef8..d21f143 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -55,6 +55,7 @@ certain functionality.
@li @c connectivity.commontools
@li @c connectivity.mork
@li @c connectivity.parse
+ at li @c connectivity.postgresql
@section cui
commit b8361945d6aa3690e2ef9eca8b18395602d8b682
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Apr 10 17:15:23 2013 +0200
pgsql-sdbc: ResultSetMetaData::getTableName return tablename (without schema)
Change-Id: I319ba91045fa43922d7b694a4f13322295590c81
diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
index a483f98..96f7d37 100644
--- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
@@ -402,16 +402,7 @@ OUString ResultSetMetaData::getTableName( sal_Int32 column )
{
(void) column;
// LEM TODO This is very fishy.. Should probably return the table to which that column belongs!
- OUString ret;
- if( m_tableName.getLength() )
- {
- OUStringBuffer buf( 128 );
- buf.append( m_schemaName );
- buf.appendAscii( "." );
- buf.append( m_tableName );
- ret = buf.makeStringAndClear();
- }
- return ret;
+ return m_tableName;
}
OUString ResultSetMetaData::getCatalogName( sal_Int32 column )
More information about the Libreoffice-commits
mailing list