Comment 1 for bug 1288636

Revision history for this message
wingwj (wingwj) wrote :

I checked the sql used in 'flavor-show', through the sqlalchemy framework, the sql for mysql and psql is almost the same.
The core sql is like this:
--------------

'SELECT instance_types.created_at AS instance_types_created_at, instance_types.updated_at AS instance_types_updated_at, instance_types.deleted_at AS instance_types_deleted_at, instance_types.deleted AS instance_types_deleted, instance_types.id AS instance_types_id, instance_types.name AS instance_types_name, instance_types.memory_mb AS instance_types_memory_mb, instance_types.vcpus AS instance_types_vcpus, instance_types.root_gb AS instance_types_root_gb, instance_types.ephemeral_gb AS instance_types_ephemeral_gb, instance_types.flavorid AS instance_types_flavorid, instance_types.swap AS instance_types_swap, instance_types.rxtx_factor AS instance_types_rxtx_factor, instance_types.vcpu_weight AS instance_types_vcpu_weight, instance_types.disabled AS instance_types_disabled, instance_types.is_public AS instance_types_is_public
        FROM instance_types
        WHERE instance_types.flavorid = E'666'
         LIMIT 1',

--------------

I inputted "select * from instance_types where flavorid='xxx'; " in mysql and psql respectively,
the result is difference: http://paste.openstack.org/show/72763/

The response of "select * from where" is the same with "select * from" under psql.
The new non-deleted record locates at the bottom.

But the new deleted one under mysql is on the top.

--------------

Therefore, plus 'LIMIT 1' in sql, 'flavor-show' under psql will always show the oldest one.
And the mysql will always give the non-deleted one correctly.