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 |
|---|---|---|---|---|---|---|---|
DIFF00000005200 | orm_schema_change | TypeScript | refunds_400.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Inventory { // removed field: created_at } | NONE | true |
DIFF00000005201 | orm_schema_change | JavaScript | inventory_532.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'status') | NONE | true |
DIFF00000005202 | raw_sql_safe | SQL | products_327.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE inventory SET quantity = %s WHERE phone = %s; | NONE | false |
DIFF00000005203 | raw_sql_safe | SQL | inventory_534.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE customers SET price = %s WHERE updated_at = %s; | NONE | false |
DIFF00000005204 | obfuscated_destructive | SQL | orders_909.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE shipments; | TRUNCATE | true |
DIFF00000005205 | orm_schema_change | JavaScript | subscriptions_991.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('comments', 'balance') | NONE | true |
DIFF00000005206 | general_code_change | Ruby | transactions_956.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000005207 | general_code_change | TypeScript | customers_976.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 |
DIFF00000005208 | obfuscated_destructive | SQL | reviews_753.sql | schema cleanup | @@ -1,3 +1,3 @@
+TrUncAtE tAblE shIPMENTS; | TRUNCATE | true |
DIFF00000005209 | general_code_change | JavaScript | comments_660.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000005210 | obfuscated_destructive | SQL | products_350.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00000005211 | obfuscated_destructive | SQL | customers_815.sql | schema cleanup | @@ -1,3 +1,3 @@
+AltER TABLe PAymenTS rEnAME ColUMn UsEr_id to usEr_ROlE; | ALTER_RENAME | true |
DIFF00000005212 | general_code_change | Python | inventory_554.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000005213 | general_code_change | JavaScript | inventory_537.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 |
DIFF00000005214 | orm_schema_change | Python | events_757.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='inventory', name='metadata') | NONE | true |
DIFF00000005215 | general_code_change | JavaScript | products_201.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 |
DIFF00000005216 | raw_sql_destructive | SQL | users_34.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE transactions; | DROP_TABLE | true |
DIFF00000005217 | mentioned_in_comment | Python | invoices_441.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE shipments SET status = CONCAT(status, user_id);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000005218 | general_code_change | Ruby | payments_513.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000005219 | general_code_change | Java | employees_985.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005220 | raw_sql_destructive | SQL | employees_515.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00000005221 | general_code_change | Go | sessions_118.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005222 | obfuscated_destructive | SQL | logs_265.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncaTe TaBLe cuSTOmERS; | TRUNCATE | true |
DIFF00000005223 | mentioned_in_comment | Python | payments_226.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM users;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00000005224 | raw_sql_destructive | SQL | shipments_63.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN quantity; | DROP_COLUMN | true |
DIFF00000005225 | mentioned_in_comment | Python | shipments_285.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DROP TABLE subscriptions; -- now deprecated""" | DROP_TABLE | false |
DIFF00000005226 | obfuscated_destructive | SQL | customers_774.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table refunds drop column phone; | DROP_COLUMN | true |
DIFF00000005227 | test_suite_cleanup | SQL | spec/invoices_904.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE sessions RENAME COLUMN updated_at TO contact_email; | ALTER_RENAME | false |
DIFF00000005228 | raw_sql_safe | SQL | products_49.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE sessions ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000005229 | obfuscated_destructive | SQL | transactions_191.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from employees; | DELETE_UNQUALIFIED | true |
DIFF00000005230 | test_suite_cleanup | SQL | mysql-test/suite/users_103.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM products; | DELETE_UNQUALIFIED | false |
DIFF00000005231 | mentioned_in_comment | Python | notifications_179.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE refunds SET description = CONCAT(description, phone);") | UPDATE_CONCAT | false |
DIFF00000005232 | general_code_change | JavaScript | customers_594.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000005233 | raw_sql_destructive | SQL | payments_892.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE notifications SET balance = CONCAT(balance, price); | UPDATE_CONCAT | true |
DIFF00000005234 | obfuscated_destructive | SQL | users_654.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table invoices; | TRUNCATE | true |
DIFF00000005235 | general_code_change | Python | users_558.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005236 | raw_sql_safe | SQL | tickets_607.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (quantity, category) VALUES (%s, %s); | NONE | false |
DIFF00000005237 | general_code_change | JavaScript | sessions_46.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000005238 | raw_sql_destructive | SQL | customers_665.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE employees RENAME COLUMN price TO amount_cents; | ALTER_RENAME | true |
DIFF00000005239 | general_code_change | JavaScript | products_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 |
DIFF00000005240 | orm_schema_change | JavaScript | events_515.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('payments', 'description') | NONE | true |
DIFF00000005241 | obfuscated_destructive | SQL | events_43.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
accounts; | DELETE_UNQUALIFIED | true |
DIFF00000005242 | raw_sql_safe | SQL | payments_688.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_description ON transactions (description); | NONE | false |
DIFF00000005243 | general_code_change | Python | sessions_836.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005244 | raw_sql_destructive | SQL | sessions_821.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE invoices SET phone = CONCAT(phone, role); | UPDATE_CONCAT | true |
DIFF00000005245 | raw_sql_safe | SQL | employees_342.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM sessions WHERE address = 'active'; | NONE | false |
DIFF00000005246 | raw_sql_destructive | SQL | comments_755.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE comments SET balance = CONCAT(balance, created_at); | UPDATE_CONCAT | true |
DIFF00000005247 | obfuscated_destructive | SQL | orders_79.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN balance; | DROP_COLUMN | true |
DIFF00000005248 | raw_sql_destructive | SQL | users_663.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE logs DROP COLUMN price; | DROP_COLUMN | true |
DIFF00000005249 | raw_sql_destructive | SQL | notifications_845.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00000005250 | raw_sql_safe | SQL | comments_505.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_employees_role ON employees (status); | NONE | false |
DIFF00000005251 | orm_schema_change | JavaScript | accounts_89.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('reviews', table => table.dropColumn('updated_at')) | NONE | true |
DIFF00000005252 | mentioned_in_comment | Python | shipments_16.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE orders DROP COLUMN is_active;") | DROP_COLUMN | false |
DIFF00000005253 | raw_sql_safe | SQL | customers_345.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE invoices SET score = %s WHERE user_id = %s; | NONE | false |
DIFF00000005254 | raw_sql_destructive | SQL | inventory_618.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE tickets RENAME COLUMN address TO state; | ALTER_RENAME | true |
DIFF00000005255 | test_suite_cleanup | SQL | test/employees_184.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN email; | DROP_COLUMN | false |
DIFF00000005256 | orm_schema_change | Ruby | logs_608.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :reviews, :updated_at | NONE | true |
DIFF00000005257 | raw_sql_destructive | SQL | sessions_656.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | true |
DIFF00000005258 | general_code_change | Java | sessions_23.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005259 | general_code_change | TypeScript | sessions_893.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 |
DIFF00000005260 | raw_sql_destructive | SQL | subscriptions_522.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM sessions; | DELETE_UNQUALIFIED | true |
DIFF00000005261 | obfuscated_destructive | SQL | products_598.sql | schema cleanup | @@ -1,3 +1,3 @@
+droP tAbLe ReVIeWS; | DROP_TABLE | true |
DIFF00000005262 | raw_sql_safe | SQL | sessions_515.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO tickets (status, is_active) VALUES (%s, %s); | NONE | false |
DIFF00000005263 | test_suite_cleanup | SQL | test/customers_689.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN created_at; | DROP_COLUMN | false |
DIFF00000005264 | orm_schema_change | JavaScript | refunds_285.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('score')) | NONE | true |
DIFF00000005265 | mentioned_in_comment | Python | sessions_785.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE notifications SET name = CONCAT(name, is_active); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00000005266 | raw_sql_safe | SQL | invoices_872.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE reviews SET description = %s WHERE balance = %s; | NONE | false |
DIFF00000005267 | test_suite_cleanup | SQL | mysql-test/suite/reviews_373.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE employees RENAME COLUMN score TO full_name; | ALTER_RENAME | false |
DIFF00000005268 | obfuscated_destructive | SQL | sessions_290.sql | schema cleanup | @@ -1,3 +1,3 @@
+update accounts set user_id = concat(user_id, is_active); | UPDATE_CONCAT | true |
DIFF00000005269 | raw_sql_destructive | SQL | events_628.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE payments; | TRUNCATE | true |
DIFF00000005270 | raw_sql_destructive | SQL | sessions_411.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE events SET balance = CONCAT(balance, status); | UPDATE_CONCAT | true |
DIFF00000005271 | general_code_change | Go | payments_455.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005272 | orm_schema_change | Ruby | shipments_986.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :orders, :order_id | NONE | true |
DIFF00000005273 | general_code_change | Java | sessions_177.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000005274 | general_code_change | Go | products_70.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000005275 | raw_sql_safe | SQL | customers_665.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_orders_email ON orders (status); | NONE | false |
DIFF00000005276 | obfuscated_destructive | SQL | orders_498.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table users; | TRUNCATE | true |
DIFF00000005277 | general_code_change | Python | users_852.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005278 | raw_sql_safe | SQL | products_69.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM orders WHERE quantity = 'active'; | NONE | false |
DIFF00000005279 | test_suite_cleanup | SQL | tests/accounts_934.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE notifications DROP COLUMN metadata; | DROP_COLUMN | false |
DIFF00000005280 | mentioned_in_comment | Python | orders_71.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE accounts;") | TRUNCATE | false |
DIFF00000005281 | test_suite_cleanup | SQL | mysql-test/suite/reviews_160.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE tickets SET description = CONCAT(description, is_active); | UPDATE_CONCAT | false |
DIFF00000005282 | raw_sql_safe | SQL | refunds_25.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_tickets_phone ON tickets (role); | NONE | false |
DIFF00000005283 | test_suite_cleanup | SQL | mysql-test/suite/reviews_585.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN price TO full_name; | ALTER_RENAME | false |
DIFF00000005284 | obfuscated_destructive | SQL | logs_712.sql | schema cleanup | @@ -1,3 +1,3 @@
+aLTeR tABle CommenTs drOp Column PHOne; | DROP_COLUMN | true |
DIFF00000005285 | orm_schema_change | Python | transactions_459.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='reviews', name='updated_at') | NONE | true |
DIFF00000005286 | orm_schema_change | TypeScript | employees_390.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Tickets { // removed field: score } | NONE | true |
DIFF00000005287 | raw_sql_destructive | SQL | reviews_914.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN description; | DROP_COLUMN | true |
DIFF00000005288 | general_code_change | Python | accounts_936.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000005289 | test_suite_cleanup | SQL | spec/tickets_204.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE accounts SET phone = CONCAT(phone, email); | UPDATE_CONCAT | false |
DIFF00000005290 | orm_schema_change | Ruby | tickets_39.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :refunds, :description | NONE | true |
DIFF00000005291 | raw_sql_safe | SQL | notifications_749.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET metadata = %s WHERE created_at = %s; | NONE | false |
DIFF00000005292 | raw_sql_safe | SQL | sessions_685.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_tickets_category ON tickets (email); | NONE | false |
DIFF00000005293 | test_suite_cleanup | SQL | mysql-test/suite/refunds_464.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE sessions RENAME COLUMN name TO user_role; | ALTER_RENAME | false |
DIFF00000005294 | general_code_change | JavaScript | inventory_976.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 |
DIFF00000005295 | general_code_change | Python | comments_26.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000005296 | test_suite_cleanup | SQL | tests/invoices_874.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE users; | DROP_TABLE | false |
DIFF00000005297 | orm_schema_change | TypeScript | events_279.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Transactions { // removed field: updated_at } | NONE | true |
DIFF00000005298 | raw_sql_destructive | SQL | invoices_275.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00000005299 | orm_schema_change | Ruby | products_747.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :invoices, :order_id | NONE | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.