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 |
|---|---|---|---|---|---|---|---|
DIFF00000007600 | obfuscated_destructive | SQL | logs_262.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE shipments RENAME COLUMN amount TO contact_email; | ALTER_RENAME | true |
DIFF00000007601 | general_code_change | JavaScript | invoices_336.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000007602 | general_code_change | Python | employees_967.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000007603 | mentioned_in_comment | Python | logs_943.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM employees;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00000007604 | test_suite_cleanup | SQL | tests/tickets_741.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | false |
DIFF00000007605 | obfuscated_destructive | SQL | inventory_655.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
notifications; | DELETE_UNQUALIFIED | true |
DIFF00000007606 | orm_schema_change | JavaScript | logs_41.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('subscriptions', 'metadata') | NONE | true |
DIFF00000007607 | test_suite_cleanup | SQL | mysql-test/suite/customers_330.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN updated_at TO contact_email; | ALTER_RENAME | false |
DIFF00000007608 | raw_sql_safe | SQL | events_481.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE sessions ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000007609 | general_code_change | Python | employees_951.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000007610 | test_suite_cleanup | SQL | spec/logs_384.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | false |
DIFF00000007611 | raw_sql_destructive | SQL | shipments_540.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | true |
DIFF00000007612 | general_code_change | JavaScript | subscriptions_994.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 |
DIFF00000007613 | orm_schema_change | JavaScript | customers_356.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'quantity') | NONE | true |
DIFF00000007614 | orm_schema_change | JavaScript | subscriptions_137.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('inventory', 'user_id') | NONE | true |
DIFF00000007615 | general_code_change | Ruby | inventory_278.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000007616 | general_code_change | Python | reviews_211.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000007617 | raw_sql_safe | SQL | sessions_713.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE orders SET priority = %s WHERE category = %s; | NONE | false |
DIFF00000007618 | orm_schema_change | JavaScript | logs_763.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'price') | NONE | true |
DIFF00000007619 | raw_sql_destructive | SQL | payments_465.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE reviews; | DROP_TABLE | true |
DIFF00000007620 | raw_sql_destructive | SQL | users_66.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | true |
DIFF00000007621 | obfuscated_destructive | SQL | shipments_178.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE products SET created_at = CONCAT(created_at, phone); | UPDATE_CONCAT | true |
DIFF00000007622 | general_code_change | Go | orders_747.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007623 | test_suite_cleanup | SQL | tests/subscriptions_721.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE transactions; | DROP_TABLE | false |
DIFF00000007624 | test_suite_cleanup | SQL | test/transactions_423.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | false |
DIFF00000007625 | raw_sql_safe | SQL | customers_117.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE refunds ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000007626 | general_code_change | JavaScript | users_749.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000007627 | mentioned_in_comment | Python | invoices_905.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE shipments SET priority = CONCAT(priority, updated_at); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00000007628 | orm_schema_change | Ruby | logs_270.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :shipments, :order_id | NONE | true |
DIFF00000007629 | mentioned_in_comment | Python | invoices_358.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE events; -- now deprecated""" | DROP_TABLE | false |
DIFF00000007630 | obfuscated_destructive | SQL | accounts_19.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table users rename column score to state; | ALTER_RENAME | true |
DIFF00000007631 | general_code_change | JavaScript | payments_672.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 |
DIFF00000007632 | test_suite_cleanup | SQL | mysql-test/suite/payments_934.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE logs DROP COLUMN role; | DROP_COLUMN | false |
DIFF00000007633 | raw_sql_safe | SQL | users_624.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO events (is_active, name) VALUES (%s, %s); | NONE | false |
DIFF00000007634 | raw_sql_safe | SQL | products_728.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE reviews ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000007635 | raw_sql_safe | SQL | invoices_576.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE users ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00000007636 | general_code_change | JavaScript | logs_442.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000007637 | test_suite_cleanup | SQL | tests/products_996.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE payments; | TRUNCATE | false |
DIFF00000007638 | mentioned_in_comment | Python | products_298.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE reviews RENAME COLUMN email TO state;") | ALTER_RENAME | false |
DIFF00000007639 | orm_schema_change | Ruby | customers_146.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :events, :role | NONE | true |
DIFF00000007640 | test_suite_cleanup | SQL | tests/logs_471.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE invoices RENAME COLUMN price TO amount_cents; | ALTER_RENAME | false |
DIFF00000007641 | raw_sql_destructive | SQL | comments_191.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE sessions RENAME COLUMN price TO user_role; | ALTER_RENAME | true |
DIFF00000007642 | test_suite_cleanup | SQL | test/reviews_717.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE invoices; | DROP_TABLE | false |
DIFF00000007643 | general_code_change | Go | reviews_274.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007644 | general_code_change | Java | notifications_152.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000007645 | general_code_change | Go | notifications_585.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007646 | general_code_change | TypeScript | shipments_421.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 |
DIFF00000007647 | raw_sql_destructive | SQL | customers_84.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE tickets RENAME COLUMN category TO state; | ALTER_RENAME | true |
DIFF00000007648 | raw_sql_safe | SQL | refunds_796.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_shipments_is_active ON shipments (category); | NONE | false |
DIFF00000007649 | test_suite_cleanup | SQL | test/employees_673.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | false |
DIFF00000007650 | raw_sql_destructive | SQL | users_178.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE notifications; | DROP_TABLE | true |
DIFF00000007651 | general_code_change | Ruby | accounts_84.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000007652 | general_code_change | Go | sessions_573.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007653 | obfuscated_destructive | SQL | users_620.sql | schema cleanup | @@ -1,3 +1,3 @@
+AlTer tABle EmploYees DroP COluMN CateGOry; | DROP_COLUMN | true |
DIFF00000007654 | test_suite_cleanup | SQL | test/orders_27.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE shipments; | DROP_TABLE | false |
DIFF00000007655 | general_code_change | JavaScript | products_31.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000007656 | general_code_change | Python | reviews_583.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000007657 | raw_sql_destructive | SQL | products_581.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE users; | DROP_TABLE | true |
DIFF00000007658 | test_suite_cleanup | SQL | mysql-test/suite/tickets_650.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE payments RENAME COLUMN updated_at TO contact_email; | ALTER_RENAME | false |
DIFF00000007659 | general_code_change | Go | orders_736.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007660 | raw_sql_destructive | SQL | accounts_113.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET description = CONCAT(description, order_id); | UPDATE_CONCAT | true |
DIFF00000007661 | general_code_change | Java | comments_174.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000007662 | general_code_change | TypeScript | transactions_349.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 |
DIFF00000007663 | raw_sql_safe | SQL | sessions_453.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_reviews_amount ON reviews (created_at); | NONE | false |
DIFF00000007664 | orm_schema_change | JavaScript | sessions_270.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('role')) | NONE | true |
DIFF00000007665 | raw_sql_destructive | SQL | events_346.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE tickets DROP COLUMN balance; | DROP_COLUMN | true |
DIFF00000007666 | obfuscated_destructive | SQL | invoices_816.sql | schema cleanup | @@ -1,3 +1,3 @@
+AlTEr TaBLe TIckEtS reNaMe coLUmN UPdATED_at tO amOUnt_CentS; | ALTER_RENAME | true |
DIFF00000007667 | raw_sql_safe | SQL | notifications_979.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO orders (is_active, metadata) VALUES (%s, %s); | NONE | false |
DIFF00000007668 | orm_schema_change | Ruby | customers_560.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :orders, :status | NONE | true |
DIFF00000007669 | orm_schema_change | Ruby | payments_612.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :reviews, :order_id | NONE | true |
DIFF00000007670 | mentioned_in_comment | Python | refunds_652.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE reviews;") | DROP_TABLE | false |
DIFF00000007671 | general_code_change | Ruby | subscriptions_294.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000007672 | general_code_change | Python | inventory_754.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000007673 | raw_sql_safe | SQL | notifications_772.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_accounts_email ON accounts (created_at); | NONE | false |
DIFF00000007674 | obfuscated_destructive | SQL | orders_708.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN address TO contact_email; | ALTER_RENAME | true |
DIFF00000007675 | obfuscated_destructive | SQL | subscriptions_851.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP
TABLE
transactions; | DROP_TABLE | true |
DIFF00000007676 | general_code_change | Java | accounts_410.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000007677 | raw_sql_destructive | SQL | orders_717.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE customers; | TRUNCATE | true |
DIFF00000007678 | obfuscated_destructive | SQL | sessions_673.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table accounts drop column metadata; | DROP_COLUMN | true |
DIFF00000007679 | mentioned_in_comment | Python | payments_932.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE comments SET priority = CONCAT(priority, phone);") | UPDATE_CONCAT | false |
DIFF00000007680 | raw_sql_destructive | SQL | transactions_50.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM orders; | DELETE_UNQUALIFIED | true |
DIFF00000007681 | general_code_change | Python | users_305.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000007682 | general_code_change | Python | customers_707.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000007683 | raw_sql_safe | SQL | logs_892.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_price ON products (order_id); | NONE | false |
DIFF00000007684 | mentioned_in_comment | Python | customers_814.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE logs; -- now deprecated""" | DROP_TABLE | false |
DIFF00000007685 | test_suite_cleanup | SQL | mysql-test/suite/notifications_965.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE refunds SET is_active = CONCAT(is_active, quantity); | UPDATE_CONCAT | false |
DIFF00000007686 | general_code_change | Go | customers_554.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000007687 | orm_schema_change | JavaScript | inventory_509.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('reviews', 'created_at') | NONE | true |
DIFF00000007688 | general_code_change | Java | inventory_466.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000007689 | raw_sql_destructive | SQL | employees_398.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE events RENAME COLUMN price TO contact_email; | ALTER_RENAME | true |
DIFF00000007690 | raw_sql_safe | SQL | comments_253.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_invoices_metadata ON invoices (created_at); | NONE | false |
DIFF00000007691 | obfuscated_destructive | SQL | orders_230.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table sessions; | DROP_TABLE | true |
DIFF00000007692 | raw_sql_safe | SQL | inventory_691.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (priority, balance) VALUES (%s, %s); | NONE | false |
DIFF00000007693 | raw_sql_destructive | SQL | inventory_708.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE inventory SET user_id = CONCAT(user_id, created_at); | UPDATE_CONCAT | true |
DIFF00000007694 | orm_schema_change | Ruby | notifications_486.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :users, :order_id | NONE | true |
DIFF00000007695 | general_code_change | Ruby | events_357.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000007696 | orm_schema_change | JavaScript | reviews_610.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('accounts', 'status') | NONE | true |
DIFF00000007697 | general_code_change | Python | events_134.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000007698 | obfuscated_destructive | SQL | payments_697.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
users
SET
amount
=
CONCAT(amount,
name); | UPDATE_CONCAT | true |
DIFF00000007699 | raw_sql_safe | SQL | refunds_670.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM accounts WHERE quantity = 'active'; | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.