Skip to content

Commit

Permalink
Merge pull request #146 from oceanbase/repaire_md5
Browse files Browse the repository at this point in the history
change md5 to sha256 ref:#145
  • Loading branch information
qidi1 authored Nov 14, 2023
2 parents 19cfd67 + b713286 commit 7c19183
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions db.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
'db': {
'host': 'db host',
'port': *,
'dbname': 'your database name',
'user': 'your user name',
'pswd': 'password',
'charset': 'charset'
'host': 'localhost',
'port': 3306,
'dbname': 'test',
'user': 'root',
'pswd': '123456',
'charset': 'big5'
}
}
2 changes: 1 addition & 1 deletion src/common/db_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

f.close()

hl = hashlib.md5()
hl = hashlib.sha256()

SQLESS_DEFULT_PASSWORD = '*e9c2bcdc178a99b7b08dd25db58ded2ee5bff05'

Expand Down
2 changes: 1 addition & 1 deletion src/consume/mysql_slowlog_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def pattern(self, sql):
log.error(statement)
log.exception(e)

sql_id = hashlib.md5(statement.encode('utf-8')).hexdigest().upper()
sql_id = hashlib.sha256(statement.encode('utf-8')).hexdigest().upper()
return sql_id, statement

def skip_sql(self, sql):
Expand Down
2 changes: 1 addition & 1 deletion src/schedule_task/oceanbase/schedule_plan_oceanbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def schedule_plan_ob(db_conf, queue_info, schedule_type):
if plan_info and is_need_insert:
plan_info = plan_info[:-2].replace('\'', '')
plan_full = plan_full.replace('\'', '')[:60000]
outline_hash = hashlib.md5(
outline_hash = hashlib.sha256(
outline_data.encode("utf8")
).hexdigest()
# result_sql
Expand Down

0 comments on commit 7c19183

Please sign in to comment.