anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: sqlancer/sqlancer
Issue: sqlancer/mysql/gen/MySQLInsertGenerator.java

Query generateInto()

for (int row = 0; row < nrRows; row++) {
            if (row != 0) {
                sb.append(", ");
            }
            sb.append("(");
            for (int c = 0; c < columns.size(); c++) {
                if (c++ != 0) {  <----  typo, should be c
                    sb.append(", ");
                }
                sb.append(MySQLVisitor.asString(gen.generateConstant()));

            }
            sb.append(")");
        }


Changed files:
src/sqlancer/mysql/gen/MySQLInsertGenerator.java

diff --git a/src/sqlancer/mysql/gen/MySQLInsertGenerator.java b/src/sqlancer/mysql/gen/MySQLInsertGenerator.java
index 563997da..b29c6aa4 100644
--- a/src/sqlancer/mysql/gen/MySQLInsertGenerator.java
+++ b/src/sqlancer/mysql/gen/MySQLInsertGenerator.java
@@ -81,7 +81,7 @@ public class MySQLInsertGenerator {
             }
             sb.append("(");
             for (int c = 0; c < columns.size(); c++) {
-                if (c++ != 0) {
+                if (c != 0) {
                     sb.append(", ");
                 }
                 sb.append(MySQLVisitor.asString(gen.generateConstant()));
Repository: sqlancer/sqlancer
Issue: Value generated by SQLancer for jit_inline_above_cost is outside the correct range

The command `SET SESSION jit_inline_above_cost=-134588496167444481;` was produced by SQLancer, which raises the error: `org.postgresql.util.PSQLException: ERROR: -1.34588e+17 is outside the valid range for parameter "jit_inline_above_cost" (-1 .. 1.79769e+308)`.

Changed files:
src/sqlancer/Randomly.java, src/sqlancer/mariadb/gen/MariaDBSetGenerator.java, test/sqlancer/TestRandomly.java

diff --git a/src/sqlancer/Randomly.java b/src/sqlancer/Randomly.java
index 99a26792..1488ed43 100644
--- a/src/sqlancer/Randomly.java
+++ b/src/sqlancer/Randomly.java
@@ -410,7 +410,10 @@ public final class Randomly {
         if (lower > upper) {
             throw new IllegalArgumentException(lower + " " + upper);
         }
-        return lower + ((long) (getThreadRandom().get().nextDouble() * (upper - lower)));
+        if (lower == upper) {
+            return lower;
+        }
+        return (long) (getThreadRandom().get().longs(lower, upper).findFirst().getAsLong());
     }
 
     private static int getNextInt(int lower, int upper) {
diff --git a/src/sqlancer/mariadb/gen/MariaDBSetGenerator.java b/src/sqlancer/mariadb/gen/MariaDBSetGenerator.java
index 33fead6b..270862d7 100644
--- a/src/sqlancer/mariadb/gen/MariaDBSetGenerator.java
+++ b/src/sqlancer/mariadb/gen/MariaDBSetGenerator.java
@@ -124,7 +124,6 @@ public class MariaDBSetGenerator {
                                   * ("batched_key_access", /*"block_nested_loop", "condition_fanout_filter",
                                   */
                     "condition_pushdown_for_derived", // MariaDB
-                    "condition_pushdown_for_subquery", // MariaDB
                     "derived_merge", //
                     "derived_with_keys", // MariaDB
                     "engine_condition_pushdown", //
diff --git a/test/sqlancer/TestRandomly.java b/test/sqlancer/TestRandomly.java
index 375752d8..6be6b1bd 100644
--- a/test/sqlancer/TestRandomly.java
+++ b/test/sqlancer/TestRandomly.java
@@ -184,6 +184,16 @@ public class TestRandomly {
         assertEquals(0, r.getLong(0, 1));
     }
 
+    @Test
+    public void testLong2() {
+        Randomly r = new Randomly();
+        for (int i = 0; i < NR_MIN_RUNS; i++) {
+            long val = r.getLong(-1, Long.MAX_VALUE);
+            assertTrue(val >= -1);
+            assertTrue(val < Long.MAX_VALUE);
+        }
+    }
+
     @Test // check that when given a seed, each thread computes a consistent result
     public void testSeed() {
         int seed = 123;