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.
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 types.flavorid = E'666'
FROM instance_types
WHERE instance_
LIMIT 1',
--------------
I inputted "select * from instance_types where flavorid='xxx'; " in mysql and psql respectively, paste.openstack .org/show/ 72763/
the result is difference: http://
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.