)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7800,"name":"zhgaoxa","email":"gaozheng0123@163.com"},"change_message_id":"84bd91126f12ad1d2c1a284ccdda64ae7b50db04","unresolved":false,"context_lines":[{"line_number":13,"context_line":"aggregate_hosts rows that match the host, and a left outer join also"},{"line_number":14,"context_line":"gave us aggregates rows with no matching aggregate_hosts row."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"So do an inner join instead in that one case."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Also improve test_aggregate_get_by_host to catch this bug."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAPX%2F%2F6ls%3D","line":16,"updated":"2013-06-06 02:33:06.000000000","message":"Yes, we should use inner join instead of outer join. But this version does not work. \n\nAfter change the code as you committed, I get empty host aggregate list with the following config:\n\nmysql\u003e select * from aggregates inner join aggregate_hosts where aggregates.id\u003daggregate_hosts.aggregate_id;\n+---------------------+------------+------------+----+------+---------+---------------------+------------+------------+----+-----------------------+--------------+---------+\n| created_at          | updated_at | deleted_at | id | name | deleted | created_at          | updated_at | deleted_at | id | host                  | aggregate_id | deleted |\n+---------------------+------------+------------+----+------+---------+---------------------+------------+------------+----+-----------------------+--------------+---------+\n| 2013-06-05 07:51:09 | NULL       | NULL       |  2 | agg2 |       0 | 2013-06-05 08:50:42 | NULL       | NULL       |  3 | allengao-OptiPlex-790 |            2 |       0 |\n| 2013-06-05 09:17:42 | NULL       | NULL       |  3 | agg3 |       0 | 2013-06-06 02:22:20 | NULL       | NULL       |  4 | allengao-OptiPlex-790 |            3 |       0 |\n+---------------------+------------+------------+----+------+---------+---------------------+------------+------------+----+-----------------------+--------------+---------+\n2 rows in set (0.01 sec)\n\nThe correct return should be aggregate agg2 and agg3.","commit_id":"4bed47e93eb441533ace4155561aed2a251423cf"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":7800,"name":"zhgaoxa","email":"gaozheng0123@163.com"},"change_message_id":"379fc39f77306358d19aed9ce43af5a9af57c50a","unresolved":false,"context_lines":[{"line_number":4551,"context_line":"    if id and id_field:"},{"line_number":4552,"context_line":"        query \u003d query.filter(id_field \u003d\u003d id)"},{"line_number":4553,"context_line":""},{"line_number":4554,"context_line":"    return query"},{"line_number":4555,"context_line":""},{"line_number":4556,"context_line":""},{"line_number":4557,"context_line":"@require_admin_context"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPX%2F%2F6gg%3D","line":4554,"updated":"2013-06-06 03:17:31.000000000","message":"p str(query) -- [the SQL is still \u0027join\u0027, not \u0027inner join\u0027]\n\nSELECT aggregates.created_at AS aggregates_created_at, aggregates.updated_at AS aggregates_updated_at, aggregates.deleted_at AS aggregates_deleted_at, aggregates.deleted AS aggregates_deleted, aggregates.id AS aggregates_id, aggregates.name AS aggregates_name, aggregate_hosts_1.created_at AS aggregate_hosts_1_created_at, aggregate_hosts_1.updated_at AS aggregate_hosts_1_updated_at, aggregate_hosts_1.deleted_at AS aggregate_hosts_1_deleted_at, aggregate_hosts_1.deleted AS aggregate_hosts_1_deleted, aggregate_hosts_1.id AS aggregate_hosts_1_id, aggregate_hosts_1.host AS aggregate_hosts_1_host, aggregate_hosts_1.aggregate_id AS aggregate_hosts_1_aggregate_id, aggregate_metadata_1.created_at AS aggregate_metadata_1_created_at, aggregate_metadata_1.updated_at AS aggregate_metadata_1_updated_at, aggregate_metadata_1.deleted_at AS aggregate_metadata_1_deleted_at, aggregate_metadata_1.deleted AS aggregate_metadata_1_deleted, aggregate_metadata_1.id AS aggregate_metadata_1_id, aggregate_metadata_1.key AS aggregate_metadata_1_key, aggregate_metadata_1.value AS aggregate_metadata_1_value, aggregate_metadata_1.aggregate_id AS aggregate_metadata_1_aggregate_id \\nFROM aggregate_hosts, aggregates JOIN aggregate_hosts AS aggregate_hosts_1 ON aggregates.id \u003d aggregate_hosts_1.aggregate_id AND aggregate_hosts_1.deleted \u003d :deleted_1 AND aggregates.deleted \u003d :deleted_2 JOIN aggregate_metadata AS aggregate_metadata_1 ON aggregates.id \u003d aggregate_metadata_1.aggregate_id AND aggregate_metadata_1.deleted \u003d :deleted_3 AND aggregates.deleted \u003d :deleted_4 \\nWHERE aggregates.deleted \u003d :deleted_5 AND aggregate_hosts.host \u003d :host_1","commit_id":"4bed47e93eb441533ace4155561aed2a251423cf"}]}
