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
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Turn on prepare-plan-cache, create table:
CREATE TABLE `sbtest1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=61255
PARTITION BY RANGE ( `id` ) (
PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN (30),
PARTITION p2 VALUES LESS THAN (60),
PARTITION p3 VALUES LESS THAN (80),
PARTITION p4 VALUES LESS THAN (MAXVALUE)
)
Then insert some data.
Using JDBC test script:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.PreparedStatement;
public class Main {
private static final String URL="jdbc:mysql://172.16.5.34:4000/test?useSSL=false&useServerPrepStmts=true&useConfigs=maxPerformance";
private static final String NAME="root";
private static final String PASSWORD="";
public static int[] arr = {9, 33, 59, 20};
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(URL, NAME, PASSWORD);
String sql = "select count(1) from sbtest1 where id = ?";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setInt(1, 9);
ResultSet rs1 = statement.executeQuery();
while (rs1.next()) {
System.out.println(rs1.getString(1));
}
statement.setInt(1, 33);
ResultSet rs2 = statement.executeQuery();
while (rs2.next()) {
System.out.println(rs2.getString(1));
}
statement.setInt(1, 59);
ResultSet rs3 = statement.executeQuery();
while (rs3.next()) {
System.out.println(rs3.getString(1));
}
statement.setInt(1, 20);
ResultSet rs4 = statement.executeQuery();
while (rs4.next()) {
System.out.println(rs4.getString(1));
}
}
}
2. What did you expect to see?
1 1 1 1
Since there is data in these partition:
mysql> select k from sbtest1 where id in (9, 33, 59, 20);
+----+
| k |
+----+
| 51 |
| 50 |
| 50 |
| 51 |
+----+
3. What did you see instead?
1 0 0 0
4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.4
Git Commit Hash: 694e086e7914a8fc0eb601327edb6bcc31d2c7f2
Git Branch: HEAD
UTC Build Time: 2019-10-08 08:13:34
GoVersion: go version go1.12.10 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Turn on prepare-plan-cache, create table:
Then insert some data.
Using JDBC test script:
2. What did you expect to see?
1 1 1 1
Since there is data in these partition:
3. What did you see instead?
1 0 0 0
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: