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 |
|---|---|---|---|---|---|---|---|
DIFF00000001900 | mentioned_in_comment | Python | shipments_589.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE events;") | DROP_TABLE | false |
DIFF00000001901 | raw_sql_safe | SQL | employees_873.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_inventory_updated_at ON inventory (role); | NONE | false |
DIFF00000001902 | general_code_change | JavaScript | payments_24.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001903 | raw_sql_safe | SQL | invoices_772.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM sessions WHERE score = 'active'; | NONE | false |
DIFF00000001904 | general_code_change | Python | accounts_385.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001905 | orm_schema_change | JavaScript | users_150.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('accounts', table => table.dropColumn('email')) | NONE | true |
DIFF00000001906 | general_code_change | TypeScript | reviews_920.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 |
DIFF00000001907 | raw_sql_safe | SQL | customers_509.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE subscriptions SET price = %s WHERE address = %s; | NONE | false |
DIFF00000001908 | obfuscated_destructive | SQL | events_41.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table employees rename column is_active to full_name; | ALTER_RENAME | true |
DIFF00000001909 | orm_schema_change | Python | refunds_829.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='tickets', name='quantity') | NONE | true |
DIFF00000001910 | orm_schema_change | JavaScript | customers_165.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('orders', table => table.dropColumn('status')) | NONE | true |
DIFF00000001911 | obfuscated_destructive | SQL | payments_349.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00000001912 | orm_schema_change | Python | tickets_54.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='employees', name='amount') | NONE | true |
DIFF00000001913 | general_code_change | Ruby | comments_711.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000001914 | test_suite_cleanup | SQL | spec/sessions_22.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE sessions; | DROP_TABLE | false |
DIFF00000001915 | raw_sql_destructive | SQL | events_235.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE sessions RENAME COLUMN role TO state; | ALTER_RENAME | true |
DIFF00000001916 | obfuscated_destructive | SQL | notifications_368.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE tickets SET status = CONCAT(status, quantity); | UPDATE_CONCAT | true |
DIFF00000001917 | orm_schema_change | JavaScript | logs_98.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('comments', table => table.dropColumn('created_at')) | NONE | true |
DIFF00000001918 | general_code_change | Ruby | refunds_442.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000001919 | raw_sql_safe | SQL | accounts_375.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE products ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00000001920 | raw_sql_safe | SQL | users_314.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_invoices_name ON invoices (address); | NONE | false |
DIFF00000001921 | raw_sql_safe | SQL | payments_468.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE invoices ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00000001922 | raw_sql_destructive | SQL | refunds_283.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | true |
DIFF00000001923 | general_code_change | JavaScript | notifications_438.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001924 | mentioned_in_comment | Python | transactions_844.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE invoices;' manually, handled by migration tool | TRUNCATE | false |
DIFF00000001925 | general_code_change | TypeScript | sessions_684.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 |
DIFF00000001926 | raw_sql_safe | SQL | transactions_21.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO events (category, role) VALUES (%s, %s); | NONE | false |
DIFF00000001927 | raw_sql_destructive | SQL | inventory_197.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN quantity; | DROP_COLUMN | true |
DIFF00000001928 | test_suite_cleanup | SQL | tests/products_519.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | false |
DIFF00000001929 | test_suite_cleanup | SQL | spec/shipments_350.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM comments; | DELETE_UNQUALIFIED | false |
DIFF00000001930 | raw_sql_safe | SQL | inventory_957.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_tickets_metadata ON tickets (metadata); | NONE | false |
DIFF00000001931 | mentioned_in_comment | Python | shipments_46.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE employees RENAME COLUMN updated_at TO full_name;") | ALTER_RENAME | false |
DIFF00000001932 | general_code_change | JavaScript | sessions_303.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001933 | general_code_change | JavaScript | tickets_69.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001934 | general_code_change | JavaScript | orders_498.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 |
DIFF00000001935 | raw_sql_safe | SQL | accounts_901.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE orders ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00000001936 | mentioned_in_comment | Python | inventory_468.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE inventory;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00000001937 | test_suite_cleanup | SQL | tests/sessions_591.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | false |
DIFF00000001938 | orm_schema_change | JavaScript | inventory_193.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('tickets', 'is_active') | NONE | true |
DIFF00000001939 | general_code_change | Java | orders_118.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001940 | raw_sql_safe | SQL | sessions_242.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_payments_description ON payments (address); | NONE | false |
DIFF00000001941 | obfuscated_destructive | SQL | accounts_2.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
reviews
SET
is_active
=
CONCAT(is_active,
status); | UPDATE_CONCAT | true |
DIFF00000001942 | raw_sql_safe | SQL | events_470.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE logs ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00000001943 | raw_sql_destructive | SQL | comments_295.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00000001944 | orm_schema_change | Python | sessions_761.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='comments', name='is_active') | NONE | true |
DIFF00000001945 | raw_sql_safe | SQL | products_203.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_reviews_created_at ON reviews (name); | NONE | false |
DIFF00000001946 | general_code_change | Python | users_660.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001947 | orm_schema_change | Ruby | notifications_177.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :products, :phone | NONE | true |
DIFF00000001948 | obfuscated_destructive | SQL | users_707.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00000001949 | general_code_change | Python | users_62.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001950 | general_code_change | Java | products_920.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001951 | raw_sql_safe | SQL | customers_323.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE logs ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00000001952 | orm_schema_change | JavaScript | sessions_867.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('reviews', table => table.dropColumn('quantity')) | NONE | true |
DIFF00000001953 | orm_schema_change | Python | accounts_159.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='order_id') | NONE | true |
DIFF00000001954 | raw_sql_safe | SQL | comments_587.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE users ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00000001955 | raw_sql_safe | SQL | notifications_3.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM products WHERE balance = 'active'; | NONE | false |
DIFF00000001956 | general_code_change | Java | tickets_381.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001957 | raw_sql_destructive | SQL | reviews_840.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE subscriptions; | TRUNCATE | true |
DIFF00000001958 | general_code_change | Python | notifications_348.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001959 | mentioned_in_comment | Python | employees_260.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE comments;' manually, handled by migration tool | TRUNCATE | false |
DIFF00000001960 | general_code_change | Python | notifications_546.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000001961 | general_code_change | Java | logs_865.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001962 | test_suite_cleanup | SQL | mysql-test/suite/reviews_78.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN quantity TO user_role; | ALTER_RENAME | false |
DIFF00000001963 | general_code_change | JavaScript | payments_751.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001964 | general_code_change | JavaScript | events_64.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001965 | general_code_change | Java | transactions_910.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001966 | general_code_change | Python | accounts_188.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000001967 | orm_schema_change | JavaScript | reviews_414.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('events', table => table.dropColumn('category')) | NONE | true |
DIFF00000001968 | general_code_change | Python | transactions_48.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001969 | test_suite_cleanup | SQL | mysql-test/suite/shipments_237.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE employees RENAME COLUMN quantity TO amount_cents; | ALTER_RENAME | false |
DIFF00000001970 | general_code_change | JavaScript | sessions_108.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 |
DIFF00000001971 | general_code_change | Python | tickets_19.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000001972 | obfuscated_destructive | SQL | events_129.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table tickets rename column balance to state; | ALTER_RENAME | true |
DIFF00000001973 | raw_sql_safe | SQL | sessions_908.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE amount = 'active'; | NONE | false |
DIFF00000001974 | raw_sql_safe | SQL | accounts_974.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE transactions SET priority = %s WHERE price = %s; | NONE | false |
DIFF00000001975 | general_code_change | JavaScript | events_190.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001976 | obfuscated_destructive | SQL | transactions_658.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN role TO contact_email; | ALTER_RENAME | true |
DIFF00000001977 | raw_sql_destructive | SQL | shipments_920.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | true |
DIFF00000001978 | general_code_change | Go | accounts_123.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000001979 | general_code_change | JavaScript | invoices_30.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000001980 | test_suite_cleanup | SQL | mysql-test/suite/subscriptions_645.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | false |
DIFF00000001981 | obfuscated_destructive | SQL | employees_59.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTEr TAbLe noTiFicAtIons DRop COLuMN pHOne; | DROP_COLUMN | true |
DIFF00000001982 | raw_sql_destructive | SQL | users_298.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN created_at TO full_name; | ALTER_RENAME | true |
DIFF00000001983 | raw_sql_destructive | SQL | invoices_972.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM reviews; | DELETE_UNQUALIFIED | true |
DIFF00000001984 | obfuscated_destructive | SQL | payments_2.sql | schema cleanup | @@ -1,3 +1,3 @@
+DrOp TABLe shIpments; | DROP_TABLE | true |
DIFF00000001985 | raw_sql_safe | SQL | reviews_30.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE notifications SET quantity = %s WHERE name = %s; | NONE | false |
DIFF00000001986 | raw_sql_safe | SQL | shipments_352.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM comments WHERE phone = 'active'; | NONE | false |
DIFF00000001987 | general_code_change | Python | sessions_229.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000001988 | mentioned_in_comment | Python | notifications_922.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE customers; -- now deprecated""" | TRUNCATE | false |
DIFF00000001989 | raw_sql_destructive | SQL | transactions_307.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN balance; | DROP_COLUMN | true |
DIFF00000001990 | raw_sql_destructive | SQL | users_759.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE refunds SET price = CONCAT(price, amount); | UPDATE_CONCAT | true |
DIFF00000001991 | raw_sql_safe | SQL | notifications_897.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM comments WHERE updated_at = 'active'; | NONE | false |
DIFF00000001992 | test_suite_cleanup | SQL | tests/refunds_566.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | false |
DIFF00000001993 | obfuscated_destructive | SQL | users_373.sql | schema cleanup | @@ -1,3 +1,3 @@
+update employees set updated_at = concat(updated_at, balance); | UPDATE_CONCAT | true |
DIFF00000001994 | test_suite_cleanup | SQL | test/reviews_495.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM customers; | DELETE_UNQUALIFIED | false |
DIFF00000001995 | general_code_change | Java | comments_12.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000001996 | obfuscated_destructive | SQL | reviews_491.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM accounts; | DELETE_UNQUALIFIED | true |
DIFF00000001997 | orm_schema_change | JavaScript | customers_763.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('employees', table => table.dropColumn('description')) | NONE | true |
DIFF00000001998 | mentioned_in_comment | Python | tickets_426.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE transactions SET balance = CONCAT(balance, priority);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000001999 | general_code_change | TypeScript | employees_599.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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.