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);
|
||||
|
||||
|
||||
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)
|
||||
print "create DB=",create_db
|
||||
log.debug(_("Creating Database instance, sql = %s") % sql)
|
||||
self.config = c
|
||||
self.__connected = False
|
||||
|
@ -308,7 +307,7 @@ class Database:
|
|||
|
||||
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.connection.rollback() # make sure any locks taken so far are released
|
||||
#end def __init__
|
||||
|
|
|
@ -880,7 +880,7 @@ class fpdb:
|
|||
self.sql = SQL.Sql(db_server = self.settings['db-server'])
|
||||
err_msg = None
|
||||
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':
|
||||
# tell sqlite users where the db file is
|
||||
print (_("Connected to SQLite: %s") % self.db.db_path)
|
||||
|
|
Loading…
Reference in New Issue
Block a user