You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLE `test` (
`id`int(11) NOT NULL,
`test`tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
data in table
Check for phrases
select*from test
Chat2DB results of the
Solution suggestions
method one
In mysql, by default, the display length of the tinyint type is 1 (signed), which defaults to representing a Boolean value. You can link out the splicing parameters in mysql.
tinyInt1isBit=false
method two
Use the get method according to the field data type. Not all use rs.getObject. For example, for tinyint type, use rs.getInt to get the normal value. The corresponding code position:
miahemu
changed the title
Bug: 在mysql中查询tinyint(1)类型字段,查询结果返回bool值,但实际数据类型为数值类型
Bug: When querying the tinyint(1) type field in mysql, the query result returns a bool value, but the actual data type is a numeric type.
May 7, 2024
Chat2DB Version
1.0.7
Describe the bug
Problem Description
ddl of table
data in table
Check for phrases
Chat2DB results of the
Solution suggestions
method one
In mysql, by default, the display length of the tinyint type is 1 (signed), which defaults to representing a Boolean value. You can link out the splicing parameters in mysql.
method two
Use the get method according to the field data type. Not all use rs.getObject. For example, for tinyint type, use rs.getInt to get the normal value. The corresponding code position:
Chat2DB/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/jdbc/DefaultValueHandler.java
Line 20 in feaf137
The text was updated successfully, but these errors were encountered: