GitHub PullRequestReviewCommentEvent at 2014-01-29 03:03:52
Repository: voltdb
Actor: paulmartel
Payload: {"comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/9255214","id":9255214,"diff_hunk":"@@ -95,27 +95,31 @@ bool IndexCountExecutor::p_init(AbstractPlanNode *abstractNode,\n         m_endType = m_node->getEndType();\n     }\n \n-    //target table should be persistenttable\n-    m_targetTable = static_cast<PersistentTable*>(m_node->getTargetTable());\n+    assert(m_node->getTargetTable());\n     //\n     // Grab the Index from our inner table\n     // We'll throw an error if the index is missing\n     //\n-    m_index = m_targetTable->index(m_node->getTargetIndexName());\n-    assert (m_index != NULL);\n+\n+    Table* targetTable = m_node->getTargetTable();\n+    //target table should be persistenttable\n+    assert(static_cast<PersistentTable*>(targetTable));\n+\n+    TableIndex *tableIndex = targetTable->index(m_node->getTargetIndexName());\n+    assert (tableIndex != NULL);\n \n     // This index should have a true countable flag\n-    assert(m_index->isCountableIndex());\n+    assert(tableIndex->isCountableIndex());\n \n     if (m_numOfSearchkeys != 0) {\n-        m_searchKey = TableTuple(m_index->getKeySchema());\n-        m_searchKeyBackingStore = new char[m_index->getKeySchema()->tupleLength()];\n+        m_searchKey = TableTuple(tableIndex->getKeySchema());\n+        m_searchKeyBackingStore = new char[tableIndex->getKeySchema()->tupleLength()];","path":"src/ee/executors/indexcountexecutor.cpp","position":29,"original_position":29,"commit_id":"5e508ac0d9595d7170c1758e4359c362271ff760","original_commit_id":"5e508ac0d9595d7170c1758e4359c362271ff760","user":{"login":"paulmartel","id":1512099,"avatar_url":"https://gravatar.com/avatar/6ead0214cbf028f95dcc28142fa4d7bd?d=https%3A%2F%2Fidenticons.github.com%2F316ff0e036a700bdd4c960e0836f66d1.png&r=x","gravatar_id":"6ead0214cbf028f95dcc28142fa4d7bd","url":"https://api.github.com/users/paulmartel","html_url":"https://github.com/paulmartel","followers_url":"https://api.github.com/users/paulmartel/followers","following_url":"https://api.github.com/users/paulmartel/following{/other_user}","gists_url":"https://api.github.com/users/paulmartel/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmartel/subscriptions","organizations_url":"https://api.github.com/users/paulmartel/orgs","repos_url":"https://api.github.com/users/paulmartel/repos","events_url":"https://api.github.com/users/paulmartel/events{/privacy}","received_events_url":"https://api.github.com/users/paulmartel/received_events","type":"User","site_admin":false},"body":"It's OK to get the key schema here and from that do the asserts and allocate the backing store but\r\nm_searchKey and m_endKey members are a mistake and wasted code. Make them locals in p_execute.","created_at":"2014-01-29T03:03:52Z","updated_at":"2014-01-29T03:03:52Z","html_url":"https://github.com/VoltDB/voltdb/pull/1103#discussion_r9255214","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/1103","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/9255214"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/1103#discussion_r9255214"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/1103"}}}}