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 |
|---|---|---|---|---|---|---|---|
DIFF00099998600 | raw_sql_safe | SQL | subscriptions_813.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM sessions WHERE quantity = 'active'; | NONE | false |
DIFF00099998601 | raw_sql_destructive | SQL | reviews_310.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN amount; | DROP_COLUMN | true |
DIFF00099998602 | raw_sql_safe | SQL | comments_65.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO comments (email, balance) VALUES (%s, %s); | NONE | false |
DIFF00099998603 | raw_sql_safe | SQL | employees_224.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO sessions (created_at, phone) VALUES (%s, %s); | NONE | false |
DIFF00099998604 | general_code_change | Python | customers_969.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998605 | orm_schema_change | TypeScript | users_943.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Customers { // removed field: user_id } | NONE | true |
DIFF00099998606 | general_code_change | Ruby | products_875.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998607 | raw_sql_safe | SQL | invoices_267.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE price = 'active'; | NONE | false |
DIFF00099998608 | raw_sql_safe | SQL | users_887.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE amount = 'active'; | NONE | false |
DIFF00099998609 | raw_sql_destructive | SQL | subscriptions_388.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE comments SET created_at = CONCAT(created_at, description); | UPDATE_CONCAT | true |
DIFF00099998610 | mentioned_in_comment | Python | logs_192.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE subscriptions SET priority = CONCAT(priority, address);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00099998611 | mentioned_in_comment | Python | invoices_235.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE inventory;") | TRUNCATE | false |
DIFF00099998612 | general_code_change | Python | tickets_552.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998613 | raw_sql_destructive | SQL | events_66.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00099998614 | raw_sql_destructive | SQL | sessions_868.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE notifications SET role = CONCAT(role, priority); | UPDATE_CONCAT | true |
DIFF00099998615 | raw_sql_safe | SQL | payments_327.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET order_id = %s WHERE price = %s; | NONE | false |
DIFF00099998616 | raw_sql_safe | SQL | accounts_108.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE metadata = 'active'; | NONE | false |
DIFF00099998617 | orm_schema_change | JavaScript | events_122.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('payments', table => table.dropColumn('metadata')) | NONE | true |
DIFF00099998618 | mentioned_in_comment | Python | invoices_897.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE sessions SET phone = CONCAT(phone, is_active);") | UPDATE_CONCAT | false |
DIFF00099998619 | mentioned_in_comment | Python | orders_351.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE tickets RENAME COLUMN role TO full_name;") | ALTER_RENAME | false |
DIFF00099998620 | mentioned_in_comment | Python | sessions_514.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE invoices RENAME COLUMN role TO amount_cents;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00099998621 | general_code_change | TypeScript | shipments_700.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 |
DIFF00099998622 | raw_sql_safe | SQL | customers_937.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE employees SET updated_at = %s WHERE balance = %s; | NONE | false |
DIFF00099998623 | general_code_change | Go | customers_469.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099998624 | general_code_change | JavaScript | logs_261.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 |
DIFF00099998625 | orm_schema_change | JavaScript | transactions_986.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('sessions', 'balance') | NONE | true |
DIFF00099998626 | general_code_change | JavaScript | subscriptions_487.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 |
DIFF00099998627 | raw_sql_safe | SQL | orders_734.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE refunds ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099998628 | test_suite_cleanup | SQL | spec/subscriptions_895.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE comments; | TRUNCATE | false |
DIFF00099998629 | general_code_change | JavaScript | comments_950.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998630 | raw_sql_destructive | SQL | refunds_915.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE events; | TRUNCATE | true |
DIFF00099998631 | general_code_change | Python | customers_2.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998632 | general_code_change | JavaScript | sessions_929.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 |
DIFF00099998633 | orm_schema_change | JavaScript | transactions_593.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('quantity')) | NONE | true |
DIFF00099998634 | raw_sql_destructive | SQL | inventory_691.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM invoices; | DELETE_UNQUALIFIED | true |
DIFF00099998635 | raw_sql_destructive | SQL | users_459.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users DROP COLUMN quantity; | DROP_COLUMN | true |
DIFF00099998636 | raw_sql_safe | SQL | tickets_36.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE invoices ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00099998637 | general_code_change | Go | employees_177.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099998638 | general_code_change | JavaScript | orders_935.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 |
DIFF00099998639 | general_code_change | JavaScript | tickets_637.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998640 | orm_schema_change | Python | refunds_210.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='tickets', name='description') | NONE | true |
DIFF00099998641 | obfuscated_destructive | SQL | refunds_513.sql | schema cleanup | @@ -1,3 +1,3 @@
+alTeR TAblE LOgS DROP COLUmn phoNe; | DROP_COLUMN | true |
DIFF00099998642 | raw_sql_safe | SQL | users_929.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_invoices_user_id ON invoices (role); | NONE | false |
DIFF00099998643 | orm_schema_change | Python | subscriptions_103.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='comments', name='status') | NONE | true |
DIFF00099998644 | general_code_change | Python | orders_259.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998645 | raw_sql_safe | SQL | logs_978.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM logs WHERE price = 'active'; | NONE | false |
DIFF00099998646 | obfuscated_destructive | SQL | customers_502.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE
customers
SET
updated_at
=
CONCAT(updated_at,
updated_at); | UPDATE_CONCAT | true |
DIFF00099998647 | mentioned_in_comment | Python | inventory_283.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE payments SET address = CONCAT(address, metadata);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00099998648 | orm_schema_change | Ruby | users_236.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :subscriptions, :description | NONE | true |
DIFF00099998649 | mentioned_in_comment | Python | subscriptions_987.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE customers SET phone = CONCAT(phone, name); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099998650 | raw_sql_destructive | SQL | reviews_372.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE customers; | DROP_TABLE | true |
DIFF00099998651 | orm_schema_change | JavaScript | notifications_722.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('employees', 'status') | NONE | true |
DIFF00099998652 | raw_sql_safe | SQL | notifications_867.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM accounts WHERE quantity = 'active'; | NONE | false |
DIFF00099998653 | general_code_change | Ruby | logs_385.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998654 | raw_sql_safe | SQL | orders_418.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE events SET metadata = %s WHERE role = %s; | NONE | false |
DIFF00099998655 | general_code_change | TypeScript | logs_912.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 |
DIFF00099998656 | raw_sql_safe | SQL | invoices_752.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE shipments SET amount = %s WHERE created_at = %s; | NONE | false |
DIFF00099998657 | raw_sql_safe | SQL | customers_125.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_payments_metadata ON payments (email); | NONE | false |
DIFF00099998658 | raw_sql_safe | SQL | comments_866.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_customers_score ON customers (category); | NONE | false |
DIFF00099998659 | test_suite_cleanup | SQL | tests/reviews_800.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM invoices; | DELETE_UNQUALIFIED | false |
DIFF00099998660 | orm_schema_change | Python | invoices_341.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='customers', name='category') | NONE | true |
DIFF00099998661 | obfuscated_destructive | SQL | refunds_820.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP TABLE users; | DROP_TABLE | true |
DIFF00099998662 | general_code_change | Java | events_447.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099998663 | orm_schema_change | Python | tickets_197.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='refunds', name='name') | NONE | true |
DIFF00099998664 | general_code_change | TypeScript | logs_781.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 |
DIFF00099998665 | general_code_change | JavaScript | reviews_407.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 |
DIFF00099998666 | obfuscated_destructive | SQL | orders_482.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from invoices; | DELETE_UNQUALIFIED | true |
DIFF00099998667 | raw_sql_safe | SQL | comments_825.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE address = 'active'; | NONE | false |
DIFF00099998668 | general_code_change | JavaScript | comments_651.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998669 | test_suite_cleanup | SQL | test/payments_728.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE employees SET updated_at = CONCAT(updated_at, user_id); | UPDATE_CONCAT | false |
DIFF00099998670 | general_code_change | JavaScript | sessions_192.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998671 | general_code_change | Go | shipments_661.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099998672 | raw_sql_safe | SQL | users_59.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE updated_at = 'active'; | NONE | false |
DIFF00099998673 | general_code_change | Python | transactions_238.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998674 | test_suite_cleanup | SQL | test/transactions_296.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE employees SET name = CONCAT(name, role); | UPDATE_CONCAT | false |
DIFF00099998675 | raw_sql_destructive | SQL | orders_995.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE notifications RENAME COLUMN created_at TO contact_email; | ALTER_RENAME | true |
DIFF00099998676 | raw_sql_safe | SQL | products_906.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE orders ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099998677 | mentioned_in_comment | Python | accounts_532.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE orders;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00099998678 | test_suite_cleanup | SQL | mysql-test/suite/products_941.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | false |
DIFF00099998679 | mentioned_in_comment | Python | products_224.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE comments; -- now deprecated""" | DROP_TABLE | false |
DIFF00099998680 | obfuscated_destructive | SQL | customers_965.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
employees
RENAME
COLUMN
role
TO
full_name; | ALTER_RENAME | true |
DIFF00099998681 | mentioned_in_comment | Python | products_192.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE payments;") | TRUNCATE | false |
DIFF00099998682 | mentioned_in_comment | Python | reviews_567.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE notifications RENAME COLUMN metadata TO full_name;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00099998683 | orm_schema_change | Ruby | refunds_699.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :events, :name | NONE | true |
DIFF00099998684 | orm_schema_change | Ruby | notifications_70.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :logs, :user_id | NONE | true |
DIFF00099998685 | raw_sql_safe | SQL | shipments_758.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM products WHERE email = 'active'; | NONE | false |
DIFF00099998686 | obfuscated_destructive | SQL | events_854.sql | schema cleanup | @@ -1,3 +1,3 @@
+delETe FRom InvOicEs; | DELETE_UNQUALIFIED | true |
DIFF00099998687 | general_code_change | JavaScript | notifications_901.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998688 | raw_sql_destructive | SQL | transactions_313.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN amount; | DROP_COLUMN | true |
DIFF00099998689 | orm_schema_change | Ruby | notifications_221.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :transactions, :role | NONE | true |
DIFF00099998690 | raw_sql_destructive | SQL | users_897.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00099998691 | test_suite_cleanup | SQL | test/invoices_522.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE logs SET quantity = CONCAT(quantity, user_id); | UPDATE_CONCAT | false |
DIFF00099998692 | orm_schema_change | JavaScript | products_83.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('employees', table => table.dropColumn('price')) | NONE | true |
DIFF00099998693 | general_code_change | Ruby | subscriptions_87.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998694 | raw_sql_destructive | SQL | inventory_198.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | true |
DIFF00099998695 | raw_sql_destructive | SQL | customers_685.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE accounts SET updated_at = CONCAT(updated_at, price); | UPDATE_CONCAT | true |
DIFF00099998696 | general_code_change | TypeScript | payments_444.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 |
DIFF00099998697 | raw_sql_safe | SQL | tickets_627.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_invoices_category ON invoices (email); | NONE | false |
DIFF00099998698 | general_code_change | Go | payments_41.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099998699 | general_code_change | Go | payments_831.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.