Skip to content

查询MySql数据库表中的时间字段datetime,且该字段有空值时,查询会报错 #56

@youhua38tao

Description

@youhua38tao

Please confirm before submission 在提交之前,请确认

Dify version Dify版本

1.9.1

db_query or db_query_pre_auth

Database Query 数据库查询

Plugin version 插件版本

0.0.11

database and version 数据库及版本

MySql 8.0

Problem description 问题描述

当查询MySql数据库表中的时间字段datetime,且该字段有空值NULL时,查询会报错 RuntimeError, error details: Error executing SQL: NaTType does not support strftime。

Image Image Image

初步排查应该是python对NaN数据转换时间时的报错,并且本地复现成功,问题代码

elif isinstance(value, datetime.date):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions