-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the problem
I got a wrong value which is "2000-01-01 00:00:00.0" after querying timestamp field for five times.
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2000-01-01 00:00:00.0
2000-01-01 00:00:00.0
2000-01-01 00:00:00.0
2000-01-01 00:00:00.0
2000-01-01 00:00:00.0
To Reproduce
public static void main(String[] args) throws SQLException {
try (Connection conn = DriverManager.getConnection(url, username, password)) {
String sql = "select ctime from t_user limit 1";
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
for (int i = 0; i < 10; i++) {
try (ResultSet rs = stmt.executeQuery()) {
while (rs.next()) {
System.out.println(rs.getTimestamp("ctime"));
}
}
}
}
}
}Expected behavior
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
2024-08-30 10:40:38.622601
Additional data / screenshots
create table if not exists t_user
(
id varchar(32),
name varchar(255),
ctime timestamp default CURRENT_TIMESTAMP
);
insert into t_user(id, name) values('11', 'tom');
insert into t_user(id, name) values('22', 'bobby');
insert into t_user(id, name) values('33', 'ana');Environment
- readysettech/readyset:stable-240523
- docker
- Postgres 15
- JDBC, JDK17
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working