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 |
|---|---|---|---|---|---|---|---|
DIFF00099992100 | general_code_change | JavaScript | accounts_416.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992101 | orm_schema_change | JavaScript | events_744.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('shipments', table => table.dropColumn('role')) | NONE | true |
DIFF00099992102 | raw_sql_safe | SQL | inventory_478.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO users (email, order_id) VALUES (%s, %s); | NONE | false |
DIFF00099992103 | test_suite_cleanup | SQL | test/customers_893.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | false |
DIFF00099992104 | general_code_change | Java | accounts_772.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099992105 | raw_sql_destructive | SQL | invoices_394.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | true |
DIFF00099992106 | mentioned_in_comment | Python | invoices_697.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE invoices;") | DROP_TABLE | false |
DIFF00099992107 | test_suite_cleanup | SQL | mysql-test/suite/users_296.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE notifications; | DROP_TABLE | false |
DIFF00099992108 | raw_sql_destructive | SQL | accounts_219.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE comments SET description = CONCAT(description, created_at); | UPDATE_CONCAT | true |
DIFF00099992109 | raw_sql_safe | SQL | reviews_251.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_users_description ON users (quantity); | NONE | false |
DIFF00099992110 | raw_sql_safe | SQL | subscriptions_988.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE employees SET address = %s WHERE is_active = %s; | NONE | false |
DIFF00099992111 | general_code_change | Python | shipments_321.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992112 | raw_sql_destructive | SQL | tickets_811.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE subscriptions SET role = CONCAT(role, status); | UPDATE_CONCAT | true |
DIFF00099992113 | obfuscated_destructive | SQL | events_327.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | true |
DIFF00099992114 | obfuscated_destructive | SQL | orders_503.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
payments
DROP
COLUMN
status; | DROP_COLUMN | true |
DIFF00099992115 | test_suite_cleanup | SQL | test/notifications_92.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE invoices DROP COLUMN priority; | DROP_COLUMN | false |
DIFF00099992116 | orm_schema_change | JavaScript | comments_643.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('shipments', 'name') | NONE | true |
DIFF00099992117 | raw_sql_safe | SQL | inventory_671.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE comments ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00099992118 | orm_schema_change | JavaScript | products_295.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('tickets', table => table.dropColumn('role')) | NONE | true |
DIFF00099992119 | general_code_change | Go | comments_943.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099992120 | raw_sql_destructive | SQL | employees_247.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM sessions; | DELETE_UNQUALIFIED | true |
DIFF00099992121 | mentioned_in_comment | Python | subscriptions_256.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE orders RENAME COLUMN user_id TO state; -- now deprecated""" | ALTER_RENAME | false |
DIFF00099992122 | orm_schema_change | Python | accounts_982.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='customers', name='updated_at') | NONE | true |
DIFF00099992123 | obfuscated_destructive | SQL | transactions_958.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from tickets; | DELETE_UNQUALIFIED | true |
DIFF00099992124 | test_suite_cleanup | SQL | spec/reviews_315.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions RENAME COLUMN category TO amount_cents; | ALTER_RENAME | false |
DIFF00099992125 | test_suite_cleanup | SQL | tests/comments_972.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE employees RENAME COLUMN metadata TO amount_cents; | ALTER_RENAME | false |
DIFF00099992126 | raw_sql_safe | SQL | customers_424.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO logs (role, status) VALUES (%s, %s); | NONE | false |
DIFF00099992127 | mentioned_in_comment | Python | orders_358.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM customers;") | DELETE_UNQUALIFIED | false |
DIFF00099992128 | mentioned_in_comment | Python | customers_231.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE refunds;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099992129 | raw_sql_destructive | SQL | accounts_296.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | true |
DIFF00099992130 | orm_schema_change | JavaScript | products_59.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('events', 'address') | NONE | true |
DIFF00099992131 | general_code_change | Python | refunds_828.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992132 | general_code_change | JavaScript | tickets_335.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 |
DIFF00099992133 | raw_sql_destructive | SQL | subscriptions_38.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN name; | DROP_COLUMN | true |
DIFF00099992134 | raw_sql_safe | SQL | notifications_5.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE reviews ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099992135 | test_suite_cleanup | SQL | mysql-test/suite/accounts_598.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE invoices; | TRUNCATE | false |
DIFF00099992136 | general_code_change | JavaScript | sessions_947.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992137 | test_suite_cleanup | SQL | test/logs_348.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | false |
DIFF00099992138 | orm_schema_change | JavaScript | refunds_14.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('transactions', table => table.dropColumn('user_id')) | NONE | true |
DIFF00099992139 | obfuscated_destructive | SQL | products_200.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUncATe tAbLE CUStOmErs; | TRUNCATE | true |
DIFF00099992140 | general_code_change | Ruby | employees_324.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992141 | general_code_change | Python | events_51.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099992142 | test_suite_cleanup | SQL | mysql-test/suite/inventory_742.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE sessions; | DROP_TABLE | false |
DIFF00099992143 | orm_schema_change | JavaScript | refunds_670.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('sessions', table => table.dropColumn('priority')) | NONE | true |
DIFF00099992144 | raw_sql_safe | SQL | transactions_571.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE created_at = 'active'; | NONE | false |
DIFF00099992145 | raw_sql_safe | SQL | refunds_957.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM logs WHERE score = 'active'; | NONE | false |
DIFF00099992146 | orm_schema_change | Ruby | users_764.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :customers, :status | NONE | true |
DIFF00099992147 | general_code_change | Python | inventory_821.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992148 | orm_schema_change | Ruby | comments_909.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :sessions, :metadata | NONE | true |
DIFF00099992149 | general_code_change | Python | subscriptions_687.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992150 | test_suite_cleanup | SQL | spec/employees_832.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | false |
DIFF00099992151 | raw_sql_safe | SQL | inventory_256.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO customers (score, phone) VALUES (%s, %s); | NONE | false |
DIFF00099992152 | orm_schema_change | JavaScript | products_504.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('orders', table => table.dropColumn('order_id')) | NONE | true |
DIFF00099992153 | orm_schema_change | JavaScript | subscriptions_886.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('comments', table => table.dropColumn('description')) | NONE | true |
DIFF00099992154 | general_code_change | JavaScript | accounts_123.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 |
DIFF00099992155 | test_suite_cleanup | SQL | tests/reviews_37.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | false |
DIFF00099992156 | general_code_change | JavaScript | inventory_780.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992157 | orm_schema_change | JavaScript | logs_470.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('products', 'amount') | NONE | true |
DIFF00099992158 | general_code_change | Ruby | inventory_997.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992159 | raw_sql_destructive | SQL | payments_640.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00099992160 | test_suite_cleanup | SQL | spec/products_250.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE payments; | TRUNCATE | false |
DIFF00099992161 | raw_sql_safe | SQL | notifications_811.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE events SET description = %s WHERE email = %s; | NONE | false |
DIFF00099992162 | general_code_change | JavaScript | payments_203.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992163 | general_code_change | Ruby | reviews_690.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992164 | raw_sql_destructive | SQL | employees_198.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews DROP COLUMN score; | DROP_COLUMN | true |
DIFF00099992165 | raw_sql_destructive | SQL | refunds_527.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE reviews; | DROP_TABLE | true |
DIFF00099992166 | raw_sql_destructive | SQL | subscriptions_367.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE transactions; | DROP_TABLE | true |
DIFF00099992167 | raw_sql_destructive | SQL | employees_948.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE notifications RENAME COLUMN balance TO full_name; | ALTER_RENAME | true |
DIFF00099992168 | raw_sql_safe | SQL | employees_756.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE orders SET priority = %s WHERE role = %s; | NONE | false |
DIFF00099992169 | raw_sql_safe | SQL | invoices_450.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE shipments SET order_id = %s WHERE created_at = %s; | NONE | false |
DIFF00099992170 | test_suite_cleanup | SQL | mysql-test/suite/logs_385.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE logs SET amount = CONCAT(amount, address); | UPDATE_CONCAT | false |
DIFF00099992171 | general_code_change | Ruby | logs_462.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992172 | raw_sql_safe | SQL | tickets_920.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE employees ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00099992173 | raw_sql_destructive | SQL | accounts_372.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE logs DROP COLUMN user_id; | DROP_COLUMN | true |
DIFF00099992174 | orm_schema_change | JavaScript | invoices_632.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('logs', table => table.dropColumn('priority')) | NONE | true |
DIFF00099992175 | mentioned_in_comment | Python | refunds_74.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE transactions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099992176 | mentioned_in_comment | Python | users_107.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE inventory SET metadata = CONCAT(metadata, description); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099992177 | obfuscated_destructive | SQL | logs_513.sql | schema cleanup | @@ -1,3 +1,3 @@
+DROP
TABLE
invoices; | DROP_TABLE | true |
DIFF00099992178 | general_code_change | TypeScript | payments_593.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 |
DIFF00099992179 | raw_sql_safe | SQL | subscriptions_288.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO subscriptions (priority, priority) VALUES (%s, %s); | NONE | false |
DIFF00099992180 | general_code_change | JavaScript | transactions_68.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 |
DIFF00099992181 | general_code_change | JavaScript | tickets_204.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992182 | mentioned_in_comment | Python | orders_544.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DROP TABLE events;' manually, handled by migration tool | DROP_TABLE | false |
DIFF00099992183 | general_code_change | Python | users_553.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099992184 | raw_sql_safe | SQL | comments_976.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE price = 'active'; | NONE | false |
DIFF00099992185 | orm_schema_change | JavaScript | orders_484.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('sessions', table => table.dropColumn('description')) | NONE | true |
DIFF00099992186 | raw_sql_destructive | SQL | notifications_198.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE accounts SET email = CONCAT(email, description); | UPDATE_CONCAT | true |
DIFF00099992187 | general_code_change | Ruby | payments_240.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099992188 | raw_sql_safe | SQL | comments_560.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE accounts SET role = %s WHERE is_active = %s; | NONE | false |
DIFF00099992189 | raw_sql_destructive | SQL | tickets_838.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM orders; | DELETE_UNQUALIFIED | true |
DIFF00099992190 | obfuscated_destructive | SQL | notifications_558.sql | schema cleanup | @@ -1,3 +1,3 @@
+alTeR taBlE employeeS rENAME ColUMN is_acTIVe TO statE; | ALTER_RENAME | true |
DIFF00099992191 | test_suite_cleanup | SQL | tests/products_940.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE transactions SET name = CONCAT(name, email); | UPDATE_CONCAT | false |
DIFF00099992192 | raw_sql_safe | SQL | logs_762.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO subscriptions (score, created_at) VALUES (%s, %s); | NONE | false |
DIFF00099992193 | raw_sql_safe | SQL | payments_389.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE created_at = 'active'; | NONE | false |
DIFF00099992194 | obfuscated_destructive | SQL | reviews_25.sql | schema cleanup | @@ -1,3 +1,3 @@
+tRunCatE tAble AccOUNts; | TRUNCATE | true |
DIFF00099992195 | raw_sql_safe | SQL | products_398.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE reviews ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00099992196 | general_code_change | Go | products_682.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099992197 | mentioned_in_comment | Python | customers_226.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE tickets;") | TRUNCATE | false |
DIFF00099992198 | general_code_change | JavaScript | reviews_935.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099992199 | mentioned_in_comment | Python | customers_633.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE payments SET price = CONCAT(price, category); -- now deprecated""" | UPDATE_CONCAT | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.