The 'app' user should be vt_app. It didn't work before, as some
tests expected to be able to drop tables, and that wasn't allowed.
So I changed the permissions so vt_app can drop tables, and use
the user for the tests. It's just not SUPER.
This commit is contained in:
Alain Jobart 2013-08-22 21:55:02 -07:00
Родитель 88ec740c3c
Коммит 168c023409
2 изменённых файлов: 7 добавлений и 8 удалений

Двоичные данные
data/bootstrap/mysql-db-dir.tbz

Двоичный файл не отображается.

Просмотреть файл

@ -26,8 +26,7 @@ class Tablet(object):
tablets_running = 0
default_db_config = {
"app": {
"uname": "vt_dba", # it's vt_dba so that the tests can create
# and drop tables.
"uname": "vt_app",
"charset": "utf8"
},
"dba": {
@ -94,19 +93,19 @@ class Tablet(object):
if utils.options.verbose == 2:
print >> sys.stderr, e, path
def mysql_connection_parameters(self, dbname):
return dict(user='vt_dba',
def mysql_connection_parameters(self, dbname, user):
return dict(user=user,
unix_socket='%s/vt_%010d/mysql.sock' % (utils.vtdataroot, self.tablet_uid),
db=dbname)
def connect(self, dbname=''):
def connect(self, dbname='', user='vt_dba'):
conn = MySQLdb.Connect(
**self.mysql_connection_parameters(dbname))
**self.mysql_connection_parameters(dbname, user))
return conn, conn.cursor()
# Query the MySQL instance directly
def mquery(self, dbname, query, write=False):
conn, cursor = self.connect(dbname)
def mquery(self, dbname, query, write=False, user='vt_dba'):
conn, cursor = self.connect(dbname, user=user)
if write:
conn.begin()
if isinstance(query, basestring):