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 |
|---|---|---|---|---|---|---|---|
DIFF00099999700 | obfuscated_destructive | SQL | shipments_963.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
tickets
SET
phone
=
CONCAT(phone,
description); | UPDATE_CONCAT | true |
DIFF00099999701 | orm_schema_change | JavaScript | notifications_246.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('shipments', table => table.dropColumn('amount')) | NONE | true |
DIFF00099999702 | mentioned_in_comment | Python | users_203.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE orders;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00099999703 | general_code_change | JavaScript | inventory_4.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999704 | mentioned_in_comment | Python | inventory_60.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE logs SET user_id = CONCAT(user_id, user_id);") | UPDATE_CONCAT | false |
DIFF00099999705 | obfuscated_destructive | SQL | products_82.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
transactions
RENAME
COLUMN
phone
TO
user_role; | ALTER_RENAME | true |
DIFF00099999706 | raw_sql_destructive | SQL | shipments_384.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | true |
DIFF00099999707 | orm_schema_change | JavaScript | shipments_920.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('accounts', table => table.dropColumn('is_active')) | NONE | true |
DIFF00099999708 | raw_sql_safe | SQL | notifications_254.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM events WHERE order_id = 'active'; | NONE | false |
DIFF00099999709 | raw_sql_safe | SQL | comments_477.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (status, amount) VALUES (%s, %s); | NONE | false |
DIFF00099999710 | raw_sql_destructive | SQL | tickets_319.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE shipments DROP COLUMN balance; | DROP_COLUMN | true |
DIFF00099999711 | raw_sql_safe | SQL | inventory_547.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM reviews WHERE role = 'active'; | NONE | false |
DIFF00099999712 | raw_sql_destructive | SQL | users_985.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE refunds RENAME COLUMN order_id TO user_role; | ALTER_RENAME | true |
DIFF00099999713 | raw_sql_destructive | SQL | accounts_90.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET amount = CONCAT(amount, name); | UPDATE_CONCAT | true |
DIFF00099999714 | test_suite_cleanup | SQL | test/comments_380.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE invoices SET status = CONCAT(status, amount); | UPDATE_CONCAT | false |
DIFF00099999715 | orm_schema_change | JavaScript | employees_732.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('comments', 'user_id') | NONE | true |
DIFF00099999716 | obfuscated_destructive | SQL | comments_141.sql | schema cleanup | @@ -1,3 +1,3 @@
+aLTer tABle tRansAcTiOnS REnAME cOLUmN priorItY to COnTacT_eMail; | ALTER_RENAME | true |
DIFF00099999717 | raw_sql_safe | SQL | refunds_698.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_orders_order_id ON orders (role); | NONE | false |
DIFF00099999718 | orm_schema_change | JavaScript | subscriptions_266.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('accounts', 'amount') | NONE | true |
DIFF00099999719 | general_code_change | JavaScript | refunds_335.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999720 | test_suite_cleanup | SQL | mysql-test/suite/refunds_370.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE events; | DROP_TABLE | false |
DIFF00099999721 | general_code_change | Python | subscriptions_900.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099999722 | obfuscated_destructive | SQL | refunds_879.sql | schema cleanup | @@ -1,3 +1,3 @@
+DrOp tabLe orDerS; | DROP_TABLE | true |
DIFF00099999723 | general_code_change | Java | reviews_506.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999724 | raw_sql_safe | SQL | invoices_227.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE payments SET is_active = %s WHERE created_at = %s; | NONE | false |
DIFF00099999725 | obfuscated_destructive | SQL | shipments_926.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table payments rename column email to full_name; | ALTER_RENAME | true |
DIFF00099999726 | raw_sql_destructive | SQL | sessions_48.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN email; | DROP_COLUMN | true |
DIFF00099999727 | raw_sql_safe | SQL | products_701.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_accounts_phone ON accounts (role); | NONE | false |
DIFF00099999728 | general_code_change | Python | employees_209.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999729 | general_code_change | TypeScript | employees_766.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 |
DIFF00099999730 | general_code_change | Python | tickets_736.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099999731 | raw_sql_safe | SQL | logs_274.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_amount ON transactions (order_id); | NONE | false |
DIFF00099999732 | obfuscated_destructive | SQL | accounts_927.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | true |
DIFF00099999733 | obfuscated_destructive | SQL | tickets_343.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE products SET created_at = CONCAT(created_at, price); | UPDATE_CONCAT | true |
DIFF00099999734 | test_suite_cleanup | SQL | test/shipments_594.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM subscriptions; | DELETE_UNQUALIFIED | false |
DIFF00099999735 | obfuscated_destructive | SQL | inventory_484.sql | schema cleanup | @@ -1,3 +1,3 @@
+AlTEr TABLe rEviewS DROp cOLUmN phOne; | DROP_COLUMN | true |
DIFF00099999736 | raw_sql_safe | SQL | invoices_451.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (phone, is_active) VALUES (%s, %s); | NONE | false |
DIFF00099999737 | mentioned_in_comment | Python | payments_851.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DELETE FROM orders; -- now deprecated""" | DELETE_UNQUALIFIED | false |
DIFF00099999738 | test_suite_cleanup | SQL | test/tickets_90.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE logs SET user_id = CONCAT(user_id, name); | UPDATE_CONCAT | false |
DIFF00099999739 | orm_schema_change | Ruby | payments_475.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :notifications, :role | NONE | true |
DIFF00099999740 | obfuscated_destructive | SQL | tickets_327.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM subscriptions; | DELETE_UNQUALIFIED | true |
DIFF00099999741 | raw_sql_destructive | SQL | users_489.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE sessions; | DROP_TABLE | true |
DIFF00099999742 | general_code_change | TypeScript | users_808.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 |
DIFF00099999743 | general_code_change | JavaScript | customers_871.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 |
DIFF00099999744 | orm_schema_change | JavaScript | orders_741.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('customers', 'email') | NONE | true |
DIFF00099999745 | general_code_change | JavaScript | subscriptions_590.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 |
DIFF00099999746 | raw_sql_safe | SQL | payments_594.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM shipments WHERE balance = 'active'; | NONE | false |
DIFF00099999747 | raw_sql_safe | SQL | employees_6.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE employees SET is_active = %s WHERE amount = %s; | NONE | false |
DIFF00099999748 | mentioned_in_comment | Python | comments_214.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE sessions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099999749 | general_code_change | Python | orders_415.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999750 | general_code_change | Python | invoices_88.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999751 | general_code_change | JavaScript | accounts_293.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 |
DIFF00099999752 | orm_schema_change | Python | customers_759.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='events', name='quantity') | NONE | true |
DIFF00099999753 | general_code_change | Java | reviews_136.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999754 | raw_sql_destructive | SQL | events_880.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE accounts RENAME COLUMN updated_at TO contact_email; | ALTER_RENAME | true |
DIFF00099999755 | raw_sql_safe | SQL | payments_660.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE customers ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00099999756 | obfuscated_destructive | SQL | notifications_177.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table tickets; | TRUNCATE | true |
DIFF00099999757 | general_code_change | JavaScript | users_974.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 |
DIFF00099999758 | orm_schema_change | Python | subscriptions_1.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='logs', name='order_id') | NONE | true |
DIFF00099999759 | raw_sql_destructive | SQL | notifications_194.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE reviews SET description = CONCAT(description, order_id); | UPDATE_CONCAT | true |
DIFF00099999760 | raw_sql_safe | SQL | reviews_203.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (amount, order_id) VALUES (%s, %s); | NONE | false |
DIFF00099999761 | test_suite_cleanup | SQL | test/subscriptions_483.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | false |
DIFF00099999762 | mentioned_in_comment | Python | customers_908.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE payments; -- now deprecated""" | DROP_TABLE | false |
DIFF00099999763 | test_suite_cleanup | SQL | mysql-test/suite/notifications_353.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM subscriptions; | DELETE_UNQUALIFIED | false |
DIFF00099999764 | mentioned_in_comment | Python | comments_277.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE reviews;") | TRUNCATE | false |
DIFF00099999765 | general_code_change | Go | subscriptions_15.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999766 | general_code_change | Java | comments_424.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999767 | orm_schema_change | Ruby | products_513.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :tickets, :score | NONE | true |
DIFF00099999768 | obfuscated_destructive | SQL | reviews_615.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE users DROP COLUMN order_id; | DROP_COLUMN | true |
DIFF00099999769 | test_suite_cleanup | SQL | mysql-test/suite/customers_429.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE sessions SET metadata = CONCAT(metadata, role); | UPDATE_CONCAT | false |
DIFF00099999770 | general_code_change | TypeScript | accounts_817.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 |
DIFF00099999771 | raw_sql_safe | SQL | notifications_2.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM orders WHERE is_active = 'active'; | NONE | false |
DIFF00099999772 | general_code_change | JavaScript | customers_868.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999773 | orm_schema_change | JavaScript | comments_315.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'is_active') | NONE | true |
DIFF00099999774 | general_code_change | Ruby | users_83.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999775 | general_code_change | Go | tickets_509.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999776 | general_code_change | Python | comments_883.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999777 | raw_sql_safe | SQL | refunds_100.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE sessions SET amount = %s WHERE order_id = %s; | NONE | false |
DIFF00099999778 | raw_sql_safe | SQL | users_556.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE orders ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099999779 | raw_sql_destructive | SQL | users_923.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN priority TO full_name; | ALTER_RENAME | true |
DIFF00099999780 | general_code_change | Python | notifications_942.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999781 | general_code_change | Python | comments_355.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099999782 | raw_sql_destructive | SQL | refunds_197.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE products RENAME COLUMN phone TO full_name; | ALTER_RENAME | true |
DIFF00099999783 | test_suite_cleanup | SQL | spec/invoices_547.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN updated_at; | DROP_COLUMN | false |
DIFF00099999784 | general_code_change | Ruby | inventory_177.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999785 | raw_sql_safe | SQL | accounts_950.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM tickets WHERE order_id = 'active'; | NONE | false |
DIFF00099999786 | raw_sql_destructive | SQL | invoices_500.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | true |
DIFF00099999787 | obfuscated_destructive | SQL | subscriptions_716.sql | schema cleanup | @@ -1,3 +1,3 @@
+dRop tAbLE prOdUCtS; | DROP_TABLE | true |
DIFF00099999788 | obfuscated_destructive | SQL | logs_294.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROp taBle CoMMents; | DROP_TABLE | true |
DIFF00099999789 | raw_sql_safe | SQL | logs_326.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099999790 | raw_sql_safe | SQL | customers_382.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE customers ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00099999791 | orm_schema_change | JavaScript | subscriptions_332.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('logs', 'metadata') | NONE | true |
DIFF00099999792 | general_code_change | TypeScript | employees_141.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 |
DIFF00099999793 | general_code_change | JavaScript | accounts_663.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 |
DIFF00099999794 | general_code_change | Ruby | refunds_171.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999795 | orm_schema_change | Python | refunds_72.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='orders', name='quantity') | NONE | true |
DIFF00099999796 | test_suite_cleanup | SQL | mysql-test/suite/users_655.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE accounts SET category = CONCAT(category, score); | UPDATE_CONCAT | false |
DIFF00099999797 | raw_sql_safe | SQL | logs_252.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET price = %s WHERE balance = %s; | NONE | false |
DIFF00099999798 | raw_sql_destructive | SQL | orders_818.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE accounts; | TRUNCATE | true |
DIFF00099999799 | raw_sql_destructive | SQL | orders_746.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE tickets; | DROP_TABLE | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.