sql: fix test to avoid full computation on field(engine)