Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting TestItems by endTime throws a SQL error #1366

Open
michael-malandra opened this issue Mar 22, 2021 · 0 comments
Open

Sorting TestItems by endTime throws a SQL error #1366

michael-malandra opened this issue Mar 22, 2021 · 0 comments

Comments

@michael-malandra
Copy link

michael-malandra commented Mar 22, 2021

When attempting to sort TestItems query by endTime, the API throws a SQL exception:

API Version 5.3.5

ERROR: column \"test_item_results.end_time\" must appear in the GROUP BY clause or be used in an aggregate function\n Position: 68]"

"message": "Unclassified error [SQL [with \"filtered\" as (select \"public\".\"test_item\".\"item_id\" as \"id\", \"test_item_results\".\"end_time\" as \"endTime\" from \"public\".\"test_item\" left outer join \"public\".\"launch\" on \"public\".\"test_item\".\"launch_id\" = \"public\".\"launch\".\"id\" left outer join \"public\".\"test_item_results\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"test_item_results\".\"result_id\" where (\"test_item\".\"launch_id\" = ? and \"test_item\".\"parent_id\" = ?) group by \"public\".\"test_item\".\"item_id\" having max(\"public\".\"test_item\".\"type\") = ?::\"public\".\"test_item_type_enum\" order by \"test_item_results\".\"end_time\" asc, \"test_item\".\"item_id\" asc limit ?) select \"public\".\"test_item\".\"item_id\", \"public\".\"test_item\".\"name\", \"public\".\"test_item\".\"code_ref\", \"public\".\"test_item\".\"type\", \"public\".\"test_item\".\"start_time\", \"public\".\"test_item\".\"description\", \"public\".\"test_item\".\"last_modified\", \"public\".\"test_item\".\"path\", \"public\".\"test_item\".\"unique_id\", \"public\".\"test_item\".\"uuid\", \"public\".\"test_item\".\"test_case_id\", \"public\".\"test_item\".\"test_case_hash\", \"public\".\"test_item\".\"parent_id\", \"public\".\"test_item\".\"retry_of\", \"public\".\"test_item\".\"has_children\", \"public\".\"test_item\".\"has_stats\", \"public\".\"test_item\".\"has_retries\", \"public\".\"test_item\".\"launch_id\", \"public\".\"test_item_results\".\"status\", \"public\".\"test_item_results\".\"end_time\", \"public\".\"test_item_results\".\"duration\", \"public\".\"item_attribute\".\"key\", \"public\".\"item_attribute\".\"value\", \"public\".\"item_attribute\".\"system\", \"public\".\"parameter\".\"item_id\", \"public\".\"parameter\".\"key\", \"public\".\"parameter\".\"value\", \"public\".\"statistics_field\".\"name\", \"public\".\"statistics\".\"s_counter\", \"public\".\"issue\".\"issue_id\", \"public\".\"issue\".\"auto_analyzed\", \"public\".\"issue\".\"ignore_analyzer\", \"public\".\"issue\".\"issue_description\", \"public\".\"issue_type\".\"locator\", \"public\".\"issue_type\".\"abbreviation\", \"public\".\"issue_type\".\"hex_color\", \"public\".\"issue_type\".\"issue_name\", \"public\".\"issue_group\".\"issue_group\", \"public\".\"ticket\".\"id\", \"public\".\"ticket\".\"bts_project\", \"public\".\"ticket\".\"bts_url\", \"public\".\"ticket\".\"ticket_id\", \"public\".\"ticket\".\"url\", \"public\".\"pattern_template\".\"id\", \"public\".\"pattern_template\".\"name\" from \"public\".\"test_item\" join \"filtered\" on \"public\".\"test_item\".\"item_id\" = \"filtered\".\"id\" left outer join \"public\".\"launch\" on \"public\".\"test_item\".\"launch_id\" = \"public\".\"launch\".\"id\" left outer join \"public\".\"test_item_results\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"test_item_results\".\"result_id\" left outer join \"public\".\"item_attribute\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"item_attribute\".\"item_id\" left outer join \"public\".\"statistics\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"statistics\".\"item_id\" left outer join \"public\".\"statistics_field\" on \"public\".\"statistics\".\"statistics_field_id\" = \"public\".\"statistics_field\".\"sf_id\" left outer join \"public\".\"pattern_template_test_item\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"pattern_template_test_item\".\"item_id\" left outer join \"public\".\"pattern_template\" on \"public\".\"pattern_template_test_item\".\"pattern_id\" = \"public\".\"pattern_template\".\"id\" left outer join \"public\".\"issue\" on \"public\".\"test_item_results\".\"result_id\" = \"public\".\"issue\".\"issue_id\" left outer join \"public\".\"issue_type\" on \"public\".\"issue\".\"issue_type\" = \"public\".\"issue_type\".\"id\" left outer join \"public\".\"issue_group\" on \"public\".\"issue_type\".\"issue_group_id\" = \"public\".\"issue_group\".\"issue_group_id\" left outer join \"public\".\"issue_ticket\" on \"public\".\"issue\".\"issue_id\" = \"public\".\"issue_ticket\".\"issue_id\" left outer join \"public\".\"ticket\" on \"public\".\"issue_ticket\".\"ticket_id\" = \"public\".\"ticket\".\"id\" left outer join \"public\".\"parameter\" on \"public\".\"test_item\".\"item_id\" = \"public\".\"parameter\".\"item_id\" left outer join \"public\".\"item_attribute\" as \"launchAttribute\" on \"public\".\"launch\".\"id\" = \"launchAttribute\".\"launch_id\" order by \"test_item_results\".\"end_time\" asc, \"test_item\".\"item_id\" asc]; ERROR: column \"test_item_results.end_time\" must appear in the GROUP BY clause or be used in an aggregate function\n Position: 68]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant