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 |
|---|---|---|---|---|---|---|---|
DIFF00099995400 | orm_schema_change | TypeScript | products_6.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Products { // removed field: quantity } | NONE | true |
DIFF00099995401 | general_code_change | Python | sessions_676.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099995402 | raw_sql_destructive | SQL | sessions_804.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | true |
DIFF00099995403 | obfuscated_destructive | SQL | sessions_837.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTer tabLE EVeNTs DROp coLuMn phONE; | DROP_COLUMN | true |
DIFF00099995404 | test_suite_cleanup | SQL | mysql-test/suite/comments_151.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE sessions; | DROP_TABLE | false |
DIFF00099995405 | obfuscated_destructive | SQL | events_285.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
users
DROP
COLUMN
address; | DROP_COLUMN | true |
DIFF00099995406 | obfuscated_destructive | SQL | sessions_960.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from employees; | DELETE_UNQUALIFIED | true |
DIFF00099995407 | raw_sql_safe | SQL | events_893.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE shipments ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00099995408 | general_code_change | Java | orders_171.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099995409 | general_code_change | Python | payments_264.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995410 | raw_sql_destructive | SQL | refunds_808.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM subscriptions; | DELETE_UNQUALIFIED | true |
DIFF00099995411 | raw_sql_destructive | SQL | events_643.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET metadata = CONCAT(metadata, metadata); | UPDATE_CONCAT | true |
DIFF00099995412 | obfuscated_destructive | SQL | tickets_265.sql | schema cleanup | @@ -1,3 +1,3 @@
+TruNCATe TaBlE orDerS; | TRUNCATE | true |
DIFF00099995413 | obfuscated_destructive | SQL | products_623.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table orders rename column priority to state; | ALTER_RENAME | true |
DIFF00099995414 | orm_schema_change | JavaScript | employees_724.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('customers', 'user_id') | NONE | true |
DIFF00099995415 | test_suite_cleanup | SQL | tests/transactions_154.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | false |
DIFF00099995416 | raw_sql_safe | SQL | subscriptions_972.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO payments (order_id, category) VALUES (%s, %s); | NONE | false |
DIFF00099995417 | raw_sql_destructive | SQL | payments_972.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE comments; | TRUNCATE | true |
DIFF00099995418 | mentioned_in_comment | Python | employees_179.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE events; -- now deprecated""" | TRUNCATE | false |
DIFF00099995419 | test_suite_cleanup | SQL | spec/payments_197.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE notifications; | DROP_TABLE | false |
DIFF00099995420 | raw_sql_safe | SQL | notifications_322.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_inventory_category ON inventory (order_id); | NONE | false |
DIFF00099995421 | raw_sql_destructive | SQL | orders_217.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE sessions SET quantity = CONCAT(quantity, description); | UPDATE_CONCAT | true |
DIFF00099995422 | test_suite_cleanup | SQL | spec/products_538.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN balance TO state; | ALTER_RENAME | false |
DIFF00099995423 | general_code_change | TypeScript | transactions_984.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 |
DIFF00099995424 | test_suite_cleanup | SQL | tests/comments_856.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE accounts; | TRUNCATE | false |
DIFF00099995425 | test_suite_cleanup | SQL | tests/logs_859.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE employees; | DROP_TABLE | false |
DIFF00099995426 | general_code_change | Ruby | refunds_207.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995427 | raw_sql_safe | SQL | invoices_186.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099995428 | raw_sql_destructive | SQL | reviews_601.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE accounts RENAME COLUMN user_id TO contact_email; | ALTER_RENAME | true |
DIFF00099995429 | general_code_change | JavaScript | subscriptions_122.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099995430 | mentioned_in_comment | Python | invoices_857.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE customers;") | TRUNCATE | false |
DIFF00099995431 | raw_sql_safe | SQL | events_119.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE shipments SET description = %s WHERE created_at = %s; | NONE | false |
DIFF00099995432 | orm_schema_change | JavaScript | events_784.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'description') | NONE | true |
DIFF00099995433 | general_code_change | Go | payments_435.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995434 | test_suite_cleanup | SQL | mysql-test/suite/shipments_950.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | false |
DIFF00099995435 | orm_schema_change | Python | sessions_221.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='role') | NONE | true |
DIFF00099995436 | orm_schema_change | Ruby | orders_659.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :payments, :is_active | NONE | true |
DIFF00099995437 | mentioned_in_comment | Python | comments_407.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE subscriptions;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00099995438 | general_code_change | Ruby | transactions_216.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995439 | raw_sql_destructive | SQL | shipments_367.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE products; | DROP_TABLE | true |
DIFF00099995440 | raw_sql_safe | SQL | payments_32.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE reviews SET price = %s WHERE address = %s; | NONE | false |
DIFF00099995441 | orm_schema_change | Ruby | payments_689.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :events, :score | NONE | true |
DIFF00099995442 | general_code_change | TypeScript | transactions_20.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 |
DIFF00099995443 | raw_sql_destructive | SQL | notifications_570.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions RENAME COLUMN description TO full_name; | ALTER_RENAME | true |
DIFF00099995444 | general_code_change | TypeScript | transactions_653.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 |
DIFF00099995445 | general_code_change | Python | orders_784.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099995446 | general_code_change | TypeScript | payments_567.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 |
DIFF00099995447 | raw_sql_destructive | SQL | logs_639.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE accounts RENAME COLUMN name TO user_role; | ALTER_RENAME | true |
DIFF00099995448 | orm_schema_change | TypeScript | shipments_417.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Payments { // removed field: created_at } | NONE | true |
DIFF00099995449 | obfuscated_destructive | SQL | events_443.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP
TABLE
subscriptions; | DROP_TABLE | true |
DIFF00099995450 | raw_sql_safe | SQL | products_233.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE refunds ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099995451 | raw_sql_safe | SQL | sessions_762.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE user_id = 'active'; | NONE | false |
DIFF00099995452 | general_code_change | JavaScript | refunds_377.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 |
DIFF00099995453 | raw_sql_destructive | SQL | sessions_957.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | true |
DIFF00099995454 | raw_sql_destructive | SQL | comments_332.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users RENAME COLUMN balance TO contact_email; | ALTER_RENAME | true |
DIFF00099995455 | raw_sql_safe | SQL | reviews_770.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE tickets ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099995456 | general_code_change | Python | transactions_380.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995457 | raw_sql_safe | SQL | shipments_685.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_score ON products (user_id); | NONE | false |
DIFF00099995458 | general_code_change | Python | reviews_408.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995459 | obfuscated_destructive | SQL | tickets_321.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table notifications drop column updated_at; | DROP_COLUMN | true |
DIFF00099995460 | obfuscated_destructive | SQL | customers_543.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
comments
DROP
COLUMN
phone; | DROP_COLUMN | true |
DIFF00099995461 | general_code_change | Ruby | subscriptions_345.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099995462 | mentioned_in_comment | Python | employees_602.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM sessions;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00099995463 | mentioned_in_comment | Python | invoices_501.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE reviews RENAME COLUMN category TO amount_cents;") | ALTER_RENAME | false |
DIFF00099995464 | raw_sql_safe | SQL | shipments_254.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO sessions (score, metadata) VALUES (%s, %s); | NONE | false |
DIFF00099995465 | raw_sql_safe | SQL | products_350.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_comments_created_at ON comments (score); | NONE | false |
DIFF00099995466 | general_code_change | Java | comments_12.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099995467 | raw_sql_destructive | SQL | customers_518.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE users SET user_id = CONCAT(user_id, created_at); | UPDATE_CONCAT | true |
DIFF00099995468 | mentioned_in_comment | Python | inventory_682.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE orders DROP COLUMN user_id;") | DROP_COLUMN | false |
DIFF00099995469 | raw_sql_safe | SQL | shipments_668.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE comments SET status = %s WHERE score = %s; | NONE | false |
DIFF00099995470 | orm_schema_change | Python | employees_684.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='inventory', name='user_id') | NONE | true |
DIFF00099995471 | raw_sql_destructive | SQL | events_813.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE events; | TRUNCATE | true |
DIFF00099995472 | raw_sql_destructive | SQL | refunds_43.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE comments RENAME COLUMN score TO contact_email; | ALTER_RENAME | true |
DIFF00099995473 | raw_sql_destructive | SQL | orders_412.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE customers SET category = CONCAT(category, user_id); | UPDATE_CONCAT | true |
DIFF00099995474 | obfuscated_destructive | SQL | tickets_497.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00099995475 | general_code_change | JavaScript | orders_515.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 |
DIFF00099995476 | raw_sql_destructive | SQL | reviews_639.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE tickets; | DROP_TABLE | true |
DIFF00099995477 | general_code_change | Go | sessions_333.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099995478 | orm_schema_change | JavaScript | tickets_807.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('comments', table => table.dropColumn('description')) | NONE | true |
DIFF00099995479 | test_suite_cleanup | SQL | spec/users_122.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE shipments DROP COLUMN balance; | DROP_COLUMN | false |
DIFF00099995480 | test_suite_cleanup | SQL | tests/reviews_913.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE tickets SET role = CONCAT(role, name); | UPDATE_CONCAT | false |
DIFF00099995481 | mentioned_in_comment | Python | users_806.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE orders DROP COLUMN email; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099995482 | obfuscated_destructive | SQL | invoices_268.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP
TABLE
tickets; | DROP_TABLE | true |
DIFF00099995483 | raw_sql_safe | SQL | customers_883.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_order_id ON products (score); | NONE | false |
DIFF00099995484 | obfuscated_destructive | SQL | logs_829.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
employees; | DELETE_UNQUALIFIED | true |
DIFF00099995485 | obfuscated_destructive | SQL | products_717.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table customers drop column priority; | DROP_COLUMN | true |
DIFF00099995486 | general_code_change | JavaScript | tickets_26.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 |
DIFF00099995487 | orm_schema_change | JavaScript | users_249.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'priority') | NONE | true |
DIFF00099995488 | raw_sql_destructive | SQL | transactions_964.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE events; | DROP_TABLE | true |
DIFF00099995489 | mentioned_in_comment | Python | invoices_688.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE logs DROP COLUMN name; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099995490 | general_code_change | Java | products_260.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099995491 | mentioned_in_comment | Python | comments_262.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE comments DROP COLUMN amount;' manually, handled by migration tool | DROP_COLUMN | false |
DIFF00099995492 | general_code_change | TypeScript | orders_742.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 |
DIFF00099995493 | mentioned_in_comment | Python | reviews_562.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE sessions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099995494 | orm_schema_change | TypeScript | events_146.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Notifications { // removed field: email } | NONE | true |
DIFF00099995495 | general_code_change | Python | shipments_22.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099995496 | orm_schema_change | JavaScript | inventory_712.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('refunds', table => table.dropColumn('updated_at')) | NONE | true |
DIFF00099995497 | orm_schema_change | JavaScript | tickets_285.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('description')) | NONE | true |
DIFF00099995498 | raw_sql_safe | SQL | shipments_403.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM shipments WHERE created_at = 'active'; | NONE | false |
DIFF00099995499 | raw_sql_destructive | SQL | transactions_912.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE notifications; | TRUNCATE | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.