checkIsEmpty returns nil if 'id' has no children.
(e sqlExecutor, id uint64)
| 66 | |
| 67 | // checkIsEmpty returns nil if 'id' has no children. |
| 68 | func checkIsEmpty(e sqlExecutor, id uint64) error { |
| 69 | var count uint64 |
| 70 | const countSQL = ` |
| 71 | SELECT COUNT(parentID) FROM fs_namespace WHERE parentID = ?` |
| 72 | if err := e.QueryRow(countSQL, id).Scan(&count); err != nil { |
| 73 | return err |
| 74 | } |
| 75 | if count != 0 { |
| 76 | return fuse.Errno(syscall.ENOTEMPTY) |
| 77 | } |
| 78 | return nil |
| 79 | } |
| 80 | |
| 81 | // updateNode updates an existing node descriptor. |
| 82 | func updateNode(e sqlExecutor, node *Node) error { |
no test coverage detected