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 |
|---|---|---|---|---|---|---|---|
DIFF00000006900 | general_code_change | TypeScript | orders_201.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 |
DIFF00000006901 | orm_schema_change | JavaScript | users_802.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('notifications', 'created_at') | NONE | true |
DIFF00000006902 | general_code_change | JavaScript | sessions_483.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000006903 | raw_sql_safe | SQL | customers_112.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO products (amount, quantity) VALUES (%s, %s); | NONE | false |
DIFF00000006904 | orm_schema_change | Python | comments_47.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='comments', name='amount') | NONE | true |
DIFF00000006905 | raw_sql_safe | SQL | users_502.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO products (name, score) VALUES (%s, %s); | NONE | false |
DIFF00000006906 | raw_sql_destructive | SQL | reviews_801.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE transactions; | TRUNCATE | true |
DIFF00000006907 | general_code_change | JavaScript | sessions_815.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 |
DIFF00000006908 | general_code_change | Java | orders_457.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000006909 | raw_sql_destructive | SQL | refunds_611.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE notifications RENAME COLUMN amount TO contact_email; | ALTER_RENAME | true |
DIFF00000006910 | mentioned_in_comment | Python | orders_578.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM orders;") | DELETE_UNQUALIFIED | false |
DIFF00000006911 | raw_sql_destructive | SQL | subscriptions_441.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE employees SET quantity = CONCAT(quantity, phone); | UPDATE_CONCAT | true |
DIFF00000006912 | general_code_change | TypeScript | logs_989.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 |
DIFF00000006913 | raw_sql_destructive | SQL | invoices_135.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN role; | DROP_COLUMN | true |
DIFF00000006914 | obfuscated_destructive | SQL | comments_125.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTeR TaBLE logs DROp cOlumN USeR_Id; | DROP_COLUMN | true |
DIFF00000006915 | orm_schema_change | JavaScript | products_130.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('notifications', 'email') | NONE | true |
DIFF00000006916 | general_code_change | Python | orders_345.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000006917 | test_suite_cleanup | SQL | test/subscriptions_358.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | false |
DIFF00000006918 | mentioned_in_comment | Python | orders_672.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE sessions; -- now deprecated""" | TRUNCATE | false |
DIFF00000006919 | general_code_change | Python | comments_444.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000006920 | raw_sql_safe | SQL | accounts_419.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM employees WHERE is_active = 'active'; | NONE | false |
DIFF00000006921 | test_suite_cleanup | SQL | mysql-test/suite/inventory_309.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM events; | DELETE_UNQUALIFIED | false |
DIFF00000006922 | general_code_change | Python | sessions_721.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000006923 | raw_sql_safe | SQL | subscriptions_461.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM events WHERE amount = 'active'; | NONE | false |
DIFF00000006924 | raw_sql_destructive | SQL | customers_253.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE payments DROP COLUMN address; | DROP_COLUMN | true |
DIFF00000006925 | test_suite_cleanup | SQL | spec/events_105.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE events; | TRUNCATE | false |
DIFF00000006926 | general_code_change | Java | customers_864.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000006927 | obfuscated_destructive | SQL | logs_874.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table orders; | DROP_TABLE | true |
DIFF00000006928 | test_suite_cleanup | SQL | test/transactions_465.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE orders SET amount = CONCAT(amount, address); | UPDATE_CONCAT | false |
DIFF00000006929 | general_code_change | TypeScript | sessions_563.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 |
DIFF00000006930 | raw_sql_destructive | SQL | accounts_605.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE accounts SET name = CONCAT(name, user_id); | UPDATE_CONCAT | true |
DIFF00000006931 | raw_sql_safe | SQL | users_948.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_notifications_updated_at ON notifications (score); | NONE | false |
DIFF00000006932 | raw_sql_safe | SQL | refunds_741.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET score = %s WHERE amount = %s; | NONE | false |
DIFF00000006933 | obfuscated_destructive | SQL | products_986.sql | schema cleanup | @@ -1,3 +1,3 @@
+dElETE FROM PRoDUcTs; | DELETE_UNQUALIFIED | true |
DIFF00000006934 | orm_schema_change | Ruby | refunds_111.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :sessions, :updated_at | NONE | true |
DIFF00000006935 | orm_schema_change | JavaScript | orders_667.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'phone') | NONE | true |
DIFF00000006936 | general_code_change | Ruby | refunds_674.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000006937 | raw_sql_destructive | SQL | customers_54.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE inventory; | DROP_TABLE | true |
DIFF00000006938 | raw_sql_destructive | SQL | invoices_529.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE accounts; | TRUNCATE | true |
DIFF00000006939 | mentioned_in_comment | Python | tickets_50.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE payments;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00000006940 | raw_sql_safe | SQL | products_387.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM sessions WHERE role = 'active'; | NONE | false |
DIFF00000006941 | general_code_change | TypeScript | orders_221.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 |
DIFF00000006942 | general_code_change | Python | invoices_846.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000006943 | mentioned_in_comment | Python | notifications_974.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE events;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00000006944 | test_suite_cleanup | SQL | tests/subscriptions_837.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events DROP COLUMN description; | DROP_COLUMN | false |
DIFF00000006945 | general_code_change | Python | invoices_871.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000006946 | test_suite_cleanup | SQL | test/orders_838.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE inventory; | TRUNCATE | false |
DIFF00000006947 | general_code_change | JavaScript | employees_657.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 |
DIFF00000006948 | orm_schema_change | Python | events_144.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='events', name='category') | NONE | true |
DIFF00000006949 | raw_sql_safe | SQL | users_578.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE events ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00000006950 | obfuscated_destructive | SQL | subscriptions_616.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | true |
DIFF00000006951 | raw_sql_destructive | SQL | comments_752.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE comments; | TRUNCATE | true |
DIFF00000006952 | orm_schema_change | JavaScript | users_114.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('tickets', table => table.dropColumn('order_id')) | NONE | true |
DIFF00000006953 | raw_sql_destructive | SQL | comments_727.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users DROP COLUMN order_id; | DROP_COLUMN | true |
DIFF00000006954 | raw_sql_destructive | SQL | accounts_460.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN email; | DROP_COLUMN | true |
DIFF00000006955 | obfuscated_destructive | SQL | subscriptions_453.sql | schema cleanup | @@ -1,3 +1,3 @@
+alTer Table tIcKETs reName coLUMn emaIl tO USEr_RoLe; | ALTER_RENAME | true |
DIFF00000006956 | orm_schema_change | Python | comments_592.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='orders', name='order_id') | NONE | true |
DIFF00000006957 | orm_schema_change | Ruby | customers_371.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :tickets, :address | NONE | true |
DIFF00000006958 | mentioned_in_comment | Python | shipments_957.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE inventory SET metadata = CONCAT(metadata, email);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000006959 | orm_schema_change | Python | shipments_30.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='sessions', name='user_id') | NONE | true |
DIFF00000006960 | test_suite_cleanup | SQL | test/logs_749.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE events; | TRUNCATE | false |
DIFF00000006961 | general_code_change | JavaScript | users_418.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000006962 | test_suite_cleanup | SQL | mysql-test/suite/tickets_565.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE reviews; | DROP_TABLE | false |
DIFF00000006963 | mentioned_in_comment | Python | transactions_529.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE accounts SET address = CONCAT(address, status);") | UPDATE_CONCAT | false |
DIFF00000006964 | mentioned_in_comment | Python | inventory_63.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE tickets;' manually, handled by migration tool | TRUNCATE | false |
DIFF00000006965 | raw_sql_destructive | SQL | customers_97.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM products; | DELETE_UNQUALIFIED | true |
DIFF00000006966 | general_code_change | Ruby | logs_274.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000006967 | test_suite_cleanup | SQL | mysql-test/suite/inventory_636.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM invoices; | DELETE_UNQUALIFIED | false |
DIFF00000006968 | raw_sql_safe | SQL | orders_698.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_is_active ON transactions (balance); | NONE | false |
DIFF00000006969 | obfuscated_destructive | SQL | tickets_5.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
sessions; | DELETE_UNQUALIFIED | true |
DIFF00000006970 | raw_sql_safe | SQL | transactions_827.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM transactions WHERE metadata = 'active'; | NONE | false |
DIFF00000006971 | obfuscated_destructive | SQL | comments_875.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP TABLE comments; | DROP_TABLE | true |
DIFF00000006972 | raw_sql_safe | SQL | products_969.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO users (email, price) VALUES (%s, %s); | NONE | false |
DIFF00000006973 | general_code_change | JavaScript | notifications_375.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 |
DIFF00000006974 | general_code_change | Java | events_165.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000006975 | orm_schema_change | JavaScript | accounts_733.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('payments', table => table.dropColumn('role')) | NONE | true |
DIFF00000006976 | general_code_change | Python | tickets_158.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000006977 | general_code_change | TypeScript | customers_270.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 |
DIFF00000006978 | obfuscated_destructive | SQL | invoices_70.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00000006979 | general_code_change | Python | employees_183.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000006980 | orm_schema_change | JavaScript | tickets_328.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('phone')) | NONE | true |
DIFF00000006981 | general_code_change | Java | payments_512.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000006982 | raw_sql_safe | SQL | transactions_329.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM inventory WHERE created_at = 'active'; | NONE | false |
DIFF00000006983 | raw_sql_safe | SQL | tickets_675.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM comments WHERE name = 'active'; | NONE | false |
DIFF00000006984 | general_code_change | JavaScript | logs_869.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 |
DIFF00000006985 | mentioned_in_comment | Python | subscriptions_775.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE subscriptions DROP COLUMN balance;") | DROP_COLUMN | false |
DIFF00000006986 | test_suite_cleanup | SQL | mysql-test/suite/customers_659.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE customers; | TRUNCATE | false |
DIFF00000006987 | raw_sql_destructive | SQL | accounts_562.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews DROP COLUMN name; | DROP_COLUMN | true |
DIFF00000006988 | test_suite_cleanup | SQL | tests/reviews_403.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | false |
DIFF00000006989 | general_code_change | Ruby | accounts_200.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000006990 | mentioned_in_comment | Python | orders_360.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE notifications DROP COLUMN price;") | DROP_COLUMN | false |
DIFF00000006991 | mentioned_in_comment | Python | users_798.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE transactions DROP COLUMN description; -- now deprecated""" | DROP_COLUMN | false |
DIFF00000006992 | raw_sql_safe | SQL | transactions_496.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_category ON products (priority); | NONE | false |
DIFF00000006993 | orm_schema_change | Python | reviews_656.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='sessions', name='category') | NONE | true |
DIFF00000006994 | general_code_change | JavaScript | payments_601.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000006995 | obfuscated_destructive | SQL | customers_574.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE reviews SET role = CONCAT(role, email); | UPDATE_CONCAT | true |
DIFF00000006996 | orm_schema_change | Ruby | products_57.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :logs, :order_id | NONE | true |
DIFF00000006997 | general_code_change | Python | invoices_366.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000006998 | raw_sql_destructive | SQL | invoices_844.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00000006999 | general_code_change | TypeScript | transactions_772.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.