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 |
|---|---|---|---|---|---|---|---|
DIFF00099992000 | orm_schema_change | JavaScript | payments_632.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'phone') | NONE | true |
DIFF00099992001 | general_code_change | Java | transactions_217.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099992002 | general_code_change | Python | payments_638.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992003 | orm_schema_change | TypeScript | subscriptions_737.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Logs { // removed field: quantity } | NONE | true |
DIFF00099992004 | obfuscated_destructive | SQL | users_865.sql | schema cleanup | @@ -1,3 +1,3 @@
+update transactions set order_id = concat(order_id, status); | UPDATE_CONCAT | true |
DIFF00099992005 | raw_sql_safe | SQL | shipments_381.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE comments SET quantity = %s WHERE created_at = %s; | NONE | false |
DIFF00099992006 | obfuscated_destructive | SQL | comments_273.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN is_active; | DROP_COLUMN | true |
DIFF00099992007 | raw_sql_destructive | SQL | payments_393.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE employees SET email = CONCAT(email, balance); | UPDATE_CONCAT | true |
DIFF00099992008 | orm_schema_change | Ruby | customers_689.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :accounts, :status | NONE | true |
DIFF00099992009 | general_code_change | Python | inventory_192.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992010 | mentioned_in_comment | Python | notifications_348.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE sessions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099992011 | general_code_change | Java | comments_453.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099992012 | obfuscated_destructive | SQL | orders_680.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTeR tabLE PaYmENtS RENaMe colUMn PhoNE to AMoUNt_CenTS; | ALTER_RENAME | true |
DIFF00099992013 | general_code_change | Python | orders_272.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992014 | mentioned_in_comment | Python | refunds_586.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM reviews;") | DELETE_UNQUALIFIED | false |
DIFF00099992015 | orm_schema_change | JavaScript | events_831.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('events', table => table.dropColumn('category')) | NONE | true |
DIFF00099992016 | mentioned_in_comment | Python | notifications_19.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE sessions SET category = CONCAT(category, amount); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099992017 | obfuscated_destructive | SQL | payments_253.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table employees rename column category to full_name; | ALTER_RENAME | true |
DIFF00099992018 | raw_sql_destructive | SQL | transactions_586.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE employees SET price = CONCAT(price, balance); | UPDATE_CONCAT | true |
DIFF00099992019 | orm_schema_change | Ruby | orders_213.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :accounts, :name | NONE | true |
DIFF00099992020 | raw_sql_safe | SQL | comments_941.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO transactions (order_id, address) VALUES (%s, %s); | NONE | false |
DIFF00099992021 | obfuscated_destructive | SQL | subscriptions_589.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table customers; | DROP_TABLE | true |
DIFF00099992022 | raw_sql_safe | SQL | accounts_459.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE description = 'active'; | NONE | false |
DIFF00099992023 | mentioned_in_comment | Python | customers_598.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE tickets RENAME COLUMN balance TO contact_email;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00099992024 | mentioned_in_comment | Python | subscriptions_528.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE comments RENAME COLUMN priority TO amount_cents;") | ALTER_RENAME | false |
DIFF00099992025 | general_code_change | Java | orders_165.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099992026 | mentioned_in_comment | Python | transactions_110.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE subscriptions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099992027 | raw_sql_safe | SQL | customers_631.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_email ON transactions (quantity); | NONE | false |
DIFF00099992028 | test_suite_cleanup | SQL | mysql-test/suite/customers_623.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE events; | DROP_TABLE | false |
DIFF00099992029 | test_suite_cleanup | SQL | test/inventory_258.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE refunds; | TRUNCATE | false |
DIFF00099992030 | mentioned_in_comment | Python | inventory_165.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE comments; -- now deprecated""" | DROP_TABLE | false |
DIFF00099992031 | raw_sql_destructive | SQL | products_912.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | true |
DIFF00099992032 | raw_sql_destructive | SQL | customers_322.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews RENAME COLUMN phone TO state; | ALTER_RENAME | true |
DIFF00099992033 | raw_sql_safe | SQL | sessions_568.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE employees SET email = %s WHERE email = %s; | NONE | false |
DIFF00099992034 | general_code_change | JavaScript | products_603.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992035 | raw_sql_safe | SQL | employees_79.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO customers (role, amount) VALUES (%s, %s); | NONE | false |
DIFF00099992036 | general_code_change | Python | transactions_380.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992037 | raw_sql_safe | SQL | products_838.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (name, created_at) VALUES (%s, %s); | NONE | false |
DIFF00099992038 | raw_sql_destructive | SQL | refunds_654.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE tickets SET amount = CONCAT(amount, name); | UPDATE_CONCAT | true |
DIFF00099992039 | obfuscated_destructive | SQL | invoices_265.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
accounts; | DELETE_UNQUALIFIED | true |
DIFF00099992040 | orm_schema_change | Ruby | subscriptions_720.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :payments, :role | NONE | true |
DIFF00099992041 | orm_schema_change | Ruby | events_827.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :refunds, :description | NONE | true |
DIFF00099992042 | general_code_change | JavaScript | subscriptions_303.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 |
DIFF00099992043 | raw_sql_destructive | SQL | accounts_105.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE logs SET price = CONCAT(price, role); | UPDATE_CONCAT | true |
DIFF00099992044 | obfuscated_destructive | SQL | payments_621.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | true |
DIFF00099992045 | mentioned_in_comment | Python | transactions_747.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM notifications;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00099992046 | raw_sql_destructive | SQL | inventory_272.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders DROP COLUMN price; | DROP_COLUMN | true |
DIFF00099992047 | orm_schema_change | JavaScript | sessions_929.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('inventory', table => table.dropColumn('price')) | NONE | true |
DIFF00099992048 | general_code_change | Python | sessions_92.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992049 | raw_sql_destructive | SQL | sessions_57.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE comments DROP COLUMN status; | DROP_COLUMN | true |
DIFF00099992050 | raw_sql_destructive | SQL | products_780.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE subscriptions SET email = CONCAT(email, priority); | UPDATE_CONCAT | true |
DIFF00099992051 | obfuscated_destructive | SQL | payments_529.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table products drop column priority; | DROP_COLUMN | true |
DIFF00099992052 | mentioned_in_comment | Python | tickets_149.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM customers;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00099992053 | test_suite_cleanup | SQL | spec/orders_754.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE comments SET balance = CONCAT(balance, email); | UPDATE_CONCAT | false |
DIFF00099992054 | raw_sql_safe | SQL | payments_369.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE name = 'active'; | NONE | false |
DIFF00099992055 | raw_sql_safe | SQL | payments_409.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO users (metadata, amount) VALUES (%s, %s); | NONE | false |
DIFF00099992056 | general_code_change | Python | payments_76.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992057 | test_suite_cleanup | SQL | mysql-test/suite/invoices_545.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE inventory; | TRUNCATE | false |
DIFF00099992058 | test_suite_cleanup | SQL | tests/payments_875.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM products; | DELETE_UNQUALIFIED | false |
DIFF00099992059 | mentioned_in_comment | Python | refunds_53.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE sessions SET created_at = CONCAT(created_at, price); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099992060 | raw_sql_safe | SQL | reviews_171.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_score ON products (metadata); | NONE | false |
DIFF00099992061 | obfuscated_destructive | SQL | invoices_409.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE accounts DROP COLUMN role; | DROP_COLUMN | true |
DIFF00099992062 | orm_schema_change | Ruby | users_12.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :products, :phone | NONE | true |
DIFF00099992063 | raw_sql_destructive | SQL | accounts_249.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00099992064 | raw_sql_destructive | SQL | shipments_928.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE invoices DROP COLUMN priority; | DROP_COLUMN | true |
DIFF00099992065 | orm_schema_change | JavaScript | customers_833.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('comments', 'user_id') | NONE | true |
DIFF00099992066 | raw_sql_destructive | SQL | refunds_27.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE invoices; | DROP_TABLE | true |
DIFF00099992067 | raw_sql_destructive | SQL | tickets_273.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | true |
DIFF00099992068 | obfuscated_destructive | SQL | transactions_664.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from sessions; | DELETE_UNQUALIFIED | true |
DIFF00099992069 | general_code_change | Python | users_412.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992070 | raw_sql_safe | SQL | users_889.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE comments SET description = %s WHERE email = %s; | NONE | false |
DIFF00099992071 | general_code_change | JavaScript | inventory_276.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 |
DIFF00099992072 | test_suite_cleanup | SQL | mysql-test/suite/customers_363.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE inventory SET score = CONCAT(score, status); | UPDATE_CONCAT | false |
DIFF00099992073 | raw_sql_destructive | SQL | inventory_728.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | true |
DIFF00099992074 | raw_sql_destructive | SQL | orders_146.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM sessions; | DELETE_UNQUALIFIED | true |
DIFF00099992075 | general_code_change | Python | employees_215.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992076 | raw_sql_safe | SQL | notifications_576.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE refunds ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099992077 | obfuscated_destructive | SQL | products_358.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
reviews
SET
balance
=
CONCAT(balance,
description); | UPDATE_CONCAT | true |
DIFF00099992078 | general_code_change | Python | inventory_186.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992079 | raw_sql_safe | SQL | products_949.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO reviews (phone, description) VALUES (%s, %s); | NONE | false |
DIFF00099992080 | raw_sql_safe | SQL | customers_449.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE events SET category = %s WHERE email = %s; | NONE | false |
DIFF00099992081 | general_code_change | Ruby | inventory_468.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992082 | general_code_change | Python | subscriptions_106.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992083 | orm_schema_change | Ruby | refunds_765.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :inventory, :amount | NONE | true |
DIFF00099992084 | obfuscated_destructive | SQL | shipments_960.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table notifications drop column balance; | DROP_COLUMN | true |
DIFF00099992085 | raw_sql_safe | SQL | transactions_498.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO shipments (description, address) VALUES (%s, %s); | NONE | false |
DIFF00099992086 | raw_sql_safe | SQL | events_276.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO products (priority, created_at) VALUES (%s, %s); | NONE | false |
DIFF00099992087 | raw_sql_safe | SQL | subscriptions_165.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_user_id ON transactions (phone); | NONE | false |
DIFF00099992088 | obfuscated_destructive | SQL | refunds_863.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table orders; | TRUNCATE | true |
DIFF00099992089 | orm_schema_change | TypeScript | refunds_917.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Shipments { // removed field: name } | NONE | true |
DIFF00099992090 | raw_sql_destructive | SQL | sessions_199.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM shipments; | DELETE_UNQUALIFIED | true |
DIFF00099992091 | raw_sql_safe | SQL | subscriptions_35.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_comments_order_id ON comments (address); | NONE | false |
DIFF00099992092 | orm_schema_change | TypeScript | customers_28.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Products { // removed field: description } | NONE | true |
DIFF00099992093 | general_code_change | Go | accounts_513.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099992094 | mentioned_in_comment | Python | tickets_23.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM payments;") | DELETE_UNQUALIFIED | false |
DIFF00099992095 | orm_schema_change | JavaScript | products_732.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('accounts', table => table.dropColumn('name')) | NONE | true |
DIFF00099992096 | test_suite_cleanup | SQL | mysql-test/suite/payments_511.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM customers; | DELETE_UNQUALIFIED | false |
DIFF00099992097 | raw_sql_safe | SQL | users_496.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM transactions WHERE name = 'active'; | NONE | false |
DIFF00099992098 | general_code_change | TypeScript | customers_895.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 |
DIFF00099992099 | raw_sql_destructive | SQL | refunds_101.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE transactions SET description = CONCAT(description, user_id); | UPDATE_CONCAT | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.