Skip to content
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

mysql 5.7 版本 使用最新版 3.5.102 ,查询datetime类型返回null #1948

Closed
AshWang-whm opened this issue Dec 13, 2024 · 2 comments
Closed

Comments

@AshWang-whm
Copy link

AshWang-whm commented Dec 13, 2024

问题描述及重现代码:

mysql 5.7 版本 使用最新版 3.5.102 ,查询datetime类型返回null

属性声明
[JsonProperty, Column(DbType = "datetime")]
public DateTime? create_time { get; set; }

数据库字段类型
image

3.2.833 freesql.provider.mysql 组件正常无误
image

更新到3.5.102 版本后,datetime类型字段全部返回null
image


#### 数据库版本
mysql 5.7

#### 安装的Nuget包
3.2.833 & 3.5.102
freesql.provider.mysql & freesql  

#### .net framework/. net core? 及具体版本
.net 8
@2881099
Copy link
Collaborator

2881099 commented Dec 13, 2024

 SELECT 1 FROM information_schema.TABLES WHERE table_schema='cccddd' and table_name='IdentityTable'

CREATE TABLE IF NOT EXISTS `cccddd`.`IdentityTable` (
  `id` INT(11) AUTO_INCREMENT,
  `name` VARCHAR(255),
  `create_time` DATETIME,
  PRIMARY KEY (`id`)
) Engine=InnoDB;


DELETE FROM `IdentityTable` WHERE (1=1)

INSERT INTO `IdentityTable`(`name`, `create_time`) VALUES('name01', '2024-12-13 19:57:50.581')

SELECT a.`id`, a.`name`, a.`create_time`
FROM `IdentityTable` a

SELECT a.`create_time` as1
FROM `IdentityTable` a

SELECT a.`create_time` as1
FROM `IdentityTable` a

image

测试没有出现你说的问题。

@AshWang-whm
Copy link
Author

 SELECT 1 FROM information_schema.TABLES WHERE table_schema='cccddd' and table_name='IdentityTable'

CREATE TABLE IF NOT EXISTS `cccddd`.`IdentityTable` (
  `id` INT(11) AUTO_INCREMENT,
  `name` VARCHAR(255),
  `create_time` DATETIME,
  PRIMARY KEY (`id`)
) Engine=InnoDB;


DELETE FROM `IdentityTable` WHERE (1=1)

INSERT INTO `IdentityTable`(`name`, `create_time`) VALUES('name01', '2024-12-13 19:57:50.581')

SELECT a.`id`, a.`name`, a.`create_time`
FROM `IdentityTable` a

SELECT a.`create_time` as1
FROM `IdentityTable` a

SELECT a.`create_time` as1
FROM `IdentityTable` a

image

测试没有出现你说的问题。

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

No branches or pull requests

2 participants