我有这个代码:
# Retreive the users that can obtain permission on the network except the admin
self.lock_tables("read", ['nets_permissions as n', 'users as u'])
usrs = self.db.query("SELECT distinct u.id FROM users as u \
left outer join nets_permissions as n on u.id = n.user_id \
where u.id not in \
(select users.id from users left outer join nets_permissions \
on users.id = nets_permissions.user_id \
where nets_permissions.network_id=%s and nets_permissions.perm=3)", netid)
self.unlock_tables()
但我在 Tornado 屏幕中收到此错误:
文件“./wsn.py”,第 571 行,在获取 nets_permissions.network_id=%s 和 nets_permissions.perm=3)",netid) 引发错误类,错误值 OperationalError:(1100,“表 'users' 未锁定锁定表")
错误在哪里?