diff options
author | Laurent Goujon <laurent@dremio.com> | 2017-01-25 10:32:33 -0800 |
---|---|---|
committer | Parth Chandra <pchandra@maprtech.com> | 2017-02-07 22:22:53 -0800 |
commit | 2b5f5428af6951c71461c2bd2253e184ad0c4631 (patch) | |
tree | 2af7e0ddde0cdddae0936f9dd5c14282388bb8ec /contrib/native/client/src | |
parent | 478de241dd28b41bcb4487fe67937dca33522dc7 (diff) |
DRILL-5219: Relax user properties validation in C++ client
Unlike Java client, C++ client only allows user properties present in a
whitelist. Relax this restriction so that user can add extra properties.
This closes #727
Diffstat (limited to 'contrib/native/client/src')
-rw-r--r-- | contrib/native/client/src/clientlib/drillClient.cpp | 6 | ||||
-rw-r--r-- | contrib/native/client/src/clientlib/drillClientImpl.cpp | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/contrib/native/client/src/clientlib/drillClient.cpp b/contrib/native/client/src/clientlib/drillClient.cpp index b456d1780..f97a25c5f 100644 --- a/contrib/native/client/src/clientlib/drillClient.cpp +++ b/contrib/native/client/src/clientlib/drillClient.cpp @@ -367,11 +367,7 @@ connectionStatus_t DrillClient::connect(const char* connectStr, DrillUserPropert connectionStatus_t ret=CONN_SUCCESS; ret=this->m_pImpl->connect(connectStr); if(ret==CONN_SUCCESS){ - if(properties!=NULL){ - ret=this->m_pImpl->validateHandshake(properties); - }else{ - ret=this->m_pImpl->validateHandshake(NULL); - } + ret=this->m_pImpl->validateHandshake(properties); } return ret; } diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp index 8794044af..05171e5c8 100644 --- a/contrib/native/client/src/clientlib/drillClientImpl.cpp +++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp @@ -370,8 +370,13 @@ connectionStatus_t DrillClientImpl::validateHandshake(DrillUserProperties* prope for(size_t i=0; i<properties->size(); i++){ std::map<std::string,uint32_t>::const_iterator it=DrillUserProperties::USER_PROPERTIES.find(properties->keyAt(i)); if(it==DrillUserProperties::USER_PROPERTIES.end()){ - DRILL_MT_LOG(DRILL_LOG(LOG_WARNING) << "Connection property ("<< properties->keyAt(i) - << ") is unknown and is being skipped" << std::endl;) + DRILL_MT_LOG(DRILL_LOG(LOG_INFO) << "Connection property ("<< properties->keyAt(i) + << ") is unknown" << std::endl;) + + exec::user::Property* connProp = userProperties->add_properties(); + connProp->set_key(properties->keyAt(i)); + connProp->set_value(properties->valueAt(i)); + continue; } if(IS_BITSET((*it).second,USERPROP_FLAGS_SERVERPROP)){ |