Revert "prevent crasher when connecting to empty mysql (presumably this bug also applied to postgres)"
This reverts commit 2813bb7fe6
.
This commit is contained in:
parent
2813bb7fe6
commit
683d89389b
|
@ -244,9 +244,8 @@ class Database:
|
||||||
# create index indexname on tablename (col);
|
# create index indexname on tablename (col);
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, c, sql = None, autoconnect = True, create_db=False):
|
def __init__(self, c, sql = None, autoconnect = True):
|
||||||
#log = Configuration.get_logger("logging.conf", "db", log_dir=c.dir_log)
|
#log = Configuration.get_logger("logging.conf", "db", log_dir=c.dir_log)
|
||||||
print "create DB=",create_db
|
|
||||||
log.debug(_("Creating Database instance, sql = %s") % sql)
|
log.debug(_("Creating Database instance, sql = %s") % sql)
|
||||||
self.config = c
|
self.config = c
|
||||||
self.__connected = False
|
self.__connected = False
|
||||||
|
@ -308,7 +307,7 @@ class Database:
|
||||||
|
|
||||||
self.saveActions = False if self.import_options['saveActions'] == False else True
|
self.saveActions = False if self.import_options['saveActions'] == False else True
|
||||||
|
|
||||||
if self.is_connected() and not create_db:
|
if self.is_connected():
|
||||||
self.get_sites()
|
self.get_sites()
|
||||||
self.connection.rollback() # make sure any locks taken so far are released
|
self.connection.rollback() # make sure any locks taken so far are released
|
||||||
#end def __init__
|
#end def __init__
|
||||||
|
|
|
@ -880,7 +880,7 @@ class fpdb:
|
||||||
self.sql = SQL.Sql(db_server = self.settings['db-server'])
|
self.sql = SQL.Sql(db_server = self.settings['db-server'])
|
||||||
err_msg = None
|
err_msg = None
|
||||||
try:
|
try:
|
||||||
self.db = Database.Database(self.config, sql = self.sql, create_db=create_db)
|
self.db = Database.Database(self.config, sql = self.sql)
|
||||||
if self.db.get_backend_name() == 'SQLite':
|
if self.db.get_backend_name() == 'SQLite':
|
||||||
# tell sqlite users where the db file is
|
# tell sqlite users where the db file is
|
||||||
print (_("Connected to SQLite: %s") % self.db.db_path)
|
print (_("Connected to SQLite: %s") % self.db.db_path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user