sql: fix leak view
sql export