mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
ifcopenshell.sql - fix error in by_id method
it was fetching some random row from id_map instead of using ifc_id filter
This commit is contained in:
@@ -153,10 +153,11 @@ class sqlite(file):
|
|||||||
entity = sqlite_entity(id, ifc_class, self)
|
entity = sqlite_entity(id, ifc_class, self)
|
||||||
self.entity_cache[id] = entity
|
self.entity_cache[id] = entity
|
||||||
return entity
|
return entity
|
||||||
self.cursor.execute("SELECT ifc_id, ifc_class FROM id_map LIMIT 1")
|
self.cursor.execute("SELECT ifc_id, ifc_class FROM id_map WHERE ifc_id = ? LIMIT 1", (id,))
|
||||||
row = self.cursor.fetchone()
|
row = self.cursor.fetchone()
|
||||||
if row:
|
if row:
|
||||||
self.id_map[row[0]] = row[1]
|
_, ifc_class = row
|
||||||
|
self.id_map[id] = ifc_class
|
||||||
entity = sqlite_entity(id, ifc_class, self)
|
entity = sqlite_entity(id, ifc_class, self)
|
||||||
self.entity_cache[id] = entity
|
self.entity_cache[id] = entity
|
||||||
return entity
|
return entity
|
||||||
|
|||||||
Reference in New Issue
Block a user