nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: xerial/sqlite-jdbc
Pull request #535 (2020-08-25 01:47:53)

Fix typo of READ_UNCOMMITED to READ_UNCOMMITTED
Fix issue #521


Patch:
diff --git a/src/main/java/org/sqlite/SQLiteConfig.java b/src/main/java/org/sqlite/SQLiteConfig.java
index 3076ed27..786e18a9 100755
--- a/src/main/java/org/sqlite/SQLiteConfig.java
+++ b/src/main/java/org/sqlite/SQLiteConfig.java
@@ -364,7 +364,7 @@ public class SQLiteConfig
         LOCKING_MODE("locking_mode", toStringArray(LockingMode.values())),
         PAGE_SIZE("page_size"),
         MAX_PAGE_COUNT("max_page_count"),
-        READ_UNCOMMITED("read_uncommited", OnOff),
+        READ_UNCOMMITTED("read_uncommitted", OnOff),
         RECURSIVE_TRIGGERS("recursive_triggers", OnOff),
         REVERSE_UNORDERED_SELECTS("reverse_unordered_selects", OnOff),
         SECURE_DELETE("secure_delete", new String[] { "true", "false", "fast" }),
@@ -735,7 +735,7 @@ public class SQLiteConfig
      * @see <a href="http://www.sqlite.org/pragma.html#pragma_read_uncommitted">www.sqlite.org/pragma.html#pragma_read_uncommitted</a>
      */
     public void setReadUncommited(boolean useReadUncommitedIsolationMode) {
-        set(Pragma.READ_UNCOMMITED, useReadUncommitedIsolationMode);
+        set(Pragma.READ_UNCOMMITTED, useReadUncommitedIsolationMode);
     }
 
     /**


Test patch:
diff --git a/src/test/java/org/sqlite/ReadUncommittedTest.java b/src/test/java/org/sqlite/ReadUncommittedTest.java
index 420ce304..69868004 100644
--- a/src/test/java/org/sqlite/ReadUncommittedTest.java
+++ b/src/test/java/org/sqlite/ReadUncommittedTest.java
@@ -20,6 +20,8 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 public class ReadUncommittedTest
 {
     private Connection conn;
@@ -60,4 +62,28 @@ public class ReadUncommittedTest
     {
         conn.setTransactionIsolation(SQLiteConnection.TRANSACTION_REPEATABLE_READ);
     }
+
+    @Test
+    public void setReadUncommittedWithConfig() throws SQLException
+    {
+        // Override original setup
+        Properties prop = new Properties();
+        prop.setProperty("shared_cache", "true");
+        conn = DriverManager.getConnection("jdbc:sqlite:", prop);
+        stat = conn.createStatement();
+        assertEquals("Fail to set pragma read_uncommitted", "0",
+            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+
+        prop.setProperty("read_uncommitted", "true");
+        conn = DriverManager.getConnection("jdbc:sqlite:", prop);
+        stat = conn.createStatement();
+        assertEquals("Fail to set pragma read_uncommitted", "1",
+            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+
+        prop.setProperty("read_uncommitted", "false");
+        conn = DriverManager.getConnection("jdbc:sqlite:", prop);
+        stat = conn.createStatement();
+        assertEquals("Fail to set pragma read_uncommitted", "0",
+            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+    }
 }