<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sanity_updates_after_move(self, oldpath, newpath):
 """ Updates the list of sql statements needed after moving nodes. 1. :attr:`depth` updates *ONLY* needed by mysql databases (*sigh*) 2. update the number of children of parent nodes """

        if (
                self.node_cls.get_database_vendor('write') == 'mysql' and
                len(oldpath) != len(newpath)
        ):
            # no words can describe how dumb mysql is
            # we must update the depth of the branch in a different query
            self.stmts.append(
                self.get_mysql_update_depth_in_branch(newpath))

        oldparentpath = self.node_cls._get_parent_path_from_path(oldpath)
        newparentpath = self.node_cls._get_parent_path_from_path(newpath)
        if (
                (not oldparentpath and newparentpath) or
                (oldparentpath and not newparentpath) or
                (oldparentpath != newparentpath)
        ):
            # node changed parent, updating count
            if oldparentpath:
                self.stmts.append(
                    self.get_sql_update_numchild(oldparentpath, 'dec'))
            if newparentpath:
                self.stmts.append(
                    self.get_sql_update_numchild(newparentpath, 'inc'))