Closed jiamo closed 4 years ago
你的本地源代码是不是老的? 我这里无法重现你说的问题:
Welcome to Lealone Shell 5.0.0
Exit with Ctrl+C
Commands are case insensitive; SQL statements end with ';'
help or ? Display this help
list Toggle result list / stack trace mode
maxwidth Set maximum column width (default is 100)
autocommit Enable or disable autocommit
history Show the last 20 statements
quit or exit Close the connection and exit
sql> CREATE TABLE SelectTest(pk varchar(100) NOT NULL PRIMARY KEY, f1 varchar(100), f2 varchar(100), f3 int);
(Update count: 0, 137 ms)
sql> INSERT INTO SelectTest(pk, f1, f2, f3) VALUES('01', 'a1', 'a', 51);
(Update count: 1, 19 ms)
sql> INSERT INTO SelectTest(pk, f1, f2, f3) VALUES('01', 'a1', 'a', 51);
Error: Unique index or primary key violation: "PRIMARY_KEY_B ON PUBLIC.SELECTTEST(PK) VALUES ('01', 2)"; SQL statement:
INSERT INTO SelectTest(pk, f1, f2, f3) VALUES('01', 'a1', 'a', 51) [23505-0]
sql> INSERT INTO SelectTest(pk, f1, f2, f3) VALUES('51', 'a2', 'h', 12);
(Update count: 1, 7 ms)
sql> SELECT * FROM SelectTest;
+----+----+----+----+
| PK | F1 | F2 | F3 |
+----+----+----+----+
| 01 | a1 | a | 51 |
| 51 | a2 | h | 12 |
+----+----+----+----+
(2 rows, 62 ms)
sql> INSERT INTO SelectTest(pk, f1, f2, f3) VALUES('61', 'a2', 'h', 12);
(Update count: 1, 10 ms)
sql> SELECT * FROM SelectTest;
+----+----+----+----+
| PK | F1 | F2 | F3 |
+----+----+----+----+
| 01 | a1 | a | 51 |
| 51 | a2 | h | 12 |
| 61 | a2 | h | 12 |
+----+----+----+----+
(3 rows, 13 ms)
sql>
可能是单步调试的问题。
我重试可以复现。 select * from test
要执行两遍。
修复了,更新一下代码重试一下看看。
可以了
感觉像是插入之后没有清掉缓存?