Skip to content

Commit c67d1bb

Browse files
Fix for issue981 Django showing all migrations as unaplied (#982)
* Fix for issue981 Django showing all migrations as unaplied --------- Signed-off-by: Balram Choudhary <[email protected]>
1 parent 671bf02 commit c67d1bb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

ibm_db_dbi.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ def close(self):
854854
raise ProgrammingError("Connection cannot be closed; "
855855
"connection is no longer active.")
856856
else:
857-
LogMsg(DEBUG, f"Closing connection: conn_handler={self.conn_handler}")
858857
return_value = ibm_db.close(self.conn_handler)
859858
LogMsg(INFO, "Connection closed.")
860859
except Exception as inst:
@@ -1388,8 +1387,6 @@ def __init__(self, conn_handler, conn_object=None):
13881387
self.messages = []
13891388
self.FIX_RETURN_TYPE = conn_object.FIX_RETURN_TYPE
13901389
LogMsg(INFO, "Cursor object initialized.")
1391-
LogMsg(DEBUG, f"Connection handler: {self.conn_handler}")
1392-
LogMsg(DEBUG, f"Connection object: {self.__connection}")
13931390

13941391
# This method closes the statemente associated with the cursor object.
13951392
# It takes no argument.
@@ -1491,8 +1488,7 @@ def callproc(self, procname, parameters=None):
14911488
else:
14921489
self.stmt_handler = result
14931490
self._result_set_produced = True
1494-
LogMsg(DEBUG,
1495-
f"callproc executed successfully. stmt_handler={self.stmt_handler}, return_value={return_value}")
1491+
LogMsg(DEBUG, "callproc executed successfully.")
14961492
LogMsg(INFO, "exit callproc()")
14971493
return return_value
14981494

@@ -1802,6 +1798,8 @@ def _fetch_helper(self, fetch_size=-1):
18021798
if len(row_list) == 0:
18031799
raise self.messages[len(self.messages) - 1]
18041800
else:
1801+
LogMsg(DEBUG, f"Returning {row_list} from _fetch_helper()")
1802+
LogMsg(INFO, "exit _fetch_helper()")
18051803
return row_list
18061804

18071805
if row != False:
@@ -1810,8 +1808,11 @@ def _fetch_helper(self, fetch_size=-1):
18101808
else:
18111809
row_list.append(row)
18121810
else:
1811+
LogMsg(DEBUG, f"Returning {row_list} from _fetch_helper()")
1812+
LogMsg(INFO, "exit _fetch_helper()")
18131813
return row_list
18141814
rows_fetched = rows_fetched + 1
1815+
LogMsg(DEBUG, f"Returning {row_list} from _fetch_helper()")
18151816
LogMsg(INFO, "exit _fetch_helper()")
18161817
return row_list
18171818

@@ -1854,10 +1855,12 @@ def fetchmany(self, size=0):
18541855
self.messages.append(ProgrammingError("fetchmany argument size expected to be positive."))
18551856
raise self.messages[len(self.messages) - 1]
18561857

1857-
message = f"Fetched {len(self._fetch_helper(size))} rows successfully."
1858+
fetch_nrows = self._fetch_helper(size)
1859+
nrows = len(fetch_nrows)
1860+
message = f"Fetched {nrows} rows successfully."
18581861
LogMsg(DEBUG, message)
18591862
LogMsg(INFO, "exit fetchmany()")
1860-
return self._fetch_helper(size)
1863+
return fetch_nrows
18611864

18621865
def fetchall(self):
18631866
"""This method fetches all remaining rows from the database,
@@ -1866,7 +1869,8 @@ def fetchall(self):
18661869
LogMsg(INFO, "entry fetchall()")
18671870
LogMsg(INFO, "Fetching all remaining rows from the database.")
18681871
rows_fetched = self._fetch_helper()
1869-
LogMsg(DEBUG, f"Fetched {len(rows_fetched)} rows successfully.")
1872+
nrows = len(rows_fetched)
1873+
LogMsg(DEBUG, f"Fetched {nrows} rows successfully.")
18701874
LogMsg(INFO, "exit fetchall()")
18711875
return rows_fetched
18721876

0 commit comments

Comments
 (0)