This is an automated email from the ASF dual-hosted git repository.
alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new b43ca988726 IGNITE-22439 SQL Calcite: Add test for duplicate keys
(#11380)
b43ca988726 is described below
commit b43ca9887265a451a94a8c636717d9259611f290
Author: Andrey Nadyktov <[email protected]>
AuthorDate: Mon Jun 10 17:04:01 2024 +0300
IGNITE-22439 SQL Calcite: Add test for duplicate keys (#11380)
---
.../query/calcite/integration/TableDmlIntegrationTest.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
index 310dff67192..513db94d7c0 100644
---
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
+++
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
@@ -571,6 +571,20 @@ public class TableDmlIntegrationTest extends
AbstractBasicIntegrationTest {
checkWrongDefault("UUID", "FALSE");
}
+ /**
+ * Test checks the impossibility of inserting duplicate keys.
+ */
+ @Test
+ public void testInsertDuplicateKey() {
+ executeSql("CREATE TABLE test (a int primary key, b int)");
+
+ executeSql("INSERT INTO test VALUES (0, 0)");
+ executeSql("INSERT INTO test VALUES (1, 1)");
+
+ assertThrows("INSERT INTO test VALUES (1, 2)",
IgniteSQLException.class,
+ "Failed to INSERT some keys because they are already in
cache");
+ }
+
/** */
private void checkDefaultValue(String sqlType, String sqlVal, Object
expectedVal) {
try {