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 |
|---|---|---|---|---|---|---|---|
DIFF00099996100 | raw_sql_safe | SQL | events_86.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE tickets ADD COLUMN state VARCHAR(255); | NONE | false |
DIFF00099996101 | raw_sql_safe | SQL | invoices_155.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_refunds_score ON refunds (amount); | NONE | false |
DIFF00099996102 | raw_sql_destructive | SQL | orders_87.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE customers; | DROP_TABLE | true |
DIFF00099996103 | mentioned_in_comment | Python | refunds_124.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE invoices;") | DROP_TABLE | false |
DIFF00099996104 | mentioned_in_comment | Python | employees_150.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE customers SET user_id = CONCAT(user_id, phone); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099996105 | raw_sql_safe | SQL | events_925.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM transactions WHERE phone = 'active'; | NONE | false |
DIFF00099996106 | raw_sql_safe | SQL | shipments_741.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_employees_name ON employees (phone); | NONE | false |
DIFF00099996107 | raw_sql_safe | SQL | reviews_222.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM orders WHERE status = 'active'; | NONE | false |
DIFF00099996108 | general_code_change | Python | inventory_162.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099996109 | general_code_change | Ruby | notifications_987.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996110 | test_suite_cleanup | SQL | spec/subscriptions_148.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | false |
DIFF00099996111 | orm_schema_change | Python | orders_442.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='customers', name='address') | NONE | true |
DIFF00099996112 | raw_sql_safe | SQL | employees_141.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE inventory ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099996113 | mentioned_in_comment | Python | events_725.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE customers;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00099996114 | test_suite_cleanup | SQL | mysql-test/suite/subscriptions_254.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE payments DROP COLUMN quantity; | DROP_COLUMN | false |
DIFF00099996115 | raw_sql_safe | SQL | subscriptions_2.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO comments (email, description) VALUES (%s, %s); | NONE | false |
DIFF00099996116 | test_suite_cleanup | SQL | tests/users_523.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM products; | DELETE_UNQUALIFIED | false |
DIFF00099996117 | test_suite_cleanup | SQL | tests/tickets_798.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions DROP COLUMN priority; | DROP_COLUMN | false |
DIFF00099996118 | raw_sql_safe | SQL | transactions_527.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE name = 'active'; | NONE | false |
DIFF00099996119 | orm_schema_change | JavaScript | customers_215.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('payments', 'phone') | NONE | true |
DIFF00099996120 | obfuscated_destructive | SQL | sessions_208.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table users drop column quantity; | DROP_COLUMN | true |
DIFF00099996121 | orm_schema_change | TypeScript | shipments_725.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Employees { // removed field: role } | NONE | true |
DIFF00099996122 | obfuscated_destructive | SQL | customers_951.sql | schema cleanup | @@ -1,3 +1,3 @@
+update shipments set metadata = concat(metadata, amount); | UPDATE_CONCAT | true |
DIFF00099996123 | general_code_change | Ruby | reviews_324.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996124 | obfuscated_destructive | SQL | notifications_837.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP
TABLE
employees; | DROP_TABLE | true |
DIFF00099996125 | raw_sql_safe | SQL | subscriptions_88.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE products SET priority = %s WHERE amount = %s; | NONE | false |
DIFF00099996126 | general_code_change | Python | invoices_13.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996127 | general_code_change | JavaScript | shipments_322.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996128 | general_code_change | JavaScript | invoices_294.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996129 | raw_sql_safe | SQL | products_749.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_orders_name ON orders (updated_at); | NONE | false |
DIFF00099996130 | obfuscated_destructive | SQL | shipments_50.sql | schema cleanup | @@ -1,3 +1,3 @@
+update comments set order_id = concat(order_id, phone); | UPDATE_CONCAT | true |
DIFF00099996131 | test_suite_cleanup | SQL | test/sessions_712.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events DROP COLUMN balance; | DROP_COLUMN | false |
DIFF00099996132 | general_code_change | TypeScript | reviews_361.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 |
DIFF00099996133 | test_suite_cleanup | SQL | mysql-test/suite/notifications_134.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events DROP COLUMN user_id; | DROP_COLUMN | false |
DIFF00099996134 | test_suite_cleanup | SQL | mysql-test/suite/shipments_361.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM invoices; | DELETE_UNQUALIFIED | false |
DIFF00099996135 | orm_schema_change | JavaScript | invoices_54.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('events', table => table.dropColumn('email')) | NONE | true |
DIFF00099996136 | raw_sql_safe | SQL | inventory_131.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE notifications SET phone = %s WHERE created_at = %s; | NONE | false |
DIFF00099996137 | general_code_change | TypeScript | inventory_622.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 |
DIFF00099996138 | test_suite_cleanup | SQL | test/subscriptions_873.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | false |
DIFF00099996139 | test_suite_cleanup | SQL | tests/sessions_545.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE refunds; | TRUNCATE | false |
DIFF00099996140 | mentioned_in_comment | Python | sessions_257.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM accounts;") | DELETE_UNQUALIFIED | false |
DIFF00099996141 | raw_sql_safe | SQL | accounts_126.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO inventory (updated_at, category) VALUES (%s, %s); | NONE | false |
DIFF00099996142 | orm_schema_change | TypeScript | tickets_611.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Tickets { // removed field: status } | NONE | true |
DIFF00099996143 | orm_schema_change | Ruby | refunds_252.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :products, :updated_at | NONE | true |
DIFF00099996144 | mentioned_in_comment | Python | inventory_920.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE subscriptions SET email = CONCAT(email, amount);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00099996145 | orm_schema_change | Ruby | employees_20.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :payments, :role | NONE | true |
DIFF00099996146 | orm_schema_change | JavaScript | logs_802.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('notifications', 'status') | NONE | true |
DIFF00099996147 | orm_schema_change | JavaScript | payments_87.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('users', table => table.dropColumn('description')) | NONE | true |
DIFF00099996148 | general_code_change | TypeScript | transactions_321.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 |
DIFF00099996149 | general_code_change | TypeScript | accounts_345.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 |
DIFF00099996150 | general_code_change | JavaScript | refunds_446.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996151 | orm_schema_change | TypeScript | notifications_694.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Refunds { // removed field: is_active } | NONE | true |
DIFF00099996152 | general_code_change | JavaScript | logs_199.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996153 | raw_sql_safe | SQL | subscriptions_527.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE inventory SET price = %s WHERE price = %s; | NONE | false |
DIFF00099996154 | raw_sql_destructive | SQL | shipments_430.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE customers; | TRUNCATE | true |
DIFF00099996155 | mentioned_in_comment | Python | inventory_504.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM accounts;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00099996156 | orm_schema_change | JavaScript | subscriptions_471.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('sessions', 'status') | NONE | true |
DIFF00099996157 | raw_sql_destructive | SQL | subscriptions_122.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE tickets SET balance = CONCAT(balance, email); | UPDATE_CONCAT | true |
DIFF00099996158 | raw_sql_destructive | SQL | logs_751.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews DROP COLUMN is_active; | DROP_COLUMN | true |
DIFF00099996159 | orm_schema_change | JavaScript | orders_425.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('tickets', table => table.dropColumn('email')) | NONE | true |
DIFF00099996160 | general_code_change | Ruby | reviews_718.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996161 | general_code_change | TypeScript | events_239.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 |
DIFF00099996162 | obfuscated_destructive | SQL | tickets_696.sql | schema cleanup | @@ -1,3 +1,3 @@
+update subscriptions set score = concat(score, phone); | UPDATE_CONCAT | true |
DIFF00099996163 | general_code_change | JavaScript | accounts_569.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996164 | general_code_change | Java | events_462.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996165 | orm_schema_change | JavaScript | subscriptions_900.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('inventory', 'user_id') | NONE | true |
DIFF00099996166 | obfuscated_destructive | SQL | tickets_439.sql | schema cleanup | @@ -1,3 +1,3 @@
+deLetE FrOM reviews; | DELETE_UNQUALIFIED | true |
DIFF00099996167 | test_suite_cleanup | SQL | spec/accounts_27.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE logs SET balance = CONCAT(balance, is_active); | UPDATE_CONCAT | false |
DIFF00099996168 | obfuscated_destructive | SQL | refunds_120.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN priority; | DROP_COLUMN | true |
DIFF00099996169 | raw_sql_destructive | SQL | tickets_901.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | true |
DIFF00099996170 | raw_sql_safe | SQL | payments_341.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM orders WHERE priority = 'active'; | NONE | false |
DIFF00099996171 | raw_sql_destructive | SQL | users_390.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE orders SET order_id = CONCAT(order_id, updated_at); | UPDATE_CONCAT | true |
DIFF00099996172 | test_suite_cleanup | SQL | mysql-test/suite/sessions_503.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN price; | DROP_COLUMN | false |
DIFF00099996173 | general_code_change | Ruby | logs_48.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996174 | obfuscated_destructive | SQL | sessions_741.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
payments; | DELETE_UNQUALIFIED | true |
DIFF00099996175 | general_code_change | Java | events_20.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996176 | general_code_change | JavaScript | transactions_54.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 |
DIFF00099996177 | test_suite_cleanup | SQL | tests/products_580.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | false |
DIFF00099996178 | test_suite_cleanup | SQL | test/products_941.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE logs SET name = CONCAT(name, created_at); | UPDATE_CONCAT | false |
DIFF00099996179 | obfuscated_destructive | SQL | subscriptions_766.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE inventory; | TRUNCATE | true |
DIFF00099996180 | raw_sql_safe | SQL | customers_689.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM employees WHERE quantity = 'active'; | NONE | false |
DIFF00099996181 | general_code_change | Python | orders_978.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996182 | obfuscated_destructive | SQL | comments_313.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE invoices RENAME COLUMN address TO user_role; | ALTER_RENAME | true |
DIFF00099996183 | general_code_change | Ruby | transactions_433.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996184 | orm_schema_change | Python | invoices_402.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='notifications', name='user_id') | NONE | true |
DIFF00099996185 | orm_schema_change | JavaScript | orders_654.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('sessions', 'amount') | NONE | true |
DIFF00099996186 | test_suite_cleanup | SQL | tests/refunds_824.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | false |
DIFF00099996187 | orm_schema_change | JavaScript | logs_352.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('tickets', 'name') | NONE | true |
DIFF00099996188 | raw_sql_safe | SQL | employees_403.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (price, created_at) VALUES (%s, %s); | NONE | false |
DIFF00099996189 | general_code_change | Go | inventory_338.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099996190 | obfuscated_destructive | SQL | transactions_477.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
events; | DELETE_UNQUALIFIED | true |
DIFF00099996191 | orm_schema_change | Ruby | employees_274.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :events, :is_active | NONE | true |
DIFF00099996192 | general_code_change | Ruby | tickets_546.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996193 | raw_sql_safe | SQL | logs_118.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM inventory WHERE name = 'active'; | NONE | false |
DIFF00099996194 | test_suite_cleanup | SQL | test/transactions_829.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions RENAME COLUMN balance TO amount_cents; | ALTER_RENAME | false |
DIFF00099996195 | test_suite_cleanup | SQL | spec/users_283.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE accounts SET metadata = CONCAT(metadata, created_at); | UPDATE_CONCAT | false |
DIFF00099996196 | raw_sql_destructive | SQL | invoices_921.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM customers; | DELETE_UNQUALIFIED | true |
DIFF00099996197 | obfuscated_destructive | SQL | tickets_409.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
logs
DROP
COLUMN
updated_at; | DROP_COLUMN | true |
DIFF00099996198 | raw_sql_destructive | SQL | products_223.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN address TO contact_email; | ALTER_RENAME | true |
DIFF00099996199 | orm_schema_change | TypeScript | users_259.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Logs { // removed field: quantity } | NONE | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.