Skip to content

修复TDengine插入Datetime默认值查询异常 #1980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

d4ilys
Copy link
Contributor

@d4ilys d4ilys commented Feb 18, 2025

@d4ilys d4ilys changed the title TDengine插入Datetime默认值查询异常 修复TDengine插入Datetime默认值查询异常 Feb 18, 2025
@2881099
Copy link
Collaborator

2881099 commented Feb 18, 2025

catch e.Value = new DateTime();

这里可以换成 e.Value = DateTime.MinValue;

@2881099
Copy link
Collaborator

2881099 commented Feb 18, 2025

这样应该也行,特殊让异常在外部暴露,便于排查

this.Aop.AuditDataReader += (_, e) =>
{
    var dataTypeName = e.DataReader.GetDataTypeName(e.Index);
    switch (dataTypeName)
    {
        case "TIMESTAMP":
            if (e.DataReader.IsDBNull(e.Index)) e.Value = null;
            else e.Value = e.DataReader.GetDateTime(e.Index);
            return;
    }
};

@2881099 2881099 merged commit 528bf08 into dotnetcore:master Feb 18, 2025
1 check passed
2881099 added a commit that referenced this pull request Feb 18, 2025
2881099 added a commit that referenced this pull request Feb 18, 2025
@2881099
Copy link
Collaborator

2881099 commented Feb 18, 2025

发版了 v3.5.106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants