LOAD実行結果、ワーニング1261は許容するとして例外判定から除外する
This commit is contained in:
parent
d285a28c96
commit
a767457749
@ -37,14 +37,18 @@ class VjskDataLoadManager:
|
||||
"""
|
||||
db.begin()
|
||||
result = db.execute(sql, {"src_file_name": src_file_name})
|
||||
logger.debug(sql)
|
||||
result_w = db.execute("SHOW WARNINGS;")
|
||||
has_mysql_warnings = False
|
||||
for row in result_w.fetchall():
|
||||
# 例外スロー対象から除外 : Warning(1261) Row {ROW NUMBER} doesn't contain data for all columns
|
||||
if len(row) >= 2 and row[0] == "Warning" and row[1] == 1261:
|
||||
logger.info(f"SHOW WARNINGS (SKIP) : {row}")
|
||||
continue
|
||||
has_mysql_warnings = True
|
||||
logger.info(f"SHOW WARNINGS : {row}")
|
||||
if has_mysql_warnings:
|
||||
raise Exception("LOAD文実行時にWARNINGが発生しました。")
|
||||
logger.debug(sql)
|
||||
logger.info(f'{data_name}tsvファイルを{table_name_org}にLOAD : 件数({result.rowcount})')
|
||||
db.commit()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user