Revert "[optimize] remove count(*) from queries"

This commit is contained in:
Rushabh Mehta
2016-11-21 21:04:47 +05:30
committed by GitHub
parent d3344ebcd1
commit 9872d8cdb5
6 changed files with 11 additions and 11 deletions

View File

@@ -18,6 +18,6 @@ def execute():
frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s and name!=%s""", (user_id, employee))
else:
count = frappe.db.sql("""select count(name) from `tabEmployee` where user_id=%s""", user_id)[0][0]
count = frappe.db.sql("""select count(*) from `tabEmployee` where user_id=%s""", user_id)[0][0]
frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s limit %s""", (user_id, count - 1))