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 |
|---|---|---|---|---|---|---|---|
DIFF00099999200 | raw_sql_safe | SQL | inventory_374.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO customers (description, price) VALUES (%s, %s); | NONE | false |
DIFF00099999201 | general_code_change | Ruby | refunds_869.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999202 | raw_sql_safe | SQL | users_964.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE users SET updated_at = %s WHERE phone = %s; | NONE | false |
DIFF00099999203 | general_code_change | Java | shipments_557.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999204 | obfuscated_destructive | SQL | comments_954.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDATE inventory SET phone = CONCAT(phone, description); | UPDATE_CONCAT | true |
DIFF00099999205 | raw_sql_safe | SQL | reviews_427.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE inventory ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099999206 | mentioned_in_comment | Python | orders_365.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE comments DROP COLUMN quantity;") | DROP_COLUMN | false |
DIFF00099999207 | orm_schema_change | JavaScript | refunds_625.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('payments', 'is_active') | NONE | true |
DIFF00099999208 | raw_sql_destructive | SQL | payments_95.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | true |
DIFF00099999209 | mentioned_in_comment | Python | comments_997.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE employees;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099999210 | test_suite_cleanup | SQL | tests/refunds_129.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | false |
DIFF00099999211 | orm_schema_change | JavaScript | sessions_504.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('notifications', 'role') | NONE | true |
DIFF00099999212 | general_code_change | JavaScript | sessions_861.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999213 | general_code_change | TypeScript | customers_612.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 |
DIFF00099999214 | general_code_change | JavaScript | products_394.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999215 | raw_sql_safe | SQL | users_776.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE customers SET role = %s WHERE updated_at = %s; | NONE | false |
DIFF00099999216 | general_code_change | Python | refunds_631.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099999217 | obfuscated_destructive | SQL | logs_954.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop table transactions; | DROP_TABLE | true |
DIFF00099999218 | raw_sql_safe | SQL | subscriptions_821.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE status = 'active'; | NONE | false |
DIFF00099999219 | raw_sql_destructive | SQL | users_690.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users DROP COLUMN description; | DROP_COLUMN | true |
DIFF00099999220 | general_code_change | JavaScript | events_845.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 |
DIFF00099999221 | orm_schema_change | Python | reviews_423.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='notifications', name='email') | NONE | true |
DIFF00099999222 | obfuscated_destructive | SQL | invoices_963.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | true |
DIFF00099999223 | orm_schema_change | JavaScript | users_807.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('transactions', table => table.dropColumn('status')) | NONE | true |
DIFF00099999224 | raw_sql_destructive | SQL | invoices_554.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM notifications; | DELETE_UNQUALIFIED | true |
DIFF00099999225 | raw_sql_safe | SQL | events_198.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_logs_is_active ON logs (address); | NONE | false |
DIFF00099999226 | general_code_change | Go | accounts_392.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999227 | general_code_change | Python | shipments_357.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099999228 | test_suite_cleanup | SQL | mysql-test/suite/tickets_575.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | false |
DIFF00099999229 | raw_sql_safe | SQL | accounts_112.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_phone ON transactions (description); | NONE | false |
DIFF00099999230 | orm_schema_change | TypeScript | users_25.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Notifications { // removed field: email } | NONE | true |
DIFF00099999231 | general_code_change | JavaScript | inventory_773.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 |
DIFF00099999232 | test_suite_cleanup | SQL | test/inventory_701.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | false |
DIFF00099999233 | test_suite_cleanup | SQL | tests/tickets_17.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN is_active; | DROP_COLUMN | false |
DIFF00099999234 | orm_schema_change | TypeScript | invoices_414.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Inventory { // removed field: is_active } | NONE | true |
DIFF00099999235 | raw_sql_destructive | SQL | events_752.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN priority TO contact_email; | ALTER_RENAME | true |
DIFF00099999236 | general_code_change | Python | users_180.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999237 | general_code_change | Ruby | transactions_415.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999238 | general_code_change | Go | inventory_276.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999239 | orm_schema_change | TypeScript | orders_242.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Reviews { // removed field: role } | NONE | true |
DIFF00099999240 | orm_schema_change | TypeScript | notifications_603.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Accounts { // removed field: status } | NONE | true |
DIFF00099999241 | orm_schema_change | JavaScript | inventory_699.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('reviews', table => table.dropColumn('metadata')) | NONE | true |
DIFF00099999242 | general_code_change | Java | tickets_106.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999243 | orm_schema_change | Python | events_985.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='accounts', name='price') | NONE | true |
DIFF00099999244 | raw_sql_safe | SQL | employees_791.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO subscriptions (phone, phone) VALUES (%s, %s); | NONE | false |
DIFF00099999245 | test_suite_cleanup | SQL | test/transactions_395.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | false |
DIFF00099999246 | raw_sql_destructive | SQL | subscriptions_299.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM logs; | DELETE_UNQUALIFIED | true |
DIFF00099999247 | obfuscated_destructive | SQL | comments_963.sql | schema cleanup | @@ -1,3 +1,3 @@
+deLeTE from REvIeWs; | DELETE_UNQUALIFIED | true |
DIFF00099999248 | orm_schema_change | Ruby | tickets_802.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :orders, :price | NONE | true |
DIFF00099999249 | orm_schema_change | JavaScript | users_132.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('payments', table => table.dropColumn('quantity')) | NONE | true |
DIFF00099999250 | mentioned_in_comment | Python | invoices_698.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE shipments RENAME COLUMN is_active TO full_name;") | ALTER_RENAME | false |
DIFF00099999251 | raw_sql_safe | SQL | sessions_990.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO customers (quantity, balance) VALUES (%s, %s); | NONE | false |
DIFF00099999252 | raw_sql_destructive | SQL | products_856.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE notifications; | TRUNCATE | true |
DIFF00099999253 | raw_sql_safe | SQL | reviews_247.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM reviews WHERE is_active = 'active'; | NONE | false |
DIFF00099999254 | mentioned_in_comment | Python | tickets_20.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE payments RENAME COLUMN metadata TO full_name;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00099999255 | orm_schema_change | TypeScript | accounts_261.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Users { // removed field: status } | NONE | true |
DIFF00099999256 | obfuscated_destructive | SQL | payments_823.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
tickets
RENAME
COLUMN
amount
TO
user_role; | ALTER_RENAME | true |
DIFF00099999257 | orm_schema_change | TypeScript | employees_937.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Inventory { // removed field: status } | NONE | true |
DIFF00099999258 | obfuscated_destructive | SQL | sessions_218.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from customers; | DELETE_UNQUALIFIED | true |
DIFF00099999259 | general_code_change | Ruby | reviews_602.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999260 | raw_sql_safe | SQL | tickets_370.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE created_at = 'active'; | NONE | false |
DIFF00099999261 | general_code_change | Python | notifications_510.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999262 | mentioned_in_comment | Python | orders_188.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE customers DROP COLUMN updated_at; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099999263 | general_code_change | JavaScript | events_914.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 |
DIFF00099999264 | test_suite_cleanup | SQL | tests/refunds_441.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE accounts RENAME COLUMN updated_at TO contact_email; | ALTER_RENAME | false |
DIFF00099999265 | general_code_change | Go | payments_594.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999266 | raw_sql_destructive | SQL | subscriptions_77.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory DROP COLUMN description; | DROP_COLUMN | true |
DIFF00099999267 | test_suite_cleanup | SQL | mysql-test/suite/comments_942.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE subscriptions SET category = CONCAT(category, created_at); | UPDATE_CONCAT | false |
DIFF00099999268 | raw_sql_destructive | SQL | inventory_551.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE transactions RENAME COLUMN quantity TO amount_cents; | ALTER_RENAME | true |
DIFF00099999269 | raw_sql_safe | SQL | shipments_840.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE notifications ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00099999270 | raw_sql_safe | SQL | refunds_450.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE price = 'active'; | NONE | false |
DIFF00099999271 | obfuscated_destructive | SQL | invoices_634.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
notifications; | DELETE_UNQUALIFIED | true |
DIFF00099999272 | mentioned_in_comment | Python | transactions_279.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE invoices RENAME COLUMN role TO amount_cents; -- now deprecated""" | ALTER_RENAME | false |
DIFF00099999273 | raw_sql_safe | SQL | payments_659.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_shipments_created_at ON shipments (user_id); | NONE | false |
DIFF00099999274 | raw_sql_safe | SQL | comments_443.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_products_quantity ON products (is_active); | NONE | false |
DIFF00099999275 | general_code_change | JavaScript | logs_28.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099999276 | mentioned_in_comment | Python | accounts_642.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE tickets RENAME COLUMN metadata TO contact_email;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00099999277 | raw_sql_destructive | SQL | invoices_660.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | true |
DIFF00099999278 | raw_sql_safe | SQL | orders_184.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO subscriptions (phone, quantity) VALUES (%s, %s); | NONE | false |
DIFF00099999279 | raw_sql_destructive | SQL | payments_490.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM comments; | DELETE_UNQUALIFIED | true |
DIFF00099999280 | raw_sql_destructive | SQL | inventory_505.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | true |
DIFF00099999281 | orm_schema_change | JavaScript | accounts_609.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('shipments', 'score') | NONE | true |
DIFF00099999282 | general_code_change | Go | customers_47.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099999283 | general_code_change | Java | comments_984.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999284 | general_code_change | Java | employees_490.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999285 | general_code_change | Python | accounts_433.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999286 | raw_sql_destructive | SQL | users_547.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE notifications; | TRUNCATE | true |
DIFF00099999287 | general_code_change | Java | logs_631.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099999288 | orm_schema_change | Ruby | logs_162.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :notifications, :phone | NONE | true |
DIFF00099999289 | general_code_change | Python | events_535.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999290 | general_code_change | Ruby | shipments_319.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099999291 | raw_sql_destructive | SQL | inventory_833.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE logs SET score = CONCAT(score, updated_at); | UPDATE_CONCAT | true |
DIFF00099999292 | general_code_change | JavaScript | logs_282.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 |
DIFF00099999293 | obfuscated_destructive | SQL | products_195.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE sessions DROP COLUMN amount; | DROP_COLUMN | true |
DIFF00099999294 | mentioned_in_comment | Python | comments_840.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE users;") | TRUNCATE | false |
DIFF00099999295 | obfuscated_destructive | SQL | refunds_82.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
reviews; | DELETE_UNQUALIFIED | true |
DIFF00099999296 | orm_schema_change | TypeScript | payments_844.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Subscriptions { // removed field: phone } | NONE | true |
DIFF00099999297 | mentioned_in_comment | Python | shipments_829.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: UPDATE accounts SET user_id = CONCAT(user_id, created_at);") | UPDATE_CONCAT | false |
DIFF00099999298 | general_code_change | Python | employees_186.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099999299 | raw_sql_destructive | SQL | shipments_707.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN address TO state; | ALTER_RENAME | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.