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 |
|---|---|---|---|---|---|---|---|
DIFF00099995000 | raw_sql_destructive | SQL | transactions_960.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE accounts RENAME COLUMN description TO amount_cents; | ALTER_RENAME | true |
DIFF00099995001 | mentioned_in_comment | Python | subscriptions_838.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM transactions;") | DELETE_UNQUALIFIED | false |
DIFF00099995002 | general_code_change | JavaScript | customers_584.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 |
DIFF00099995003 | general_code_change | Go | subscriptions_871.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995004 | raw_sql_safe | SQL | employees_525.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE products SET order_id = %s WHERE description = %s; | NONE | false |
DIFF00099995005 | general_code_change | JavaScript | tickets_915.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099995006 | general_code_change | Python | reviews_469.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995007 | raw_sql_safe | SQL | subscriptions_45.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE employees ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099995008 | raw_sql_safe | SQL | accounts_669.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE accounts SET phone = %s WHERE user_id = %s; | NONE | false |
DIFF00099995009 | obfuscated_destructive | SQL | products_708.sql | schema cleanup | @@ -1,3 +1,3 @@
+dELEte frOm CusTOmERs; | DELETE_UNQUALIFIED | true |
DIFF00099995010 | raw_sql_destructive | SQL | logs_864.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | true |
DIFF00099995011 | raw_sql_destructive | SQL | logs_195.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN created_at; | DROP_COLUMN | true |
DIFF00099995012 | raw_sql_safe | SQL | accounts_128.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE score = 'active'; | NONE | false |
DIFF00099995013 | raw_sql_destructive | SQL | shipments_365.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE payments DROP COLUMN updated_at; | DROP_COLUMN | true |
DIFF00099995014 | test_suite_cleanup | SQL | test/events_72.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE accounts DROP COLUMN role; | DROP_COLUMN | false |
DIFF00099995015 | raw_sql_destructive | SQL | refunds_190.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE accounts; | DROP_TABLE | true |
DIFF00099995016 | orm_schema_change | JavaScript | inventory_307.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('invoices', 'priority') | NONE | true |
DIFF00099995017 | test_suite_cleanup | SQL | test/notifications_185.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE payments RENAME COLUMN email TO full_name; | ALTER_RENAME | false |
DIFF00099995018 | raw_sql_destructive | SQL | payments_846.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE events SET amount = CONCAT(amount, priority); | UPDATE_CONCAT | true |
DIFF00099995019 | general_code_change | TypeScript | refunds_108.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 |
DIFF00099995020 | raw_sql_destructive | SQL | users_822.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00099995021 | test_suite_cleanup | SQL | spec/customers_830.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN metadata TO contact_email; | ALTER_RENAME | false |
DIFF00099995022 | general_code_change | Java | customers_744.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099995023 | general_code_change | Python | users_83.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995024 | test_suite_cleanup | SQL | mysql-test/suite/reviews_315.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | false |
DIFF00099995025 | raw_sql_safe | SQL | employees_14.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (status, address) VALUES (%s, %s); | NONE | false |
DIFF00099995026 | general_code_change | Go | employees_816.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995027 | obfuscated_destructive | SQL | subscriptions_3.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table reviews; | DROP_TABLE | true |
DIFF00099995028 | raw_sql_destructive | SQL | reviews_805.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET status = CONCAT(status, metadata); | UPDATE_CONCAT | true |
DIFF00099995029 | orm_schema_change | JavaScript | inventory_470.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('subscriptions', table => table.dropColumn('user_id')) | NONE | true |
DIFF00099995030 | obfuscated_destructive | SQL | transactions_421.sql | schema cleanup | @@ -1,3 +1,3 @@
+DelETe From USerS; | DELETE_UNQUALIFIED | true |
DIFF00099995031 | test_suite_cleanup | SQL | tests/accounts_228.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE accounts; | TRUNCATE | false |
DIFF00099995032 | mentioned_in_comment | Python | refunds_560.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE shipments SET created_at = CONCAT(created_at, description); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099995033 | obfuscated_destructive | SQL | tickets_846.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
logs
DROP
COLUMN
quantity; | DROP_COLUMN | true |
DIFF00099995034 | mentioned_in_comment | Python | tickets_52.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE accounts SET category = CONCAT(category, phone);") | UPDATE_CONCAT | false |
DIFF00099995035 | raw_sql_safe | SQL | transactions_41.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE events ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00099995036 | general_code_change | Python | customers_975.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995037 | general_code_change | Go | comments_810.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995038 | mentioned_in_comment | Python | refunds_394.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE customers DROP COLUMN order_id;' manually, handled by migration tool | DROP_COLUMN | false |
DIFF00099995039 | raw_sql_destructive | SQL | payments_662.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE shipments SET user_id = CONCAT(user_id, score); | UPDATE_CONCAT | true |
DIFF00099995040 | general_code_change | Ruby | shipments_796.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995041 | raw_sql_safe | SQL | refunds_694.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE inventory ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00099995042 | raw_sql_safe | SQL | customers_882.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_sessions_metadata ON sessions (phone); | NONE | false |
DIFF00099995043 | orm_schema_change | JavaScript | employees_24.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'priority') | NONE | true |
DIFF00099995044 | general_code_change | Python | sessions_729.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099995045 | orm_schema_change | Ruby | orders_531.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :transactions, :category | NONE | true |
DIFF00099995046 | orm_schema_change | Ruby | shipments_424.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :employees, :is_active | NONE | true |
DIFF00099995047 | raw_sql_safe | SQL | tickets_879.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE notifications ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00099995048 | test_suite_cleanup | SQL | test/transactions_997.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE reviews SET description = CONCAT(description, balance); | UPDATE_CONCAT | false |
DIFF00099995049 | mentioned_in_comment | Python | users_369.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE payments;") | DROP_TABLE | false |
DIFF00099995050 | obfuscated_destructive | SQL | transactions_268.sql | schema cleanup | @@ -1,3 +1,3 @@
+DelEtE fROm nOTifIcATioNS; | DELETE_UNQUALIFIED | true |
DIFF00099995051 | raw_sql_destructive | SQL | tickets_412.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN priority TO user_role; | ALTER_RENAME | true |
DIFF00099995052 | general_code_change | Go | employees_82.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995053 | orm_schema_change | TypeScript | sessions_715.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Orders { // removed field: phone } | NONE | true |
DIFF00099995054 | general_code_change | Go | shipments_111.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995055 | test_suite_cleanup | SQL | tests/invoices_444.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE users; | DROP_TABLE | false |
DIFF00099995056 | raw_sql_destructive | SQL | subscriptions_892.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE sessions DROP COLUMN created_at; | DROP_COLUMN | true |
DIFF00099995057 | raw_sql_safe | SQL | payments_590.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO products (price, description) VALUES (%s, %s); | NONE | false |
DIFF00099995058 | raw_sql_destructive | SQL | accounts_213.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE users SET score = CONCAT(score, status); | UPDATE_CONCAT | true |
DIFF00099995059 | orm_schema_change | Python | customers_437.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='customers', name='role') | NONE | true |
DIFF00099995060 | test_suite_cleanup | SQL | test/notifications_238.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM comments; | DELETE_UNQUALIFIED | false |
DIFF00099995061 | general_code_change | Python | employees_673.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995062 | general_code_change | Ruby | logs_630.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995063 | orm_schema_change | Python | events_166.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='logs', name='phone') | NONE | true |
DIFF00099995064 | general_code_change | TypeScript | subscriptions_787.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 |
DIFF00099995065 | orm_schema_change | TypeScript | shipments_342.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Tickets { // removed field: role } | NONE | true |
DIFF00099995066 | orm_schema_change | JavaScript | products_388.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('subscriptions', 'quantity') | NONE | true |
DIFF00099995067 | mentioned_in_comment | Python | events_577.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE refunds;") | DROP_TABLE | false |
DIFF00099995068 | raw_sql_destructive | SQL | transactions_647.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | true |
DIFF00099995069 | orm_schema_change | JavaScript | products_907.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('events', table => table.dropColumn('created_at')) | NONE | true |
DIFF00099995070 | raw_sql_safe | SQL | refunds_170.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE notifications ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00099995071 | test_suite_cleanup | SQL | test/notifications_9.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE transactions; | DROP_TABLE | false |
DIFF00099995072 | general_code_change | Python | accounts_856.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995073 | raw_sql_destructive | SQL | orders_939.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00099995074 | test_suite_cleanup | SQL | test/employees_533.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE products RENAME COLUMN email TO user_role; | ALTER_RENAME | false |
DIFF00099995075 | general_code_change | TypeScript | customers_694.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 |
DIFF00099995076 | raw_sql_destructive | SQL | inventory_137.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders DROP COLUMN role; | DROP_COLUMN | true |
DIFF00099995077 | orm_schema_change | Ruby | products_90.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :customers, :created_at | NONE | true |
DIFF00099995078 | general_code_change | JavaScript | comments_966.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 |
DIFF00099995079 | test_suite_cleanup | SQL | mysql-test/suite/tickets_370.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE inventory DROP COLUMN priority; | DROP_COLUMN | false |
DIFF00099995080 | raw_sql_safe | SQL | customers_216.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_customers_quantity ON customers (address); | NONE | false |
DIFF00099995081 | test_suite_cleanup | SQL | spec/sessions_265.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM subscriptions; | DELETE_UNQUALIFIED | false |
DIFF00099995082 | raw_sql_safe | SQL | reviews_476.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE payments SET address = %s WHERE order_id = %s; | NONE | false |
DIFF00099995083 | orm_schema_change | JavaScript | subscriptions_561.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('status')) | NONE | true |
DIFF00099995084 | test_suite_cleanup | SQL | tests/shipments_92.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events RENAME COLUMN updated_at TO amount_cents; | ALTER_RENAME | false |
DIFF00099995085 | general_code_change | Ruby | employees_530.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995086 | raw_sql_safe | SQL | refunds_311.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET name = %s WHERE user_id = %s; | NONE | false |
DIFF00099995087 | test_suite_cleanup | SQL | test/tickets_459.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | false |
DIFF00099995088 | general_code_change | Python | transactions_976.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099995089 | raw_sql_safe | SQL | logs_525.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE comments SET metadata = %s WHERE price = %s; | NONE | false |
DIFF00099995090 | orm_schema_change | JavaScript | notifications_64.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('products', 'metadata') | NONE | true |
DIFF00099995091 | test_suite_cleanup | SQL | mysql-test/suite/subscriptions_950.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE sessions RENAME COLUMN status TO state; | ALTER_RENAME | false |
DIFF00099995092 | obfuscated_destructive | SQL | orders_548.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE
TABLE
users; | TRUNCATE | true |
DIFF00099995093 | raw_sql_safe | SQL | subscriptions_210.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE products SET role = %s WHERE role = %s; | NONE | false |
DIFF00099995094 | mentioned_in_comment | Python | orders_471.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE events DROP COLUMN description;' manually, handled by migration tool | DROP_COLUMN | false |
DIFF00099995095 | test_suite_cleanup | SQL | tests/logs_602.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE shipments; | TRUNCATE | false |
DIFF00099995096 | test_suite_cleanup | SQL | tests/reviews_468.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE payments SET user_id = CONCAT(user_id, score); | UPDATE_CONCAT | false |
DIFF00099995097 | general_code_change | Python | events_762.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099995098 | obfuscated_destructive | SQL | transactions_180.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
subscriptions
RENAME
COLUMN
amount
TO
amount_cents; | ALTER_RENAME | true |
DIFF00099995099 | general_code_change | Ruby | transactions_429.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.