summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-02-07 17:01:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-02-07 17:22:15 +0000
commitcd5b03ecc1389806f92242dff8285ab8654231c9 (patch)
treec706ff9698f4f37377236e3a35a91f22c34d76da /dbaccess
parentaf3662e3e2172c3bc8178f7ce4042ef26eb2ac3a (diff)
Fix busted multi-repeated column in evolution database view
In the evolution address book where we have real column names of e.g. first_name, second_name and city. On parsing via OSQLParseTreeIterator::appendColumns that creates some labels using those real names but the evo XResultSet gives them proper labels of First Name, Second Name and City the munge means that here we have e.g. just "City" as a label because it matches, while the others don't The symptoms are to load the evolocal.odb and of the 128 columns column 5 is repeated until 128 This is all a horrible confusing mess. It seems safest to catch the mismatch of column counts and throw away the partial list and force a generate of a full list. Change-Id: I1d6e2a282bdd43acac63c366eb2a9d029aa17878
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index f398a468ec74..ca532914bbcd 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -937,6 +937,18 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr
} while ( false );
+ bool bMissingSomeColumnLabels = !aNames.empty() && aNames.size() != aSelectColumns->get().size();
+ SAL_WARN_IF(bMissingSomeColumnLabels, "dbaccess", "We have column labels for *some* columns but not all");
+ //^^this happens in the evolution address book where we have real column names of e.g.
+ //first_name, second_name and city. On parsing via
+ //OSQLParseTreeIterator::appendColumns it creates some labels using those real names
+ //but the evo address book gives them proper labels of First Name, Second Name and City
+ //the munge means that here we have e.g. just "City" as a label because it matches
+ //
+ //This is all a horrible mess
+ if (bMissingSomeColumnLabels)
+ aNames.clear();
+
if ( aNames.empty() )
m_aCurrentColumns[ SelectColumns ] = OPrivateColumns::createWithIntrinsicNames( aSelectColumns, bCase, *this, m_aMutex );
else