Skip to content

Commit

Permalink
use TRUE in SQL for boolean var
Browse files Browse the repository at this point in the history
The "allocated" variable was defined to be a boolean type
and in postgresql this type is enforced,
while in mysql this just maps to tinyint and accepts both numbers and bools

Closes-Bug: #1368251
Change-Id: If324c8b83e490e150085d044ac61360b647522ac
  • Loading branch information
bmwiedemann committed Sep 11, 2014
1 parent a625ea7 commit b030300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neutron/db/migration/migrate_to_ml2.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def migrate_vlan_allocations(self, engine):
INSERT INTO ml2_vlan_allocations
SELECT physical_network, vlan_id, allocated
FROM %(source_table)s
WHERE allocated = 1
WHERE allocated = TRUE
""") % {'source_table': self.vlan_allocation_table_name})

def get_port_segment_map(self, engine):
Expand Down Expand Up @@ -390,7 +390,7 @@ def migrate_tunnels(self, engine, tunnel_type, vxlan_udp_port=None):
INSERT INTO ml2_gre_allocations
SELECT tunnel_id as gre_id, allocated
FROM ovs_tunnel_allocations
WHERE allocated = 1
WHERE allocated = TRUE
""")
engine.execute("""
INSERT INTO ml2_gre_endpoints
Expand All @@ -404,7 +404,7 @@ def migrate_tunnels(self, engine, tunnel_type, vxlan_udp_port=None):
INSERT INTO ml2_vxlan_allocations
SELECT tunnel_id as vxlan_vni, allocated
FROM ovs_tunnel_allocations
WHERE allocated = 1
WHERE allocated = TRUE
""")
engine.execute(sa.text("""
INSERT INTO ml2_vxlan_endpoints
Expand Down

0 comments on commit b030300

Please sign in to comment.