X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fdb_base.py;h=c8e5eb167e70bb4e4c77b43c30c8be3afb2dc1c8;hb=c62cfa5ac6f96c10a3efe14ee286755f4d25be54;hp=badf508936470fe0a2fa011e2ddc94fd69d32628;hpb=137b0d9e53007e4c6903493036c113d124b12b21;p=osm%2FRO.git diff --git a/osm_ro/db_base.py b/osm_ro/db_base.py index badf5089..c8e5eb16 100644 --- a/osm_ro/db_base.py +++ b/osm_ro/db_base.py @@ -367,7 +367,7 @@ class db_base(): self.cur.execute(cmd) return uuid - def _new_row_internal(self, table, INSERT, add_uuid=False, root_uuid=None, created_time=0): + def _new_row_internal(self, table, INSERT, add_uuid=False, root_uuid=None, created_time=0, confidential_data=False): ''' Add one row into a table. It DOES NOT begin or end the transaction, so self.con.cursor must be created Attribute INSERT: dictionary with the key:value to insert @@ -403,7 +403,12 @@ class db_base(): ",".join(map(self.__tuple2db_format_set, INSERT.iteritems() )) if created_time: cmd += ",created_at=%f" % created_time - self.logger.debug(cmd) + if confidential_data: + index = cmd.find("SET") + subcmd = cmd[:index] + 'SET...' + self.logger.debug(subcmd) + else: + self.logger.debug(cmd) self.cur.execute(cmd) self.cur.rowcount return uuid @@ -415,7 +420,7 @@ class db_base(): rows = self.cur.fetchall() return rows - def new_row(self, table, INSERT, add_uuid=False, created_time=0): + def new_row(self, table, INSERT, add_uuid=False, created_time=0, confidential_data=False): ''' Add one row into a table. Attribute INSERT: dictionary with the key: value to insert @@ -432,7 +437,7 @@ class db_base(): try: with self.con: self.cur = self.con.cursor() - return self._new_row_internal(table, INSERT, add_uuid, None, created_time) + return self._new_row_internal(table, INSERT, add_uuid, None, created_time, confidential_data) except (mdb.Error, AttributeError) as e: self._format_error(e, tries)