diff_id stringlengths 15 35 | change_category stringclasses 7
values | language stringclasses 7
values | file_path stringlengths 9 38 | commit_message stringclasses 11
values | diff_text stringlengths 33 146 | sql_pattern stringclasses 7
values | is_destructive_ground_truth bool 2
classes |
|---|---|---|---|---|---|---|---|
DIFF00000005000 | general_code_change | Python | orders_712.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000005001 | raw_sql_destructive | SQL | transactions_780.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE users; | DROP_TABLE | true |
DIFF00000005002 | test_suite_cleanup | SQL | test/subscriptions_247.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE accounts DROP COLUMN score; | DROP_COLUMN | false |
DIFF00000005003 | obfuscated_destructive | SQL | inventory_382.sql | schema cleanup | @@ -1,3 +1,3 @@
+DelETe fROm logs; | DELETE_UNQUALIFIED | true |
DIFF00000005004 | obfuscated_destructive | SQL | inventory_455.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table reviews; | TRUNCATE | true |
DIFF00000005005 | raw_sql_safe | SQL | subscriptions_835.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (created_at, address) VALUES (%s, %s); | NONE | false |
DIFF00000005006 | raw_sql_destructive | SQL | events_59.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE customers SET quantity = CONCAT(quantity, address); | UPDATE_CONCAT | true |
DIFF00000005007 | raw_sql_safe | SQL | users_472.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (amount, score) VALUES (%s, %s); | NONE | false |
DIFF00000005008 | general_code_change | Go | reviews_120.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005009 | raw_sql_destructive | SQL | refunds_848.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users RENAME COLUMN is_active TO user_role; | ALTER_RENAME | true |
DIFF00000005010 | raw_sql_safe | SQL | reviews_802.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE amount = 'active'; | NONE | false |
DIFF00000005011 | general_code_change | TypeScript | notifications_171.ts | refactor / feature work | @@ -1,3 +1,3 @@
+export function toTitleCase(s: string): string { return s.replace(/\w\S*/g, t => t[0].toUpperCase() + t.slice(1)); } | NONE | false |
DIFF00000005012 | orm_schema_change | JavaScript | accounts_422.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('shipments', table => table.dropColumn('score')) | NONE | true |
DIFF00000005013 | mentioned_in_comment | Python | tickets_709.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE orders RENAME COLUMN balance TO full_name;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00000005014 | raw_sql_safe | SQL | subscriptions_806.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE shipments SET email = %s WHERE priority = %s; | NONE | false |
DIFF00000005015 | orm_schema_change | JavaScript | events_258.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('is_active')) | NONE | true |
DIFF00000005016 | raw_sql_destructive | SQL | accounts_280.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | true |
DIFF00000005017 | general_code_change | JavaScript | reviews_533.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000005018 | raw_sql_safe | SQL | inventory_725.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (email, name) VALUES (%s, %s); | NONE | false |
DIFF00000005019 | orm_schema_change | JavaScript | employees_922.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'name') | NONE | true |
DIFF00000005020 | general_code_change | Ruby | comments_808.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000005021 | mentioned_in_comment | Python | inventory_664.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE events SET email = CONCAT(email, address); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00000005022 | raw_sql_destructive | SQL | accounts_59.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE payments RENAME COLUMN price TO full_name; | ALTER_RENAME | true |
DIFF00000005023 | raw_sql_safe | SQL | logs_674.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE comments ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000005024 | orm_schema_change | Ruby | transactions_360.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :accounts, :category | NONE | true |
DIFF00000005025 | raw_sql_destructive | SQL | shipments_568.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET balance = CONCAT(balance, role); | UPDATE_CONCAT | true |
DIFF00000005026 | raw_sql_destructive | SQL | reviews_539.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM reviews; | DELETE_UNQUALIFIED | true |
DIFF00000005027 | general_code_change | Java | accounts_704.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005028 | raw_sql_safe | SQL | comments_79.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_payments_quantity ON payments (balance); | NONE | false |
DIFF00000005029 | raw_sql_safe | SQL | sessions_124.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM comments WHERE is_active = 'active'; | NONE | false |
DIFF00000005030 | raw_sql_safe | SQL | logs_477.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_comments_email ON comments (created_at); | NONE | false |
DIFF00000005031 | raw_sql_destructive | SQL | reviews_940.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | true |
DIFF00000005032 | mentioned_in_comment | Python | tickets_793.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE invoices DROP COLUMN price; -- now deprecated""" | DROP_COLUMN | false |
DIFF00000005033 | raw_sql_destructive | SQL | users_737.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | true |
DIFF00000005034 | orm_schema_change | Ruby | customers_805.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :employees, :score | NONE | true |
DIFF00000005035 | general_code_change | Go | payments_734.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005036 | obfuscated_destructive | SQL | sessions_473.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELetE From CuStOMERs; | DELETE_UNQUALIFIED | true |
DIFF00000005037 | raw_sql_safe | SQL | reviews_773.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (updated_at, name) VALUES (%s, %s); | NONE | false |
DIFF00000005038 | orm_schema_change | JavaScript | transactions_794.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('address')) | NONE | true |
DIFF00000005039 | raw_sql_destructive | SQL | users_328.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | true |
DIFF00000005040 | test_suite_cleanup | SQL | test/comments_636.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions RENAME COLUMN phone TO user_role; | ALTER_RENAME | false |
DIFF00000005041 | general_code_change | Java | events_269.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005042 | raw_sql_destructive | SQL | employees_155.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE orders SET order_id = CONCAT(order_id, score); | UPDATE_CONCAT | true |
DIFF00000005043 | raw_sql_safe | SQL | sessions_524.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE order_id = 'active'; | NONE | false |
DIFF00000005044 | test_suite_cleanup | SQL | test/inventory_542.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | false |
DIFF00000005045 | raw_sql_destructive | SQL | logs_801.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE shipments; | TRUNCATE | true |
DIFF00000005046 | orm_schema_change | Ruby | refunds_730.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :users, :metadata | NONE | true |
DIFF00000005047 | test_suite_cleanup | SQL | spec/notifications_560.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE notifications RENAME COLUMN status TO state; | ALTER_RENAME | false |
DIFF00000005048 | general_code_change | Ruby | logs_69.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000005049 | orm_schema_change | Ruby | accounts_934.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :shipments, :updated_at | NONE | true |
DIFF00000005050 | orm_schema_change | Python | customers_788.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='invoices', name='metadata') | NONE | true |
DIFF00000005051 | raw_sql_destructive | SQL | refunds_55.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE shipments DROP COLUMN description; | DROP_COLUMN | true |
DIFF00000005052 | general_code_change | JavaScript | accounts_156.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000005053 | raw_sql_destructive | SQL | users_66.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE users SET name = CONCAT(name, description); | UPDATE_CONCAT | true |
DIFF00000005054 | general_code_change | TypeScript | customers_200.ts | refactor / feature work | @@ -1,3 +1,3 @@
+export function toTitleCase(s: string): string { return s.replace(/\w\S*/g, t => t[0].toUpperCase() + t.slice(1)); } | NONE | false |
DIFF00000005055 | mentioned_in_comment | Python | notifications_73.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM invoices;") | DELETE_UNQUALIFIED | false |
DIFF00000005056 | general_code_change | JavaScript | transactions_446.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00000005057 | general_code_change | JavaScript | sessions_760.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00000005058 | general_code_change | Go | shipments_15.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005059 | orm_schema_change | TypeScript | tickets_954.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Products { // removed field: user_id } | NONE | true |
DIFF00000005060 | raw_sql_destructive | SQL | customers_729.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE products RENAME COLUMN balance TO user_role; | ALTER_RENAME | true |
DIFF00000005061 | obfuscated_destructive | SQL | tickets_423.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
invoices
RENAME
COLUMN
user_id
TO
user_role; | ALTER_RENAME | true |
DIFF00000005062 | general_code_change | Java | customers_958.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005063 | general_code_change | JavaScript | notifications_861.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00000005064 | raw_sql_destructive | SQL | comments_466.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN role TO contact_email; | ALTER_RENAME | true |
DIFF00000005065 | general_code_change | Go | invoices_372.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005066 | raw_sql_safe | SQL | tickets_704.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM customers WHERE user_id = 'active'; | NONE | false |
DIFF00000005067 | raw_sql_safe | SQL | employees_676.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE notifications ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00000005068 | raw_sql_destructive | SQL | inventory_613.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE transactions SET created_at = CONCAT(created_at, phone); | UPDATE_CONCAT | true |
DIFF00000005069 | general_code_change | Go | employees_146.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005070 | mentioned_in_comment | Python | shipments_830.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DELETE FROM invoices; -- now deprecated""" | DELETE_UNQUALIFIED | false |
DIFF00000005071 | orm_schema_change | Ruby | orders_842.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :customers, :status | NONE | true |
DIFF00000005072 | general_code_change | Python | notifications_546.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005073 | general_code_change | Java | comments_202.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005074 | test_suite_cleanup | SQL | tests/accounts_984.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | false |
DIFF00000005075 | orm_schema_change | JavaScript | refunds_692.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('logs', table => table.dropColumn('description')) | NONE | true |
DIFF00000005076 | obfuscated_destructive | SQL | subscriptions_53.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from accounts; | DELETE_UNQUALIFIED | true |
DIFF00000005077 | general_code_change | Go | shipments_531.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005078 | test_suite_cleanup | SQL | test/reviews_238.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE invoices RENAME COLUMN amount TO contact_email; | ALTER_RENAME | false |
DIFF00000005079 | obfuscated_destructive | SQL | accounts_785.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE users SET role = CONCAT(role, name); | UPDATE_CONCAT | true |
DIFF00000005080 | general_code_change | Python | subscriptions_275.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005081 | mentioned_in_comment | Python | shipments_795.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE products; -- now deprecated""" | DROP_TABLE | false |
DIFF00000005082 | test_suite_cleanup | SQL | tests/logs_698.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE reviews DROP COLUMN amount; | DROP_COLUMN | false |
DIFF00000005083 | raw_sql_safe | SQL | customers_650.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE refunds SET created_at = %s WHERE score = %s; | NONE | false |
DIFF00000005084 | raw_sql_safe | SQL | shipments_438.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO comments (role, is_active) VALUES (%s, %s); | NONE | false |
DIFF00000005085 | general_code_change | Java | customers_938.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005086 | general_code_change | Go | invoices_32.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005087 | general_code_change | Java | events_37.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005088 | mentioned_in_comment | Python | transactions_332.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE orders; -- now deprecated""" | TRUNCATE | false |
DIFF00000005089 | general_code_change | Java | sessions_494.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005090 | test_suite_cleanup | SQL | test/comments_935.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE transactions SET email = CONCAT(email, is_active); | UPDATE_CONCAT | false |
DIFF00000005091 | test_suite_cleanup | SQL | tests/notifications_504.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE products RENAME COLUMN score TO contact_email; | ALTER_RENAME | false |
DIFF00000005092 | orm_schema_change | JavaScript | comments_848.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('order_id')) | NONE | true |
DIFF00000005093 | general_code_change | Python | inventory_105.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000005094 | raw_sql_safe | SQL | comments_603.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM events WHERE category = 'active'; | NONE | false |
DIFF00000005095 | test_suite_cleanup | SQL | test/accounts_180.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE payments DROP COLUMN name; | DROP_COLUMN | false |
DIFF00000005096 | general_code_change | JavaScript | events_358.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00000005097 | orm_schema_change | Python | products_40.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='shipments', name='score') | NONE | true |
DIFF00000005098 | raw_sql_safe | SQL | invoices_334.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO orders (role, user_id) VALUES (%s, %s); | NONE | false |
DIFF00000005099 | orm_schema_change | JavaScript | accounts_8.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('refunds', table => table.dropColumn('phone')) | NONE | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.