summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-04-04 14:43:00 -0400
committerJackLivio <jack@livio.io>2018-04-04 14:43:00 -0400
commit230ad92b9a83797c80bbc29a03b3fe66f7a9a13b (patch)
treeb5a263374b9e9248eea73c6c25de7f7946b241f4
parent5cc7b1be23764cb9763154ecb6d56e038f9eccb5 (diff)
downloadsdl_core-fix/load_service_type_as_string_from_backup_pt.tar.gz
When loading the policy table from backup sql file, service types must be read in a strings.
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc8
-rw-r--r--src/components/utils/test/policy.sql2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 6cc68cb102..4315d99b3a 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -559,10 +559,10 @@ void SQLPTRepresentation::GatherModuleConfig(
LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
} else {
while (endpoints.Next()) {
- std::stringstream stream;
- stream << "0x0" << endpoints.GetInteger(1);
- config->endpoints[stream.str()][endpoints.GetString(2)].push_back(
- endpoints.GetString(0));
+ const std::string& url = endpoints.GetString(0);
+ const std::string& service = endpoints.GetString(1);
+ const std::string& app_id = endpoints.GetString(2);
+ config->endpoints[service][app_id].push_back(url);
}
}
diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql
index 292855734e..d588d695a6 100644
--- a/src/components/utils/test/policy.sql
+++ b/src/components/utils/test/policy.sql
@@ -263,7 +263,7 @@ BEGIN TRANSACTION;
CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
ON `consent_group`(`functional_group_id`);
CREATE TABLE IF NOT EXISTS `endpoint`(
- `service` INTEGER NOT NULL,
+ `service` VARCHAR(100) NOT NULL,
`url` VARCHAR(100) NOT NULL,
`application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
CONSTRAINT `fk_endpoint_application1`