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 |
|---|---|---|---|---|---|---|---|
DIFF00000004000 | general_code_change | Python | orders_88.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004001 | orm_schema_change | Python | subscriptions_27.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='price') | NONE | true |
DIFF00000004002 | general_code_change | Ruby | subscriptions_727.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000004003 | orm_schema_change | Ruby | inventory_310.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :products, :order_id | NONE | true |
DIFF00000004004 | raw_sql_destructive | SQL | inventory_552.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE comments RENAME COLUMN order_id TO full_name; | ALTER_RENAME | true |
DIFF00000004005 | mentioned_in_comment | Python | refunds_918.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE invoices;") | DROP_TABLE | false |
DIFF00000004006 | raw_sql_destructive | SQL | notifications_548.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE accounts; | DROP_TABLE | true |
DIFF00000004007 | mentioned_in_comment | Python | orders_194.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE tickets; -- now deprecated""" | DROP_TABLE | false |
DIFF00000004008 | raw_sql_safe | SQL | tickets_225.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (priority, updated_at) VALUES (%s, %s); | NONE | false |
DIFF00000004009 | orm_schema_change | TypeScript | accounts_782.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Customers { // removed field: created_at } | NONE | true |
DIFF00000004010 | raw_sql_destructive | SQL | accounts_559.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders DROP COLUMN order_id; | DROP_COLUMN | true |
DIFF00000004011 | general_code_change | TypeScript | refunds_297.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 |
DIFF00000004012 | raw_sql_destructive | SQL | users_805.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews DROP COLUMN score; | DROP_COLUMN | true |
DIFF00000004013 | general_code_change | Java | customers_551.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000004014 | obfuscated_destructive | SQL | transactions_473.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table products; | DROP_TABLE | true |
DIFF00000004015 | raw_sql_safe | SQL | inventory_143.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE accounts SET description = %s WHERE user_id = %s; | NONE | false |
DIFF00000004016 | general_code_change | JavaScript | notifications_577.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000004017 | general_code_change | Python | accounts_741.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004018 | general_code_change | Go | invoices_54.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000004019 | orm_schema_change | JavaScript | accounts_921.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('logs', table => table.dropColumn('metadata')) | NONE | true |
DIFF00000004020 | general_code_change | Ruby | customers_147.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000004021 | raw_sql_destructive | SQL | subscriptions_622.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE tickets RENAME COLUMN updated_at TO state; | ALTER_RENAME | true |
DIFF00000004022 | obfuscated_destructive | SQL | sessions_328.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNcATe tAbLe rEFUnDs; | TRUNCATE | true |
DIFF00000004023 | test_suite_cleanup | SQL | tests/tickets_650.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE invoices DROP COLUMN email; | DROP_COLUMN | false |
DIFF00000004024 | mentioned_in_comment | Python | events_809.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE comments;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00000004025 | orm_schema_change | Python | users_217.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='products', name='created_at') | NONE | true |
DIFF00000004026 | general_code_change | JavaScript | reviews_847.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 |
DIFF00000004027 | general_code_change | JavaScript | customers_111.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 |
DIFF00000004028 | obfuscated_destructive | SQL | products_793.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP TABLE subscriptions; | DROP_TABLE | true |
DIFF00000004029 | orm_schema_change | Python | transactions_941.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='logs', name='created_at') | NONE | true |
DIFF00000004030 | general_code_change | JavaScript | sessions_270.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 |
DIFF00000004031 | mentioned_in_comment | Python | orders_153.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE inventory RENAME COLUMN updated_at TO state; -- now deprecated""" | ALTER_RENAME | false |
DIFF00000004032 | raw_sql_safe | SQL | comments_395.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE customers SET quantity = %s WHERE metadata = %s; | NONE | false |
DIFF00000004033 | raw_sql_destructive | SQL | tickets_364.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE inventory SET name = CONCAT(name, balance); | UPDATE_CONCAT | true |
DIFF00000004034 | raw_sql_destructive | SQL | subscriptions_296.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM notifications; | DELETE_UNQUALIFIED | true |
DIFF00000004035 | raw_sql_destructive | SQL | tickets_681.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | true |
DIFF00000004036 | obfuscated_destructive | SQL | customers_8.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
subscriptions
DROP
COLUMN
order_id; | DROP_COLUMN | true |
DIFF00000004037 | raw_sql_destructive | SQL | subscriptions_20.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE accounts; | TRUNCATE | true |
DIFF00000004038 | obfuscated_destructive | SQL | invoices_768.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop tAble InvEnTOrY; | DROP_TABLE | true |
DIFF00000004039 | raw_sql_destructive | SQL | tickets_629.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders DROP COLUMN status; | DROP_COLUMN | true |
DIFF00000004040 | general_code_change | Python | customers_264.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004041 | general_code_change | Go | shipments_537.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000004042 | mentioned_in_comment | Python | customers_739.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE notifications; -- now deprecated""" | TRUNCATE | false |
DIFF00000004043 | test_suite_cleanup | SQL | spec/tickets_665.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN quantity; | DROP_COLUMN | false |
DIFF00000004044 | general_code_change | Python | invoices_199.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004045 | raw_sql_destructive | SQL | inventory_589.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE tickets; | DROP_TABLE | true |
DIFF00000004046 | raw_sql_safe | SQL | invoices_300.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE sessions SET address = %s WHERE metadata = %s; | NONE | false |
DIFF00000004047 | raw_sql_safe | SQL | products_379.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM comments WHERE updated_at = 'active'; | NONE | false |
DIFF00000004048 | raw_sql_destructive | SQL | customers_77.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE refunds RENAME COLUMN name TO amount_cents; | ALTER_RENAME | true |
DIFF00000004049 | raw_sql_destructive | SQL | tickets_328.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM customers; | DELETE_UNQUALIFIED | true |
DIFF00000004050 | orm_schema_change | JavaScript | invoices_541.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'quantity') | NONE | true |
DIFF00000004051 | orm_schema_change | Ruby | notifications_960.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :orders, :address | NONE | true |
DIFF00000004052 | orm_schema_change | JavaScript | employees_366.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('employees', 'amount') | NONE | true |
DIFF00000004053 | obfuscated_destructive | SQL | products_862.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table payments; | DROP_TABLE | true |
DIFF00000004054 | general_code_change | TypeScript | refunds_558.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 |
DIFF00000004055 | raw_sql_safe | SQL | transactions_24.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE customers SET balance = %s WHERE description = %s; | NONE | false |
DIFF00000004056 | obfuscated_destructive | SQL | tickets_95.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE
TABLE
payments; | TRUNCATE | true |
DIFF00000004057 | orm_schema_change | JavaScript | logs_712.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('shipments', 'user_id') | NONE | true |
DIFF00000004058 | raw_sql_safe | SQL | employees_295.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE refunds SET metadata = %s WHERE order_id = %s; | NONE | false |
DIFF00000004059 | test_suite_cleanup | SQL | spec/events_194.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | false |
DIFF00000004060 | obfuscated_destructive | SQL | accounts_677.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table sessions drop column score; | DROP_COLUMN | true |
DIFF00000004061 | mentioned_in_comment | Python | orders_262.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE shipments RENAME COLUMN email TO contact_email; -- now deprecated""" | ALTER_RENAME | false |
DIFF00000004062 | general_code_change | Java | notifications_12.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000004063 | obfuscated_destructive | SQL | inventory_190.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
payments
SET
price
=
CONCAT(price,
user_id); | UPDATE_CONCAT | true |
DIFF00000004064 | obfuscated_destructive | SQL | comments_181.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTer tAbLE ReviEwS renAmE cOLuMn emAil tO stATe; | ALTER_RENAME | true |
DIFF00000004065 | general_code_change | Python | sessions_926.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004066 | obfuscated_destructive | SQL | logs_950.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM comments; | DELETE_UNQUALIFIED | true |
DIFF00000004067 | test_suite_cleanup | SQL | test/notifications_244.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM refunds; | DELETE_UNQUALIFIED | false |
DIFF00000004068 | raw_sql_safe | SQL | invoices_896.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE is_active = 'active'; | NONE | false |
DIFF00000004069 | general_code_change | Java | tickets_683.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000004070 | test_suite_cleanup | SQL | mysql-test/suite/events_962.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE shipments DROP COLUMN amount; | DROP_COLUMN | false |
DIFF00000004071 | mentioned_in_comment | Python | tickets_196.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE users DROP COLUMN created_at;' manually, handled by migration tool | DROP_COLUMN | false |
DIFF00000004072 | orm_schema_change | TypeScript | logs_440.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Logs { // removed field: price } | NONE | true |
DIFF00000004073 | raw_sql_destructive | SQL | events_710.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | true |
DIFF00000004074 | raw_sql_destructive | SQL | inventory_308.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM employees; | DELETE_UNQUALIFIED | true |
DIFF00000004075 | test_suite_cleanup | SQL | test/customers_600.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE comments RENAME COLUMN score TO state; | ALTER_RENAME | false |
DIFF00000004076 | general_code_change | Go | logs_868.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000004077 | obfuscated_destructive | SQL | customers_208.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table sessions rename column metadata to user_role; | ALTER_RENAME | true |
DIFF00000004078 | raw_sql_safe | SQL | tickets_279.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM refunds WHERE updated_at = 'active'; | NONE | false |
DIFF00000004079 | general_code_change | Java | shipments_795.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000004080 | general_code_change | Ruby | subscriptions_383.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000004081 | general_code_change | Python | employees_76.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000004082 | raw_sql_safe | SQL | comments_562.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_payments_role ON payments (order_id); | NONE | false |
DIFF00000004083 | raw_sql_safe | SQL | tickets_783.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO payments (is_active, balance) VALUES (%s, %s); | NONE | false |
DIFF00000004084 | general_code_change | Python | refunds_423.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004085 | general_code_change | JavaScript | invoices_997.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000004086 | general_code_change | Python | orders_109.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000004087 | general_code_change | Python | tickets_823.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000004088 | raw_sql_safe | SQL | notifications_53.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM employees WHERE email = 'active'; | NONE | false |
DIFF00000004089 | raw_sql_safe | SQL | payments_750.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO events (category, created_at) VALUES (%s, %s); | NONE | false |
DIFF00000004090 | general_code_change | JavaScript | employees_783.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000004091 | obfuscated_destructive | SQL | customers_88.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE employees RENAME COLUMN description TO state; | ALTER_RENAME | true |
DIFF00000004092 | general_code_change | JavaScript | inventory_886.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 |
DIFF00000004093 | orm_schema_change | Ruby | inventory_447.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :transactions, :order_id | NONE | true |
DIFF00000004094 | raw_sql_safe | SQL | inventory_275.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_name ON transactions (metadata); | NONE | false |
DIFF00000004095 | test_suite_cleanup | SQL | tests/shipments_948.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN balance TO amount_cents; | ALTER_RENAME | false |
DIFF00000004096 | general_code_change | Go | employees_319.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000004097 | orm_schema_change | Ruby | subscriptions_23.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :comments, :balance | NONE | true |
DIFF00000004098 | general_code_change | Ruby | logs_743.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000004099 | general_code_change | Python | transactions_50.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.