def make_change_user(self, seed, username=None, password=None, database=None, charset=33, client_flags=0): """Make a MySQL packet with the Change User command""" if not seed: raise errors.ProgrammingError('Seed missing') auth = self._prepare_auth(username, password, database, client_flags, seed) data = utils.int1store(ServerCmd.CHANGE_USER) +\ auth[0] + auth[1] + auth[2] + utils.int2store(charset) return data
def _pkt_make_changeuser(self, username=None, password=None, database=None, charset=8, seed=None): """Make a MySQL packet with the Change User command""" try: seed = seed or self.scramble except: raise errors.ProgrammingError('Seed missing') (_username, _password, _database) = self._prepare_auth( username, password, database, self.client_flags, seed) data = utils.int1store(ServerCmd.CHANGE_USER) +\ _username +\ _password +\ _database +\ utils.int2store(charset) return data
def add_2_int(self, i): self.add(utils.int2store(i))